From 58bd8b3b09a11ee2f698e21608ef71c65d97f804 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 3 Feb 2010 02:38:30 -0500 Subject: Implement #while. --- tests/dimension/directives.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'tests/dimension/directives.sh') diff --git a/tests/dimension/directives.sh b/tests/dimension/directives.sh index 198e25b..9152d2f 100755 --- a/tests/dimension/directives.sh +++ b/tests/dimension/directives.sh @@ -29,21 +29,32 @@ directives_exp="$(echo -n \ #ifdef \( (identifier "Unused") \) (identifier "Illegal") #end - #if \( #if \( (integer "1") = (integer "1") \) (integer "0") #end = (integer "0") & (integer "0") \) - error (identifier "Illegal") - #else - sphere { - (identifier "Center") , (identifier "R") - pigment { - color (identifier "Color") green (integer "1") + #declare (identifier "Counter") = (integer "0") ; + #while \( (identifier "Counter") < (integer "2") \) + #if \( #if \( (integer "1") = (integer "1") \) (integer "0") #end = (integer "0") & (integer "0") \) + error (identifier "Illegal") + #else + sphere { + (identifier "Center") + < (integer "0") , (identifier "Counter") , (integer "0") > , (identifier "R") + pigment { + color (identifier "Color") green (integer "1") + } } - } + #end + #declare (identifier "Counter") = (identifier "Counter") + (integer "1") ; #end)' \ | tr '\n' ' ' | sed -r 's/[[:space:]]+/ /g') $(echo -n \ '((sphere (vector (integer 0) (integer 0) (integer 0) (integer 0) (integer 0)) (integer 1) + (object-modifiers + (texture + (pigment (color (integer 1) (integer 1) (integer 1) + (integer 0) (integer 0)))))) + (sphere + (vector (integer 0) (integer 1) (integer 0) (integer 0) (integer 0)) + (integer 1) (object-modifiers (texture (pigment (color (integer 1) (integer 1) (integer 1) -- cgit v1.2.3