mirror of
https://gitee.com/BDWare/genparser
synced 2026-02-14 13:39:25 +00:00
feat: add keyword of functions
add keyword "view" for functions, to record functions that don't change contract status after execution
This commit is contained in:
@@ -63,11 +63,6 @@ clzOrFunctionDeclaration
|
||||
|functionDeclaration
|
||||
|eventDeclaration
|
||||
;
|
||||
eventSemantics
|
||||
:AtLeastOnce
|
||||
|AtMostOnce
|
||||
|OnlyOnce
|
||||
;
|
||||
eventDeclaration
|
||||
:Event eventGlobalOrLocal? Identifier SemiColon
|
||||
|Event eventGlobalOrLocal? Identifier '(' eventSemantics? ')' SemiColon
|
||||
@@ -76,6 +71,11 @@ eventGlobalOrLocal
|
||||
:Global
|
||||
|Local
|
||||
;
|
||||
eventSemantics
|
||||
:AtLeastOnce
|
||||
|AtMostOnce
|
||||
|OnlyOnce
|
||||
;
|
||||
sourceElement
|
||||
: statement
|
||||
;
|
||||
@@ -213,7 +213,7 @@ debuggerStatement
|
||||
;
|
||||
|
||||
functionDeclaration
|
||||
: annotations? Export? Function Identifier '(' formalParameterList? ')' '{' functionBody '}'
|
||||
: annotations? Export? Function Identifier '(' formalParameterList? ')' View '{' functionBody '}'
|
||||
;
|
||||
|
||||
classDeclaration
|
||||
|
||||
Reference in New Issue
Block a user