fixes #21144; try expression will not match the less indentation except (#21152)

fixes #21144; try expression will not match the less indent except
This commit is contained in:
ringabout 2022-12-22 04:46:14 +08:00 • committed by GitHub
commit d0721eadf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

27
tests/parser/ttry.nim Normal file
View file

@ -0,0 +1,27 @@
# bug #21144
block:
try:
let c = try:
10
except ValueError as exc:
10
except ValueError as exc:
discard
if true:
block:
let c = try:
10
except ValueError as exc:
10
except OSError:
99
try:
let c = try:
10
except ValueError as exc:
10
except ValueError as exc:
discard