From 7fe1cb7ed4d4257bd668d264e65f5375b034dc0f Mon Sep 17 00:00:00 2001 From: Student Main Date: Fri, 11 Jun 2021 00:17:58 +0800 Subject: [PATCH] Update GDScript EBNF grammar - More assignment operator - $ get_node shorthand - base class function call --- development/file_formats/gdscript_grammar.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/development/file_formats/gdscript_grammar.rst b/development/file_formats/gdscript_grammar.rst index 01e21f56c..a766cf2d4 100644 --- a/development/file_formats/gdscript_grammar.rst +++ b/development/file_formats/gdscript_grammar.rst @@ -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