Add script to trim whitespace

This commit is contained in:
Max Brunsfeld 2014-03-09 19:49:35 -07:00
parent e681a63552
commit 39aa0ccc91
66 changed files with 350 additions and 347 deletions

View file

@ -22,11 +22,11 @@ namespace tree_sitter {
size_t Symbol::hash_code() const {
return hash<string>()(name) ^ hash<short int>()(type);
}
rule_ptr Symbol::copy() const {
return std::make_shared<Symbol>(*this);
}
string Symbol::to_string() const {
switch (type) {
case SymbolTypeNormal:
@ -39,17 +39,17 @@ namespace tree_sitter {
return string("#<builtin_sym '") + name + "'>";
}
}
bool Symbol::operator<(const Symbol &other) const {
if (type < other.type) return true;
if (type > other.type) return false;
return (name < other.name);
}
bool Symbol::is_built_in() const {
return type == SymbolTypeBuiltIn;
}
bool Symbol::is_auxiliary() const {
return type == SymbolTypeAuxiliary;
}
@ -57,7 +57,7 @@ namespace tree_sitter {
bool Symbol::is_hidden() const {
return (type == SymbolTypeHidden || type == SymbolTypeAuxiliary);
}
void Symbol::accept(Visitor &visitor) const {
visitor.visit(this);
}