diff options
author | Vindaar <basti90@gmail.com> | 2018-06-28 00:33:15 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-06-28 00:33:15 +0200 |
commit | cc7479b70f3f6aeb066229ab451facf3f1eff77f (patch) | |
tree | dea0774fcec72787ea6865960ff21432b6caf6ec | |
parent | cecce80d428f7cbe0089da0feca83c33f745a58e (diff) | |
download | Nim-cc7479b70f3f6aeb066229ab451facf3f1eff77f.tar.gz |
improve error message if literal ends with an underscore (#8114)
-rw-r--r-- | compiler/lexer.nim | 3 |
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) |