updated the reader to forge an outer xlist automatically if the beginning is a complex literal expression like array([]), dictionary(#{}), etc
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-14 09:48:57 +09:00
parent eb6e0484af
commit 48a54d61c1
6 changed files with 81 additions and 3 deletions

View File

@ -6,9 +6,11 @@ check_SCRIPTS = \
insta-02.hcl \
ret-01.hcl \
retvar-01.hcl \
va-01.hcl
va-01.hcl \
var-02.hcl
check_ERRORS = \
call-01.err \
class-01.err \
do-01.err \
do-02.err \

View File

@ -477,9 +477,11 @@ check_SCRIPTS = \
insta-02.hcl \
ret-01.hcl \
retvar-01.hcl \
va-01.hcl
va-01.hcl \
var-01.hcl
check_ERRORS = \
call-01.err \
class-01.err \
do-01.err \
do-02.err \

3
t/call-01.err Normal file
View File

@ -0,0 +1,3 @@
## the expression begins with a dictionary expression.
## it is not a function name and can'be be invoked.
#{100:1, 200: 3}; ##ERROR: syntax error - invalid callable

24
t/var-02.hcl Normal file
View File

@ -0,0 +1,24 @@
defun x (a ::: x y z) {
x := (* a a);
y := (+ a a);
z := (- x y);
};
j := 21;
if (eqv? j 20) {
[a,b,c] := (x 20);
q := (x 20);
} else {
[a,b,c] := (x 30);
q := (x 30);
};
if (/= a 900) { print "ERROR: a is not 900\n" }
else { printf "OK: %d\n" a };
if (/= b 60) { print "ERROR: b is not 60\n" }
else { printf "OK: %d\n" b };
if (/= c 840) { print "ERROR: c is not 840\n" }
else { printf "OK: %d\n" c };