Skip to content

Commit

Permalink
Update generator to reflect updated grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
WoWaster committed May 6, 2024
1 parent 546b831 commit 7df453f
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions tests/autotests/ProgramGenerator.py
Expand Up @@ -272,18 +272,31 @@ def v_filter(self, parent=None):
def NUM(self, parent=None):
with UnlexerRuleContext(self, "NUM", parent) as rule:
current = rule.current
current.src += self._model.charset(
current, 0, ProgramGenerator._charsets[1]
)
with QuantifierContext(
rule, 0, 0, inf, ProgramGenerator._quant_sizes[0], 0
) as quant0:
while quant0():
with QuantifiedContext(rule):
current = rule.current
current.src += self._model.charset(
current, 1, ProgramGenerator._charsets[2]
)
with AlternationContext(
rule,
0,
ProgramGenerator._alt_sizes[0],
0,
ProgramGenerator._alt_conds[0],
) as alt0:
current = rule.current
choice0 = alt0()
if choice0 == 0:
current.src += "0"
elif choice0 == 1:
current.src += self._model.charset(
current, 0, ProgramGenerator._charsets[1]
)
with QuantifierContext(
rule, 0, 0, inf, ProgramGenerator._quant_sizes[0], 0
) as quant0:
while quant0():
with QuantifiedContext(rule):
current = rule.current
current.src += self._model.charset(
current, 1, ProgramGenerator._charsets[2]
)
current = rule.current
current = rule.current
return current

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 7df453f

Please sign in to comment.