Skip to content

Commit

Permalink
parser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Oct 16, 2023
1 parent 1e2cb8a commit 8de2c03
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prody/atomic/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ def _and2(self, sel, loc, tokens, subset=None):
isDataLabel = atoms.isDataLabel
append = None
wasand = False
wasdata = False
while tokens:
# check whether token is an array to avoid array == str comparison
token = tokens.pop(0)
Expand All @@ -1354,9 +1355,10 @@ def _and2(self, sel, loc, tokens, subset=None):
.format(repr('and ... and')), ['and', 'and'])
append = None
wasand = True
wasdata = False
continue

elif isFlagLabel(token):
elif isFlagLabel(token) and not wasdata:
flags.append(token)
append = None

Expand Down Expand Up @@ -1396,6 +1398,7 @@ def _and2(self, sel, loc, tokens, subset=None):
evals.append([])
append = evals[-1].append
append(token)
wasdata = True

elif token in UNARY:
unary.append([])
Expand Down

0 comments on commit 8de2c03

Please sign in to comment.