diff options
Diffstat (limited to 'sqlparse/engine/grouping.py')
| -rw-r--r-- | sqlparse/engine/grouping.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index f7953e7..7a93b5e 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -27,15 +27,16 @@ def _group_left_right(tlist, m, cls, if valid_left(left) and valid_right(right): if semicolon: + # only overwrite if a semicolon present. sright = tlist.token_next_by(m=M_SEMICOLON, idx=right) - right = sright or right # only overwrite if a semicolon present. + right = sright or right tokens = tlist.tokens_between(left, right) token = tlist.group_tokens(cls, tokens, extend=True) token = tlist.token_next_by(m=m, idx=token) def _group_matching(tlist, cls): - """Groups Tokens that have beginning and end. ie. parenthesis, brackets..""" + """Groups Tokens that have beginning and end.""" idx = 1 if imt(tlist, i=cls) else 0 token = tlist.token_next_by(m=cls.M_OPEN, idx=idx) @@ -223,9 +224,9 @@ def group_functions(tlist): has_create = False has_table = False for tmp_token in tlist.tokens: - if tmp_token.value == u'CREATE': + if tmp_token.value == 'CREATE': has_create = True - if tmp_token.value == u'TABLE': + if tmp_token.value == 'TABLE': has_table = True if has_create and has_table: return |
