Make the EOF be an auxiliary symbol

This way, it couldn’t conflict if a user had a rule called “__END__”
This commit is contained in:
Max Brunsfeld 2014-02-10 18:53:01 -08:00
parent 15c9e2d398
commit 3cb65c9c81
6 changed files with 659 additions and 670 deletions

View file

@ -1,6 +1,5 @@
#include "grammar.h"
using std::unordered_map;
using std::vector;
using std::string;
using std::pair;
@ -12,7 +11,7 @@ namespace tree_sitter {
rules(rules),
start_rule_name(rules.begin()->first) {}
Grammar::Grammar(std::string start_rule_name, const unordered_map<string, const rules::rule_ptr> &rules) :
Grammar::Grammar(std::string start_rule_name, rule_map &rules) :
rules(rules),
start_rule_name(start_rule_name) {}