Skip to content

Commit

Permalink
some pattern builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
r3w0p committed Apr 24, 2022
1 parent c04c48d commit 74d1b9c
Show file tree
Hide file tree
Showing 2 changed files with 393 additions and 94 deletions.
4 changes: 4 additions & 0 deletions bobocep/pattern/bobo_pattern_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def followed_by(self,
group: str,
predicate: BoboPredicate,
times: int = 1,
loop: bool = False,
optional: bool = False) -> 'BoboPatternBuilder':

for _ in range(max(times, 1)):
self._blocks.append(BoboPatternBlock(
group=group,
predicates=[predicate],
strict=False,
loop=loop,
negated=False,
optional=optional))
return self
Expand All @@ -90,13 +92,15 @@ def followed_by_any(self,
group: str,
predicates: List[BoboPredicate],
times: int = 1,
loop: bool = False,
optional: bool = False) -> 'BoboPatternBuilder':

for _ in range(max(times, 1)):
self._blocks.append(BoboPatternBlock(
group=group,
predicates=predicates,
strict=False,
loop=loop,
negated=False,
optional=optional))
return self
Expand Down
Loading

0 comments on commit 74d1b9c

Please sign in to comment.