enhanced the reader to check lvalue for assignment in advance
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-10 12:09:56 +09:00
parent 00ad4dd779
commit f6f4d0f259
4 changed files with 47 additions and 26 deletions

View File

@ -63,6 +63,22 @@ if (k = 80) {
};
## --------------------------------------
## multiple return values
defun f(a :: b c) { b := (a + 10); c := (a + 20) }
[x, y] := (f 9)
if (x = 19) {
printf "OK - %d\n" x
} else {
printf "ERROR - %d\n" x
}
if (y = 29) {
printf "OK - %d\n" y
} else {
printf "ERROR - %d\n" y
}
## --------------------------------------
defclass A | a b c | {
defun :* newInstance(x y z) {
set a x