fixes #609
This commit is contained in:
parent
f857a842fc
commit
a943905d6c
1 changed files with 8 additions and 2 deletions
|
|
@ -1798,7 +1798,10 @@ proc parseStmt(p: var TParser): PNode =
|
||||||
if p.tok.indent == p.currInd:
|
if p.tok.indent == p.currInd:
|
||||||
nil
|
nil
|
||||||
elif p.tok.tokType == tkSemicolon:
|
elif p.tok.tokType == tkSemicolon:
|
||||||
while p.tok.tokType == tkSemicolon: getTok(p)
|
while p.tok.tokType == tkSemicolon:
|
||||||
|
getTok(p)
|
||||||
|
if p.tok.indent < 0 or p.tok.indent == p.currInd: discard
|
||||||
|
else: return
|
||||||
else:
|
else:
|
||||||
if p.tok.indent > p.currInd:
|
if p.tok.indent > p.currInd:
|
||||||
parMessage(p, errInvalidIndentation)
|
parMessage(p, errInvalidIndentation)
|
||||||
|
|
@ -1851,7 +1854,10 @@ proc parseTopLevelStmt(p: var TParser): PNode =
|
||||||
else: parMessage(p, errInvalidIndentation)
|
else: parMessage(p, errInvalidIndentation)
|
||||||
p.firstTok = false
|
p.firstTok = false
|
||||||
case p.tok.tokType
|
case p.tok.tokType
|
||||||
of tkSemicolon: getTok(p)
|
of tkSemicolon:
|
||||||
|
getTok(p)
|
||||||
|
if p.tok.indent <= 0: discard
|
||||||
|
else: parMessage(p, errInvalidIndentation)
|
||||||
of tkEof: break
|
of tkEof: break
|
||||||
else:
|
else:
|
||||||
result = complexOrSimpleStmt(p)
|
result = complexOrSimpleStmt(p)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue