summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarik Gamble <darik.gamble@gmail.com>2015-02-09 11:58:08 -0500
committerDarik Gamble <darik.gamble@gmail.com>2015-02-09 12:59:33 -0500
commit72560012be79634cf4a974b2ac1ef1cb6fd29aef (patch)
tree64b4a28c0a77d778edb6f62e215a21be77c59952
parent9eb0b8cbe89057601d577b744696b5c39f3a2b20 (diff)
downloadsqlparse-72560012be79634cf4a974b2ac1ef1cb6fd29aef.tar.gz
Group adjacent names to allow aliasing without the AS keyword
-rw-r--r--sqlparse/engine/grouping.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index 47d3c2e..9314b89 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -155,9 +155,10 @@ def group_identifier(tlist):
# TODO: Usage of Wildcard token is ambivalent here.
x = itertools.cycle((
lambda y: (y.match(T.Punctuation, '.')
- or y.ttype is T.Operator
- or y.ttype is T.Wildcard
- or y.ttype is T.ArrayIndex),
+ or y.ttype in (T.Operator,
+ T.Wildcard,
+ T.ArrayIndex,
+ T.Name)),
lambda y: (y.ttype in (T.String.Symbol,
T.Name,
T.Wildcard,