improve the parser's error message

This commit is contained in:
Araq 2020-06-19 10:50:39 +02:00
commit 45bc6954c5

View file

@ -2285,7 +2285,7 @@ proc parseStmt(p: var TParser): PNode =
case p.tok.tokType case p.tok.tokType
of tkIf, tkWhile, tkCase, tkTry, tkFor, tkBlock, tkAsm, tkProc, tkFunc, of tkIf, tkWhile, tkCase, tkTry, tkFor, tkBlock, tkAsm, tkProc, tkFunc,
tkIterator, tkMacro, tkType, tkConst, tkWhen, tkVar: tkIterator, tkMacro, tkType, tkConst, tkWhen, tkVar:
parMessage(p, "complex statement requires indentation") parMessage(p, "nestable statement requires indentation")
result = p.emptyNode result = p.emptyNode
else: else:
if p.inSemiStmtList > 0: if p.inSemiStmtList > 0: