diff --git a/input/JavaScriptLexer.g4 b/input/JavaScriptLexer.g4 index ad92354..c7d17c3 100644 --- a/input/JavaScriptLexer.g4 +++ b/input/JavaScriptLexer.g4 @@ -138,15 +138,20 @@ Throw: 'throw'; Delete: 'delete'; In: 'in'; Try: 'try'; -Event: 'event'; -AtToken: '@'; +Event: 'event'; +AtToken: '@'; /// Event Semantics -AtLeastOnce: 'AT_LEAST_ONCE'; +AtLeastOnce: 'AT_LEAST_ONCE'; AtMostOnce: 'AT_MOST_ONCE'; OnlyOnce: 'ONLY_ONCE'; +// Event Global or Local + +Global: 'global'; +Local: 'local'; + /// Future Reserved Words Class: 'class'; diff --git a/input/YJSParser.g4 b/input/YJSParser.g4 index 03f29f1..e8e01a5 100644 --- a/input/YJSParser.g4 +++ b/input/YJSParser.g4 @@ -69,9 +69,13 @@ eventSemantics |OnlyOnce ; eventDeclaration - :Event eventSemantics? Identifier SemiColon -// |Event eventSemantics? Identifier '(' annotationArgs? ')' SemiColon + :Event eventGlobalOrLocal? Identifier SemiColon + |Event eventGlobalOrLocal? Identifier '(' eventSemantics? ')' SemiColon ; +eventGlobalOrLocal + :Global + |Local + ; sourceElement : statement ;