diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2009-09-12 08:05:34 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2009-09-12 08:05:34 +0200 |
| commit | 3d13c5d4bb14f76d407285f2a91e7061585fd6da (patch) | |
| tree | 8816cdae40c231eb4da4c4ae8d49befb1f05e854 /sqlparse/sql.py | |
| parent | 29590e09223ca9eb44e15429488664cff9db5f9e (diff) | |
| download | sqlparse-3d13c5d4bb14f76d407285f2a91e7061585fd6da.tar.gz | |
Prevent WHERE grouper from consuming closing parenthesis (fixes issue9, reported by estama).
Diffstat (limited to 'sqlparse/sql.py')
| -rw-r--r-- | sqlparse/sql.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py index 5969841..195696e 100644 --- a/sqlparse/sql.py +++ b/sqlparse/sql.py @@ -176,6 +176,10 @@ class TokenList(Token): def get_sublists(self): return [x for x in self.tokens if isinstance(x, TokenList)] + @property + def _groupable_tokens(self): + return self.tokens + def token_first(self, ignore_whitespace=True): """Returns the first child token. @@ -426,6 +430,10 @@ class Parenthesis(TokenList): """Tokens between parenthesis.""" __slots__ = ('value', 'ttype', 'tokens') + @property + def _groupable_tokens(self): + return self.tokens[1:-1] + class Assignment(TokenList): """An assignment like 'var := val;'""" |
