changed the syntax of the class-level variable declacration to use square brackets
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-07-09 23:44:24 +09:00
parent e91c9da9d4
commit 8f87dbe008
9 changed files with 113 additions and 151 deletions

View File

@ -1,4 +1,4 @@
defclass A | a | {
defclass A [ a ] {
defun :* init1() {
| b |
set b (+ 1 2);
@ -28,3 +28,26 @@ defclass A | a | {
defun String length() { ##ERROR: syntax error - no argument list
}
---
class A [ 10 ] { ##ERROR: syntax error - not variable name - 10
}
---
class A [ a := 20 ] { ##ERROR: syntax error - := disallowed
}
---
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 - +
##}