summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-08-19 22:25:21 +0200
committerGitHub <noreply@github.com>2019-08-19 22:25:21 +0200
commit75baaa5e2513cdf348edc155b4f1999a317d9366 (patch)
treec3e4c9c82aee80f56351cf7682866a9d221f1fd6
parent742862b847646dff4562992cd502d3077b2c9474 (diff)
downloadNim-75baaa5e2513cdf348edc155b4f1999a317d9366.tar.gz
nim check, fix #11927, no more empty strings (#11979)
-rw-r--r--compiler/lexer.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 4bf50a359..c2b95c481 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -864,7 +864,9 @@ proc getCharacter(L: var TLexer, tok: var TToken) =
   inc(L.bufpos)               # skip '
   var c = L.buf[L.bufpos]
   case c
-  of '\0'..pred(' '), '\'': lexMessage(L, errGenerated, "invalid character literal")
+  of '\0'..pred(' '), '\'':
+    lexMessage(L, errGenerated, "invalid character literal")
+    tok.literal = $c
   of '\\': getEscapedChar(L, tok)
   else:
     tok.literal = $c