summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorVindaar <basti90@gmail.com>2018-06-28 00:33:15 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-06-28 00:33:15 +0200
commitcc7479b70f3f6aeb066229ab451facf3f1eff77f (patch)
treedea0774fcec72787ea6865960ff21432b6caf6ec
parentcecce80d428f7cbe0089da0feca83c33f745a58e (diff)
downloadNim-cc7479b70f3f6aeb066229ab451facf3f1eff77f.tar.gz
improve error message if literal ends with an underscore (#8114)
-rw-r--r--compiler/lexer.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index cd2778d3c..375bf227d 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -344,7 +344,8 @@ proc getNumber(L: var TLexer, result: var TToken) =
       if buf[pos] == '_':
         if buf[pos+1] notin chars:
           lexMessage(L, errGenerated,
-            "only single underscores may occur in a token: '__' is invalid")
+            "only single underscores may occur in a token and token may not " &
+            "end with an underscore: e.g. '1__1' and '1_' are invalid")
           break
         add(tok.literal, '_')
         inc(pos)