feat: update event mechanism

add event type local and global, clients have to use contractID and topic to subscribe local event; allow clients to subscribe topics (will not be recorded)
This commit is contained in:
Frank.R.Wu 2021-10-31 23:07:15 +08:00
parent 27ab55c84f
commit af0637377e
2 changed files with 14 additions and 5 deletions

View File

@ -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';

View File

@ -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
;