Skip to content

Commit 4cd526f

Browse files
committed
Unsafe evolution: unsafe expressions
1 parent 54e46c1 commit 4cd526f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/syntax.grammar

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ternary @right,
3535
params,
3636
anonMethod,
37+
localFunc,
3738
topLevelLocalFunc,
3839
arrow @right,
3940
assign @right,
@@ -482,6 +483,7 @@ PrimaryNoArrayCreationExpr[group=Expression] {
482483
| FieldExpr
483484
| NameofExpr
484485
| SwitchExpr
486+
| UnsafeExpr
485487
| WithExpr
486488
| AnonMethodExpr
487489
| pointerMemberAccess
@@ -758,6 +760,9 @@ SwitchExpr[group=Expression] {
758760

759761
switchExprBranch { pattern (kw<'when'> expr)? !arrow '=>' expr }
760762

763+
// Unsafe expression
764+
765+
UnsafeExpr[group=Expression] { kw<'unsafe'> !localFunc parens<expr> }
761766

762767
// With expression
763768

0 commit comments

Comments
 (0)