This commit is contained in:
hlaaftana
2021-11-24 09:08:07 +03:00
committed by GitHub
parent 5933aece9b
commit 2859069dbe
2 changed files with 10 additions and 1 deletions

View File

@@ -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

9
tests/parser/t12274.nim Normal file
View File

@@ -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]