diff options
author | quest <quest@wonky.windwards.net> | 2012-04-21 20:28:49 +0200 |
---|---|---|
committer | quest <quest@wonky.windwards.net> | 2012-04-21 20:28:49 +0200 |
commit | 61f22063051fa94b0f055a995eed10b576535c29 (patch) | |
tree | dcc1de1b1ad4b8bd27cd8524cbe8c9cd714e0c90 /sqlparse/lexer.py | |
parent | 13274ebb0d66b64363145bf23b6aa824845f61be (diff) | |
download | sqlparse-61f22063051fa94b0f055a995eed10b576535c29.tar.gz |
Minor clarifications and doc updates
Diffstat (limited to 'sqlparse/lexer.py')
-rw-r--r-- | sqlparse/lexer.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 82a6169..a0ce5d2 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -279,6 +279,7 @@ class Lexer(object): m = rexmatch(text, pos) if m: if hasmore and m.end() == len(text): + # Since this is end, token may be truncated continue # print rex.pattern @@ -315,13 +316,14 @@ class Lexer(object): statetokens = tokendefs[statestack[-1]] break else: + if hasmore: + buf = self._decode(stream.read(self.bufsize)) + hasmore = len(buf) == self.bufsize + text = text[pos:] + buf + pos = 0 + continue + try: - if hasmore: - buf = self._decode(stream.read(self.bufsize)) - hasmore = len(buf) == self.bufsize - text = text[pos:] + buf - pos = 0 - continue if text[pos] == '\n': # at EOL, reset state to "root" pos += 1 |