From 72560012be79634cf4a974b2ac1ef1cb6fd29aef Mon Sep 17 00:00:00 2001 From: Darik Gamble Date: Mon, 9 Feb 2015 11:58:08 -0500 Subject: Group adjacent names to allow aliasing without the AS keyword --- sqlparse/engine/grouping.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sqlparse/engine') 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, -- cgit v1.2.1