Add script to trim whitespace
This commit is contained in:
parent
e681a63552
commit
39aa0ccc91
66 changed files with 350 additions and 347 deletions
|
|
@ -6,11 +6,11 @@ namespace tree_sitter {
|
|||
using std::map;
|
||||
using std::ostream;
|
||||
using rules::rule_ptr;
|
||||
|
||||
|
||||
Grammar::Grammar(std::string start_rule_name, const map<const string, const rule_ptr> &rules) :
|
||||
start_rule_name(start_rule_name),
|
||||
start_rule_name(start_rule_name),
|
||||
rules(rules) {}
|
||||
|
||||
|
||||
bool Grammar::operator==(const Grammar &other) const {
|
||||
if (other.start_rule_name != start_rule_name) return false;
|
||||
if (other.rules.size() != rules.size()) return false;
|
||||
|
|
@ -20,10 +20,10 @@ namespace tree_sitter {
|
|||
if (other_pair == other.rules.end()) return false;
|
||||
if (!other_pair->second->operator==(*pair.second)) return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
ostream& operator<<(ostream &stream, const Grammar &grammar) {
|
||||
stream << string("#<grammar");
|
||||
stream << string(" rules: {");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue