Update GDScript EBNF grammar

- More assignment operator
- $ get_node shorthand
- base class function call
This commit is contained in:
Student Main
2021-06-11 00:17:58 +08:00
parent 11f715112b
commit 7fe1cb7ed4
@@ -108,7 +108,8 @@ for reference purposes.
| "return" [ expression ] stmtEnd
;
assignmentStmt = subscription "=" expression stmtEnd;
assignmentStmt = subscription ( "=" | "+=" | "-=" | "*=" | "/="
| "%=" | "&=" | "|=" | "^=" ) expression stmtEnd;
varDeclStmt = "var" IDENTIFIER [ "=" expression ] stmtEnd;
assertStmt = "assert" "(" expression [ "," STRING ] ")" stmtEnd ;
@@ -136,7 +137,10 @@ for reference purposes.
sign = ( "-" | "+" ) sign | bitNot ;
bitNot = "~" bitNot | is ;
is = call [ "is" ( IDENTIFIER | BUILTINTYPE ) ] ;
call = attribute [ "(" [ argList ] ")" ];
call
= (attribute [ "(" [ argList ] ")" ])
| "." IDENTIFIER "(" [ argList ] ")"
| "$" ( STRING | IDENTIFIER { '/' IDENTIFIER } );
attribute = subscription { "." IDENTIFIER } ;
subscription = primary [ "[" expression "]" ] ;
primary = "true" | "false" | "null" | "self" | literal | arrayDecl