Grammar for unchecked.

This commit is contained in:
chriseth 2020-09-16 12:55:24 +02:00
parent 527c073bb9
commit 33d8b62d06
2 changed files with 6 additions and 2 deletions

View File

@ -368,7 +368,10 @@ numberLiteral: (DecimalNumber | HexNumber) NumberUnit?;
/**
* A curly-braced block of statements. Opens its own scope.
*/
block: LBrace statement* RBrace;
block:
LBrace ( statement | uncheckedBlock )* RBrace;
uncheckedBlock: Unchecked block;
statement:
block

View File

@ -7,7 +7,7 @@ ReservedKeywords:
'after' | 'alias' | 'apply' | 'auto' | 'case' | 'copyof' | 'default' | 'define' | 'final'
| 'implements' | 'in' | 'inline' | 'let' | 'macro' | 'match' | 'mutable' | 'null' | 'of'
| 'partial' | 'promise' | 'reference' | 'relocatable' | 'sealed' | 'sizeof' | 'static'
| 'supports' | 'switch' | 'typedef' | 'typeof' | 'unchecked' | 'var';
| 'supports' | 'switch' | 'typedef' | 'typeof' | 'var';
Pragma: 'pragma' -> pushMode(PragmaMode);
Abstract: 'abstract';
@ -87,6 +87,7 @@ True: 'true';
Try: 'try';
Type: 'type';
Ufixed: 'ufixed' | ('ufixed' [0-9]+ 'x' [0-9]+);
Unchecked: 'unchecked';
/**
* Sized unsigned integer types.
* uint is an alias of uint256.