diff options
-rw-r--r-- | compiler/lexer.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim index c6b11443d..0a96ed0ba 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -1079,6 +1079,9 @@ proc rawGetTok*(L: var TLexer, tok: var TToken) = tok.tokType = tkCharLit of '0'..'9': getNumber(L, tok) + let c = L.buf[L.bufpos] + if c in SymChars+{'_'}: + lexMessage(L, errInvalidToken, c & " (\\" & $(ord(c)) & ')') else: if c in OpChars: getOperator(L, tok) |