bugfix: prevent endless loop in the parser for 'nimrod check'
This commit is contained in:
parent
d43febf81e
commit
74acf05e0e
1 changed files with 8 additions and 3 deletions
|
|
@ -1552,11 +1552,16 @@ proc parseAll(p: var TParser): PNode =
|
||||||
while true:
|
while true:
|
||||||
case p.tok.tokType
|
case p.tok.tokType
|
||||||
of tkSad: getTok(p)
|
of tkSad: getTok(p)
|
||||||
of tkDed, tkInd: parMessage(p, errInvalidIndentation)
|
of tkDed, tkInd:
|
||||||
of tkEof: break
|
parMessage(p, errInvalidIndentation)
|
||||||
|
getTok(p)
|
||||||
|
of tkEof: break
|
||||||
else:
|
else:
|
||||||
var a = complexOrSimpleStmt(p)
|
var a = complexOrSimpleStmt(p)
|
||||||
if a.kind == nkEmpty: parMessage(p, errExprExpected, p.tok)
|
if a.kind == nkEmpty:
|
||||||
|
parMessage(p, errExprExpected, p.tok)
|
||||||
|
# bugfix: consume a token here to prevent an endless loop:
|
||||||
|
getTok(p)
|
||||||
addSon(result, a)
|
addSon(result, a)
|
||||||
|
|
||||||
proc parseTopLevelStmt(p: var TParser): PNode =
|
proc parseTopLevelStmt(p: var TParser): PNode =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue