enhanced the reader and compiler to treat the binop expression like a message-send expression
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-03 12:18:08 +09:00
parent 4c1a50df83
commit a62b89cea9
18 changed files with 197 additions and 106 deletions

View File

@ -11,13 +11,13 @@ defun x(a b ... :: x y z) {
|i|
x := (va-count)
y := (a * b)
z := (a + b)
y := (* a b)
z := (+ a b)
i := 0;
while (i < (va-count)) {
while (< i (va-count)) {
printf "VA[%d]=>[%d]\n" i (va-get i)
i := (i + 1)
i := (+ i 1)
}
fn-y "hello" "world" (va-context)
@ -25,31 +25,31 @@ defun x(a b ... :: x y z) {
}
t := (x 10 20 30);
if (/= t 1) {
if (~= t 1) {
printf "ERROR: t is not 1\n"
} else {
printf "OK: %d\n" t
}
t := ([a b c] := (x 10 20 30 40 50));
if (/= t 3) {
if (~= t 3) {
printf "ERROR: t is not 3\n"
} else {
printf "OK: %d\n" t
}
if (/= a 3) {
if (~= a 3) {
printf "ERROR: a is not 3\n"
} else {
printf "OK: %d\n" a
}
if (/= b 200) {
if (~= b 200) {
printf "ERROR: b is not 200\n"
} else {
printf "OK: %d\n" b
}
if (/= c 30) {
if (~= c 30) {
printf "ERROR: c is not 30\n"
} else {
printf "OK: %d\n" c