Fix TODO comment in build_lex_table

This commit is contained in:
Max Brunsfeld 2014-10-12 13:53:31 -07:00
parent 6415690738
commit 9fd2821389

View file

@ -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<rules::rule_ptr> 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<const rules::Repeat>(rule);
if (repeat.get())
separators.push_back(repeat->content);
else
separators.push_back(rule);
}
return rules::repeat(rules::choice(separators));
}