diff options
| author | Andreas Albrecht <a.albrecht@Mac-PU08.prounix.local> | 2019-10-20 17:51:02 +0200 |
|---|---|---|
| committer | Andreas Albrecht <a.albrecht@Mac-PU08.prounix.local> | 2019-10-20 17:51:02 +0200 |
| commit | b8b65c52db6e4ffda18dbce3d4752696b99149a0 (patch) | |
| tree | 0f6de4b2e1f5e9a2885161034be9bbb753d3482a /sqlparse/engine | |
| parent | 9433666c8c3df8b23f17d7b46d91fd1b9d922b77 (diff) | |
| download | sqlparse-b8b65c52db6e4ffda18dbce3d4752696b99149a0.tar.gz | |
Code cleanup.
Diffstat (limited to 'sqlparse/engine')
| -rw-r--r-- | sqlparse/engine/grouping.py | 10 | ||||
| -rw-r--r-- | sqlparse/engine/statement_splitter.py | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 3ae568d..4f07bc5 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -125,8 +125,10 @@ def group_typed_literal(tlist): def post(tlist, pidx, tidx, nidx): return tidx, nidx - _group(tlist, sql.TypedLiteral, match, valid_prev, valid_next, post, extend=False) - _group(tlist, sql.TypedLiteral, match_to_extend, valid_prev, valid_final, post, extend=True) + _group(tlist, sql.TypedLiteral, match, valid_prev, valid_next, + post, extend=False) + _group(tlist, sql.TypedLiteral, match_to_extend, valid_prev, valid_final, + post, extend=True) def group_period(tlist): @@ -252,7 +254,9 @@ def group_operator(tlist): def valid(token): return imt(token, i=sqlcls, t=ttypes) \ - or token.match(T.Keyword, ("CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP")) + or token.match( + T.Keyword, + ('CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP')) def post(tlist, pidx, tidx, nidx): tlist[tidx].ttype = T.Operator diff --git a/sqlparse/engine/statement_splitter.py b/sqlparse/engine/statement_splitter.py index 6c4be8e..1e9af3c 100644 --- a/sqlparse/engine/statement_splitter.py +++ b/sqlparse/engine/statement_splitter.py @@ -33,7 +33,7 @@ class StatementSplitter(object): return 1 elif ttype is T.Punctuation and value == ')': return -1 - elif ttype not in T.Keyword: # if normal token return + elif ttype not in T.Keyword: # if normal token return return 0 # Everything after here is ttype = T.Keyword |
