diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2009-05-05 07:01:39 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2009-05-05 07:01:39 +0200 |
| commit | a00bf24ad555f8701607dae22fa39555d4da3bfa (patch) | |
| tree | 9aa4db03d2aff6fc293c98583fa905058a9d5674 /sqlparse | |
| parent | c8c23529249f4554f61b79121e78ff5192dc3bbe (diff) | |
| download | sqlparse-a00bf24ad555f8701607dae22fa39555d4da3bfa.tar.gz | |
* Added missing SET keyword.
* IdentifierList.get_identifiers() now returns not only Identifier instances.
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/engine/grouping.py | 1 | ||||
| -rw-r--r-- | sqlparse/filters.py | 3 | ||||
| -rw-r--r-- | sqlparse/keywords.py | 1 | ||||
| -rw-r--r-- | sqlparse/sql.py | 3 |
4 files changed, 6 insertions, 2 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index bdf2cd0..fd6af67 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -139,6 +139,7 @@ def group_identifier_list(tlist): lambda t: t.match(T.Keyword, 'null'), lambda t: t.ttype == T.Number.Integer, lambda t: t.ttype == T.String.Single, + lambda t: isinstance(t, Comparsion), ] tcomma = tlist.token_next_match(idx, T.Punctuation, ',') start = None diff --git a/sqlparse/filters.py b/sqlparse/filters.py index f1163ca..1ff767e 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -162,7 +162,8 @@ class ReindentFilter(Filter): def _split_kwds(self, tlist): split_words = ('FROM', 'JOIN$', 'AND', 'OR', - 'GROUP', 'ORDER', 'UNION', 'VALUES') + 'GROUP', 'ORDER', 'UNION', 'VALUES', + 'SET') idx = 0 token = tlist.token_next_match(idx, T.Keyword, split_words, regex=True) diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index 578f54f..97bd635 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -565,6 +565,7 @@ KEYWORDS_COMMON = { 'LIKE': Keyword, 'ON': Keyword, 'IN': Keyword, + 'SET': Keyword, 'BY': Keyword, 'GROUP': Keyword, diff --git a/sqlparse/sql.py b/sqlparse/sql.py index d1ee143..52d9b4a 100644 --- a/sqlparse/sql.py +++ b/sqlparse/sql.py @@ -386,7 +386,8 @@ class IdentifierList(TokenList): Whitespaces and punctuations are not included in this list. """ - return [x for x in self.tokens if isinstance(x, Identifier)] + return [x for x in self.tokens + if not x.is_whitespace() and not x.match(T.Punctuation, ',')] class Parenthesis(TokenList): |
