From c879535d316bfd914a89ce810b2926e4004121b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s=20Combarro=20=22Piranna=22?= Date: Sun, 3 Jun 2012 02:01:33 +0200 Subject: Started new design for group_identifier_list() --- sqlparse/engine/grouping.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 66ae807..7dfc219 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -209,7 +209,6 @@ def group_identifier_list(tlist): """ Create and group the identifiers list """ - print "group_identifierlist", start, after tokens = tlist.tokens_between(start, after) return tlist.group_tokens(sql.IdentifierList, tokens) @@ -235,20 +234,27 @@ def group_identifier_list(tlist): if start == None: start = before - def continue_next(): # Check the next token next_ = tlist.token_next(after) while next_: - # Next token is another comma or an identifier list keyword - if next_.match(T.Punctuation, ','): - return next_ - +# # Next token is another comma or an identifier list keyword +# if next_.match(T.Punctuation, ','): +# return next_ +# +# next_ = tlist.token_next(next_) + + passed = False + for func in fend1_funcs: + if func(next_): + passed = True + break + + if not passed: + break + + after = next_ next_ = tlist.token_next(next_) - tcomma = continue_next() - if tcomma: - continue - # Reached the end of the list # Create and group the identifiers list tcomma = group_identifierlist(start, after) -- cgit v1.2.1