skipMany function
Creates State that source generates code which will perform state
computations until the next state
computation fails.
This operation always completes successfully or 'goes' into an infinite loop.
Implementation
State skipMany(State state) {
const template = '''
while (true) {
{{@state}}
}
{{@accept}}
''';
const automaton = Automaton(
accept: 'continue;',
reject: 'break;',
result: 'null',
template: template,
);
const generator = AutomatonGenerator(automaton);
final start = generator.generate('void', state);
return start;
}