From 8de2c03301a5513704db15fae18790d409b67ac8 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Mon, 16 Oct 2023 14:07:40 +0100 Subject: [PATCH] parser fix --- prody/atomic/select.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prody/atomic/select.py b/prody/atomic/select.py index 7049a7672..445dc44dd 100644 --- a/prody/atomic/select.py +++ b/prody/atomic/select.py @@ -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) @@ -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 @@ -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([])