From c6f45b33686e2349d6b48b4cfadf789ba82b44df Mon Sep 17 00:00:00 2001 From: me Date: Tue, 28 May 2024 18:17:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=AD=E6=B3=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/grammar/main.bnf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/grammar/main.bnf b/src/main/grammar/main.bnf index aacd081..f2415dd 100644 --- a/src/main/grammar/main.bnf +++ b/src/main/grammar/main.bnf @@ -291,14 +291,16 @@ private FieldDeclaration ::= PropertyName ':' Type CodeBlock ::= '{' Statement* '}'{ pin=1 } -private Statement ::= (ReturnStatement|IfElseStatement|ExpressionStatement) ';'?{ - recoverWhile=recoverWhileForComponentBody +private Statement ::= (ReturnStatement|IfElseStatement|ExpressionStatement) ';'*{ +} +ExpressionStatement ::= Expression (';'+ | &'}') { + pin=1 +// recoverWhile=recoverWhileForComponentBody } -ExpressionStatement ::= Expression (';' &Statement)? //private recoverWhileStatement::=!(GenericIdentifier|';'|'}') -ReturnStatement ::= 'return' (Expression)?{ +ReturnStatement ::= ReturnKeyword (Expression)?{ pin=1 } private IfElseStatement ::= IfStatement (ElseIfStatement)* ElseStatement?{ @@ -504,7 +506,7 @@ AnimateKeyword::='animate' OutKeyword::='out' InOutKeyword::='in-out' PrivateKeyword::='private' - +ReturnKeyword::='return' //---------NamedIdentifier ,简化PsiTree----------------------------------- //noinspection BnfUnusedRule 用于标记命名节点对应的identifier Named ::= PropertyName | TypeName |ExternalName | InternalName|ComponentName|FunctionName{