implement search builder

This commit is contained in:
Sarah Hoffmann
2023-05-23 11:20:34 +02:00
parent 3bf489cd7c
commit c42273a4db
7 changed files with 1208 additions and 3 deletions

View File

@@ -169,7 +169,10 @@ class QueryNode:
and ending at the node 'end'. Returns 'None' if no such
tokens exist.
"""
return next((t.tokens for t in self.starting if t.end == end and t.ttype == ttype), None)
for tlist in self.starting:
if tlist.end == end and tlist.ttype == ttype:
return tlist.tokens
return None
@dataclasses.dataclass