cleanups for underscores in tuple unpacking
This commit is contained in:
parent
a5f321ea8f
commit
6ca38472a1
4 changed files with 67 additions and 42 deletions
|
|
@ -868,9 +868,14 @@ proc rawGetTok*(L: var TLexer, tok: var TToken) =
|
|||
tok.tokType = tkAccent
|
||||
inc(L.bufpos)
|
||||
of '_':
|
||||
tok.tokType = tkSymbol
|
||||
tok.ident = getIdent("_")
|
||||
inc(L.bufpos)
|
||||
if L.buf[L.bufpos] notin SymChars:
|
||||
tok.tokType = tkSymbol
|
||||
tok.ident = getIdent("_")
|
||||
else:
|
||||
tok.literal = $c
|
||||
tok.tokType = tkInvalid
|
||||
lexMessage(L, errInvalidToken, c & " (\\" & $(ord(c)) & ')')
|
||||
of '\"':
|
||||
# check for extended raw string literal:
|
||||
var rawMode = L.bufpos > 0 and L.buf[L.bufpos-1] in SymChars
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue