summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflaviut <tamasflaviu+1@gmail.com>2014-03-14 14:18:38 -0400
committerflaviut <tamasflaviu+1@gmail.com>2014-03-14 14:18:38 -0400
commit5e47c18e3f7023f1c73efb0e1e2e7f8713e47b83 (patch)
tree08dcba29a976045b5c23b259a3efa2f25041fb18 /compiler
parent2cbe46daff73987d819ea0ca4bc6ada919d531d4 (diff)
downloadNim-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.nim1
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))