diff options
| author | 2021-07-25 23:55:49 -0400 | |
|---|---|---|
| committer | 2021-07-26 22:55:50 -0400 | |
| commit | f76aa944b304eb9d3aa325807f13c4f9a20191b6 (patch) | |
| tree | 37b9848c7dbf87223e74b6876d61573582cf53ed /queryparse.py | |
| parent | queryparse: fix error in returning from NOT (diff) | |
queryparse: lift encapsulate() calls into loops to make cleaner parse trees
Diffstat (limited to 'queryparse.py')
| -rw-r--r-- | queryparse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/queryparse.py b/queryparse.py index bd87079..17227c2 100644 --- a/queryparse.py +++ b/queryparse.py @@ -92,9 +92,9 @@ def e3(l): def e2(l): pt,l = e3(l) try: - pt = encapsulate(pt, TokType.AND) while True: pt2,l = e3(l) + pt = encapsulate(pt, TokType.AND) pt.push(pt2) except ParseError: pass @@ -105,9 +105,9 @@ def e1(l): typ,_ = classify_head(l) try: - pt = encapsulate(pt, TokType.OR) while typ == TokType.OR: pt2,l = e2(l[1:]) + pt = encapsulate(pt, TokType.OR) pt.push(pt2) typ,_ = classify_head(l) except ParseError: |
