diff --git a/src/compiler/build_tables/build_lex_table.cc b/src/compiler/build_tables/build_lex_table.cc index babb8098..31bc29ef 100644 --- a/src/compiler/build_tables/build_lex_table.cc +++ b/src/compiler/build_tables/build_lex_table.cc @@ -129,17 +129,19 @@ class LexTableBuilder { rule, }); } - // TODO - remove this hack. right now, nested repeats cause - // item sets which are equivalent to appear unequal. rules::rule_ptr separator_rule() const { vector separators; for (const auto &rule : lex_grammar.separators) { + + // TODO - remove this hack. right now, nested repeats cause + // item sets which are equivalent to appear unequal. auto repeat = dynamic_pointer_cast(rule); if (repeat.get()) separators.push_back(repeat->content); else separators.push_back(rule); } + return rules::repeat(rules::choice(separators)); }