diff options
| author | 2021-07-25 23:54:42 -0400 | |
|---|---|---|
| committer | 2021-07-26 22:55:48 -0400 | |
| commit | 90891d90f00d8e69d4f4a6ed33ff73d2843bc1e4 (patch) | |
| tree | d0aa2685335e20a00b5498b862ae569148ca398b | |
| parent | queryparse: fix mistaken command in AND (diff) | |
queryparse: fix error in returning from NOT
| -rw-r--r-- | queryparse.py | 4 | ||||
| -rwxr-xr-x | test/t_queryparse.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/queryparse.py b/queryparse.py index 127e09b..bd87079 100644 --- a/queryparse.py +++ b/queryparse.py @@ -85,8 +85,8 @@ def e4(l): def e3(l): typ,_ = classify_head(l) if typ == TokType.NOT: - return encapsulate(e4(l[1:]), \ - TokType.NOT) + pt,l = e4(l[1:]) + return encapsulate(pt, TokType.NOT), l return e4(l) def e2(l): diff --git a/test/t_queryparse.py b/test/t_queryparse.py index a37a67b..e1728e3 100755 --- a/test/t_queryparse.py +++ b/test/t_queryparse.py @@ -9,3 +9,5 @@ def f(x): f(["x", "OR", "y"]) f(["x", "y", "OR", "a", "b"]) +f(["x", "y", "z", "w"]) +f(["NOT", "x", "OR", "y"]) |
