feat: yjs keyword sharable

This commit is contained in:
Xuxin Wang 2023-06-25 16:35:21 +08:00
parent 8e06d0bc81
commit 00a3f79fb8
2 changed files with 14 additions and 0 deletions

View File

@ -140,6 +140,7 @@ In: 'in';
Try: 'try'; Try: 'try';
Event: 'event'; Event: 'event';
AtToken: '@'; AtToken: '@';
Sharable: 'sharable';
/// Event Semantics /// Event Semantics

View File

@ -63,6 +63,7 @@ clzOrFunctionDeclaration
|functionDeclaration |functionDeclaration
|interfaceDeclaration |interfaceDeclaration
|eventDeclaration |eventDeclaration
|sharableDeclaration
; ;
interfaceDeclaration interfaceDeclaration
@ -120,6 +121,17 @@ block
statementList statementList
: statement+ : statement+
; ;
sharableDeclaration
: sharableStatement
;
sharableStatement
: sharableModifier variableDeclarationList eos
;
sharableModifier // let, const - ECMAScript 6
: Sharable
;
variableStatement variableStatement
: varModifier variableDeclarationList eos : varModifier variableDeclarationList eos
@ -441,6 +453,7 @@ keyword
| Protected | Protected
| Static | Static
| Yield | Yield
| Sharable
; ;
eos eos