Phase 8.1: ! (unwrap/panic) operator — syntax, parsing, HIR lowering, runtime panic

This commit is contained in:
2026-05-31 13:45:55 +03:00
parent 3949a2f91e
commit 98d1354b7a
7 changed files with 59 additions and 0 deletions
+3
View File
@@ -508,6 +508,9 @@ proc parsePostfix(p: var Parser): Expr =
of tkQuestion:
discard p.advance()
left = Expr(kind: ekTry, loc: loc, exprTryOperand: left, exprTryType: nil)
of tkBang:
discard p.advance()
left = Expr(kind: ekUnwrap, loc: loc, exprUnwrapOperand: left)
of tkLBrace:
if p.structInitAllowed and left.kind in {ekIdent, ekPath, ekGenericCall}:
discard p.advance()