Skip to content

Commit

Permalink
work on AND operator
Browse files Browse the repository at this point in the history
  • Loading branch information
capjamesg committed Nov 23, 2024
1 parent cebad5f commit 4c54b7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jamesql/rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
TERM: /[a-zA-Z0-9_]+/
ORDER: "ASC" | "DESC" | "asc" | "desc"
%import common.W
%import common.WS
%ignore WS
"""

Expand Down Expand Up @@ -66,6 +66,10 @@ def query(self, items):
def or_query(self, items):
self.terms.append([items[0], "OR", items[1]])
return items[0]

def and_query(self, items):
self.terms.append([items[0], "AND", items[1]])
return items[0]

def start(self, items):
return items[0]
Expand Down

0 comments on commit 4c54b7b

Please sign in to comment.