We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea17a43 commit bed65edCopy full SHA for bed65ed
1 file changed
grape/automaton/spec_manager.py
@@ -60,12 +60,14 @@ def make_var(i: int):
60
new_rules[(P, args)] = dst
61
62
if whatever or syntax is None:
63
- return DFTA(new_rules, set(list(grammar.finals)))
+ dfta = DFTA(new_rules, set(list(grammar.finals)))
64
else:
65
state_to_type = syntax.get_state_types(grammar)
66
- return DFTA(
+ dfta = DFTA(
67
new_rules, set(s for s in grammar.finals if state_to_type[s] == rtype)
68
)
69
+ dfta.reduce()
70
+ return dfta
71
72
73
def is_specialized(grammar: DFTA[T, str] | DFTA[T, Program]) -> bool:
0 commit comments