mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user