Phase 8.1: ! (unwrap/panic) operator — syntax, parsing, HIR lowering, runtime panic
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user