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:
parent
2cbe46daff
commit
5e47c18e3f
1 changed files with 1 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue