From 9fd282138972bf610dfc72c73dfcf1014d5837d3 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 12 Oct 2014 13:53:31 -0700 Subject: [PATCH] Fix TODO comment in build_lex_table --- src/compiler/build_tables/build_lex_table.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)); }