########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1982-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# David Korn <dgk@research.att.com> #
# #
########################################################################
function err_exit
{
print -u2 -n "\t"
}
alias err_exit='err_exit $LINENO'
integer Errors=0
typeset -T Pt_t=(
float x=1
float y=0
len()
{
}
)
for ((i=0; i < 100; i++))
do
Pt_t p
Pt_t q=(y=2)
q.len()
{
}
p=q
unset p q
[[ ${pp[1]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[1] is not correct'
pp+=( x=6 y=8)
[[ ${pp[4]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[4] is not correct'
unset pp
[[ ${pp[two]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[two] is not correct'
unset pp
done
# redefinition of point
typeset -T Pt_t=(
Pt_t _=(x=3 y=6)
float z=2
len()
{
}
)
Pt_t p
z=()
eval y="$z"
eval "$(typeset -p y)"
unset z y
z=()
eval y="$z"
eval "$(typeset -p y)"
unset z y
typeset -T A_t=(
Pt_t -a b
)
typeset -T B_t=(
Pt_t -A b
)
A_t r
eval s="$r"
eval "$(typeset -p s)"
unset r s
B_t r
eval s="$r"
eval "$(typeset -p s)"