summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/parser.nim2
-rw-r--r--tests/parser/t12274.nim9
2 files changed, 10 insertions, 1 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index aedf62d54..0ef6d1f54 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -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
 
diff --git a/tests/parser/t12274.nim b/tests/parser/t12274.nim
new file mode 100644
index 000000000..40c85f158
--- /dev/null
+++ b/tests/parser/t12274.nim
@@ -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]