enhanced the reader to perform sanity check on a tuple in advance

This commit is contained in:
2024-07-13 17:40:27 +09:00
parent 0d5907b726
commit 7754d7c7e9
3 changed files with 16 additions and 9 deletions

View File

@ -52,7 +52,7 @@ a := #{
(printf "hello\n")
);;
k := [10 ; 20 ]; ##ERROR: syntax error - unexpected semicolon
k := #[10 ; 20 ]; ##ERROR: syntax error - unexpected semicolon
}

View File

@ -31,7 +31,7 @@ defun String length() { ##ERROR: syntax error - no argument list
---
class A [ 10 ] { ##ERROR: syntax error - not variable name - 10
class A [ 10 ] { ##ERROR: syntax error - invalid name - not symbol in tuple - 10
}
---
@ -47,7 +47,6 @@ class A [ [ [a] ] ] { ##ERROR: syntax error - not variable name
class A [ a + ] { ##ERROR: syntax error - prohibited binary operator - +
}
## TODO: This check is supposed to fail. + must be treated as a binop symbol
##---
##class A [ + ] { ## ERROR: syntax error - prohibited binary operator - +
##}
---
class A [ + ] { ##ERROR: syntax error - prohibited binary operator - +
}