File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,16 +159,17 @@ def _consume_cycle(tl, i):
159159 lambda y : (y .match (T .Punctuation , '.' )
160160 or y .ttype in (T .Operator ,
161161 T .Wildcard ,
162- T .ArrayIndex ,
163- T . Name )),
162+ T .Name )
163+ or isinstance ( y , sql . SquareBrackets )),
164164 lambda y : (y .ttype in (T .String .Symbol ,
165165 T .Name ,
166166 T .Wildcard ,
167- T .ArrayIndex ,
168167 T .Literal .String .Single ,
169168 T .Literal .Number .Integer ,
170169 T .Literal .Number .Float )
171- or isinstance (y , (sql .Parenthesis , sql .Function )))))
170+ or isinstance (y , (sql .Parenthesis ,
171+ sql .SquareBrackets ,
172+ sql .Function )))))
172173 for t in tl .tokens [i :]:
173174 # Don't take whitespaces into account.
174175 if t .ttype is T .Whitespace :
Original file line number Diff line number Diff line change @@ -511,11 +511,12 @@ def get_ordering(self):
511511 return ordering .value .upper ()
512512
513513 def get_array_indices (self ):
514- """Returns an iterator of index expressions as strings """
514+ """Returns an iterator of index token lists """
515515
516- # Use [1:-1] index to discard the square brackets
517- return (tok .value [1 :- 1 ] for tok in self .tokens
518- if tok .ttype in T .ArrayIndex )
516+ for tok in self .tokens :
517+ if isinstance (tok , SquareBrackets ):
518+ # Use [1:-1] index to discard the square brackets
519+ yield tok .tokens [1 :- 1 ]
519520
520521
521522class IdentifierList (TokenList ):
You can’t perform that action at this time.
0 commit comments