Add token position to nimrod scan

A block of the format "linenum:col\t' is added to the start of each token that is printed.
This commit is contained in:
flaviut
2014-03-14 14:18:38 -04:00
parent 2cbe46daff
commit 5e47c18e3f

View File

@@ -173,6 +173,7 @@ proc prettyTok*(tok: TToken): string =
else: result = tokToStr(tok)
proc printTok*(tok: TToken) =
write(stdout, tok.line, ":", tok.col, "\t")
write(stdout, TokTypeToStr[tok.tokType])
write(stdout, " ")
writeln(stdout, tokToStr(tok))