Replace some initializer_lists with vectors
This commit is contained in:
parent
df3397f02c
commit
b01c672fca
3 changed files with 7 additions and 7 deletions
|
|
@ -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<CharacterSet>(ranges, sign);
|
||||
}
|
||||
|
||||
rule_ptr choice(const initializer_list<rule_ptr> &rules) {
|
||||
rule_ptr choice(const vector<rule_ptr> &rules) {
|
||||
rule_ptr result;
|
||||
for (auto rule : rules)
|
||||
result = result.get() ? make_shared<Choice>(result, rule) : rule;
|
||||
|
|
@ -39,7 +39,7 @@ namespace tree_sitter {
|
|||
return std::make_shared<Repeat>(content);
|
||||
}
|
||||
|
||||
rule_ptr seq(const initializer_list<rule_ptr> &rules) {
|
||||
rule_ptr seq(const vector<rule_ptr> &rules) {
|
||||
rule_ptr result = blank();
|
||||
for (auto rule : rules)
|
||||
result = (typeid(*result) != typeid(Blank)) ?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue