diff options
author | flaviut <tamasflaviu+1@gmail.com> | 2014-03-14 14:18:38 -0400 |
---|---|---|
committer | flaviut <tamasflaviu+1@gmail.com> | 2014-03-14 14:18:38 -0400 |
commit | 5e47c18e3f7023f1c73efb0e1e2e7f8713e47b83 (patch) | |
tree | 08dcba29a976045b5c23b259a3efa2f25041fb18 /compiler | |
parent | 2cbe46daff73987d819ea0ca4bc6ada919d531d4 (diff) | |
download | Nim-5e47c18e3f7023f1c73efb0e1e2e7f8713e47b83.tar.gz |
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.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/lexer.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 0e7df13cd..4285a090d 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -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)) |