diff --git a/src/compiler/build_tables/transition_map.h b/src/compiler/build_tables/transition_map.h index da519412..46e097e0 100644 --- a/src/compiler/build_tables/transition_map.h +++ b/src/compiler/build_tables/transition_map.h @@ -3,7 +3,6 @@ #include #include -#include #include "rule.h" namespace tree_sitter { @@ -17,7 +16,7 @@ namespace tree_sitter { public: transition_map() : contents(contents_type()) {}; - transition_map(std::initializer_list pairs) : contents(pairs) {}; + transition_map(std::vector pairs) : contents(pairs) {}; bool operator==(const transition_map &other) const { if (size() != other.size()) return false; diff --git a/src/compiler/rules/rules.cpp b/src/compiler/rules/rules.cpp index e0f29522..8e6a3fe0 100644 --- a/src/compiler/rules/rules.cpp +++ b/src/compiler/rules/rules.cpp @@ -2,8 +2,8 @@ using std::make_shared; using std::string; -using std::initializer_list; using std::set; +using std::vector; namespace tree_sitter { namespace rules { @@ -24,7 +24,7 @@ namespace tree_sitter { return make_shared(ranges, sign); } - rule_ptr choice(const initializer_list &rules) { + rule_ptr choice(const vector &rules) { rule_ptr result; for (auto rule : rules) result = result.get() ? make_shared(result, rule) : rule; @@ -39,7 +39,7 @@ namespace tree_sitter { return std::make_shared(content); } - rule_ptr seq(const initializer_list &rules) { + rule_ptr seq(const vector &rules) { rule_ptr result = blank(); for (auto rule : rules) result = (typeid(*result) != typeid(Blank)) ? diff --git a/src/compiler/rules/rules.h b/src/compiler/rules/rules.h index 3129c72d..02fee8b1 100644 --- a/src/compiler/rules/rules.h +++ b/src/compiler/rules/rules.h @@ -11,6 +11,7 @@ #include "character_set.h" #include "repeat.h" #include "visitor.h" +#include namespace tree_sitter { namespace rules { @@ -19,10 +20,10 @@ namespace tree_sitter { rule_ptr character(const std::set &matches); rule_ptr character(const std::set &matches, bool); - rule_ptr choice(const std::initializer_list &rules); + rule_ptr choice(const std::vector &rules); rule_ptr pattern(const std::string &value); rule_ptr repeat(const rule_ptr content); - rule_ptr seq(const std::initializer_list &rules); + rule_ptr seq(const std::vector &rules); rule_ptr str(const std::string &value); rule_ptr sym(const std::string &name); rule_ptr aux_sym(const std::string &name);