From cc7479b70f3f6aeb066229ab451facf3f1eff77f Mon Sep 17 00:00:00 2001 From: Vindaar Date: Thu, 28 Jun 2018 00:33:15 +0200 Subject: [PATCH] improve error message if literal ends with an underscore (#8114) --- compiler/lexer.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)