summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r--sqlparse/sql.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index 25d5243..9fcb546 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -511,11 +511,12 @@ class Identifier(TokenList):
return ordering.value.upper()
def get_array_indices(self):
- """Returns an iterator of index expressions as strings"""
+ """Returns an iterator of index token lists"""
- # Use [1:-1] index to discard the square brackets
- return (tok.value[1:-1] for tok in self.tokens
- if tok.ttype in T.ArrayIndex)
+ for tok in self.tokens:
+ if isinstance(tok, SquareBrackets):
+ # Use [1:-1] index to discard the square brackets
+ yield tok.tokens[1:-1]
class IdentifierList(TokenList):