Small parser loop fix (#17904)

* Fix loop on error with nim check in semiStmtList
* Add test
This commit is contained in:
Clyybber 2021-04-30 17:17:29 +02:00 • committed by GitHub
commit 76f93877cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -556,6 +556,7 @@ proc semiStmtList(p: var Parser, result: PNode) =
let a = complexOrSimpleStmt(p)
if a.kind == nkEmpty:
parMessage(p, errExprExpected, p.tok)
getTok(p)
else:
result.add a
dec p.inSemiStmtList