In parse table, store symbols as Symbol objects, not strings

This commit is contained in:
Max Brunsfeld 2014-01-27 12:40:06 -08:00
parent 0877d01194
commit ca33c3942a
20 changed files with 262 additions and 262 deletions

View file

@ -16,8 +16,8 @@ namespace tree_sitter {
rules(rules),
start_rule_name(start_rule_name) {}
const rules::rule_ptr Grammar::rule(const string &name) const {
auto iter = rules.find(name);
const rules::rule_ptr Grammar::rule(const rules::Symbol &symbol) const {
auto iter = rules.find(symbol.name);
return (iter == rules.end()) ?
rules::rule_ptr(nullptr) :
iter->second;