Skip to content

Commit

Permalink
fix #12274 (#19180)
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn authored Nov 24, 2021
1 parent 5933aec commit 2859069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ proc isExprStart(p: Parser): bool =
of tkSymbol, tkAccent, tkOpr, tkNot, tkNil, tkCast, tkIf, tkFor,
tkProc, tkFunc, tkIterator, tkBind, tkBuiltInMagics,
tkParLe, tkBracketLe, tkCurlyLe, tkIntLit..tkCustomLit, tkVar, tkRef, tkPtr,
tkTuple, tkObject, tkWhen, tkCase, tkOut:
tkTuple, tkObject, tkWhen, tkCase, tkOut, tkTry, tkBlock:
result = true
else: result = false

Expand Down
9 changes: 9 additions & 0 deletions tests/parser/t12274.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var s: seq[int]
s.add block:
let i = 1
i
s.add try:
2
except:
3
doAssert s == @[1, 2]

0 comments on commit 2859069

Please sign in to comment.