summary refs log tree commit diff stats
path: root/compiler/lexer.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/lexer.nim')
-rwxr-xr-xcompiler/lexer.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 15f874bbd..b2932033d 100755
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -165,6 +165,10 @@ proc tokToStr*(tok: TToken): string =
       InternalError("tokToStr")
       result = ""
   
+proc prettyTok*(tok: TToken): string =
+  if IsKeyword(tok.tokType): result = "keyword " & tok.ident.s
+  else: result = tokToStr(tok)
+  
 proc PrintTok*(tok: TToken) = 
   write(stdout, TokTypeToStr[tok.tokType])
   write(stdout, " ")