get rid of more variables

This commit is contained in:
Dave Halter
2014-02-21 10:44:33 +01:00
parent 184e90a3a0
commit 9c3b7b9c46

View File

@@ -155,7 +155,7 @@ def generate_tokens(readline, line_offset=0):
lnum = line_offset lnum = line_offset
continued = False continued = False
numchars = '0123456789' numchars = '0123456789'
contstr, needcont = '', False contstr = ''
contline = None contline = None
indents = [0] indents = [0]
@@ -175,15 +175,8 @@ def generate_tokens(readline, line_offset=0):
if endmatch: if endmatch:
pos = end = endmatch.end(0) pos = end = endmatch.end(0)
yield TokenInfo(STRING, contstr + line[:end], strstart, (lnum, end)) yield TokenInfo(STRING, contstr + line[:end], strstart, (lnum, end))
contstr, needcont = '', False contstr = ''
contline = None contline = None
elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n':
#yield TokenInfo(ERRORTOKEN, contstr + line,
# strstart, (lnum, len(line)))
#contstr = ''
#contline = None
#continue
pass
else: else:
contstr = contstr + line contstr = contstr + line
contline = contline + line contline = contline + line
@@ -259,7 +252,7 @@ def generate_tokens(readline, line_offset=0):
strstart = (lnum, start) strstart = (lnum, start)
endprog = (endprogs[initial] or endprogs[token[1]] or endprog = (endprogs[initial] or endprogs[token[1]] or
endprogs[token[2]]) endprogs[token[2]])
contstr, needcont = line[start:], True contstr = line[start:]
contline = line contline = line
break break
else: # ordinary string else: # ordinary string