diff options
author | Charles Blake <charlechaud@gmail.com> | 2019-06-13 10:21:11 -0400 |
---|---|---|
committer | Charles Blake <charlechaud@gmail.com> | 2019-06-13 10:21:11 -0400 |
commit | e11d582fa1562128b74f597620958e40e849b855 (patch) | |
tree | d0be6597a78ff50d15666027f4f3811a22a98eb3 /compiler/lexer.nim | |
parent | e7188cdfa84f1a09748b66e1edfcbd3245b9ac60 (diff) | |
parent | 06ef56ba72bbefc389263296e70617b70ffe09a6 (diff) | |
download | Nim-e11d582fa1562128b74f597620958e40e849b855.tar.gz |
Merge branch 'devel' of https://github.com/nim-lang/Nim into devel
Diffstat (limited to 'compiler/lexer.nim')
-rw-r--r-- | compiler/lexer.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 421a83c19..97fa91b3a 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -173,7 +173,7 @@ proc isNimIdentifier*(s: string): bool = inc(i) result = true -proc tokToStr*(tok: TToken): string = +proc `$`*(tok: TToken): string = case tok.tokType of tkIntLit..tkInt64Lit: result = $tok.iNumber of tkFloatLit..tkFloat64Lit: result = $tok.fNumber @@ -188,11 +188,11 @@ proc tokToStr*(tok: TToken): string = proc prettyTok*(tok: TToken): string = if isKeyword(tok.tokType): result = "keyword " & tok.ident.s - else: result = tokToStr(tok) + else: result = $tok proc printTok*(conf: ConfigRef; tok: TToken) = msgWriteln(conf, $tok.line & ":" & $tok.col & "\t" & - TokTypeToStr[tok.tokType] & " " & tokToStr(tok)) + TokTypeToStr[tok.tokType] & " " & $tok) proc initToken*(L: var TToken) = L.tokType = tkInvalid |