improve error message if literal ends with an underscore (#8114)
This commit is contained in:
parent
cecce80d42
commit
cc7479b70f
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue