updated the reader to transform the assignment expression to set/set-r expressions.
All checks were successful
continuous-integration/drone/push Build is passing

updated the compiler to handle the assignment expression
This commit is contained in:
2024-08-28 00:58:56 +09:00
parent 8602a479d7
commit 8597f532fa
3 changed files with 193 additions and 23 deletions

View File

@ -31,7 +31,7 @@ defun String length() { ##ERROR: syntax error - no argument list
---
class A [ 10 ] { ##ERROR: syntax error - invalid name - not symbol in tuple - 10
class A [ 10 ] { ##ERROR: syntax error - not variable name - 10
}
---
@ -44,9 +44,26 @@ class A [ [ [a] ] ] { ##ERROR: syntax error - not variable name
}
---
class A [ a + ] { ##ERROR: syntax error - invalid name - not symbol in tuple - +
class A [ a + ] { ##ERROR: syntax error - not variable name - +
}
---
class A [ + ] { ##ERROR: syntax error - invalid name - not symbol in tuple - +
class A [ + ] { ##ERROR: syntax error - not variable name - +
}
---
fun xxx(x :: p q) { p := (x + 1); q := (x + 2) }
[a,[b]] := (xxx 20) ##ERROR: syntax error - invalid lvalue - not symbol in tuple
printf "%d %d\n" a b
---
20 := 90 ##ERROR: syntax error - invalid lvalue - not symbol - 20
---
[a b] := 10 ##ERROR: syntax error - non-function call/non-message send disallowed
---
[] := 10 ##ERROR: syntax error - invalid lvalue