cleanups for underscores in tuple unpacking

This commit is contained in:
Araq 2015-04-24 13:08:42 +02:00
commit 6ca38472a1
4 changed files with 67 additions and 42 deletions

View file

@ -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