Rename source files: .cpp -> .cc

This commit is contained in:
Max Brunsfeld 2014-03-09 22:13:08 -07:00
parent 31a58bc7e4
commit a411e43484
49 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,32 @@
#include "compiler/rules/string.h"
#include "compiler/rules/visitor.h"
namespace tree_sitter {
using std::string;
using std::hash;
namespace rules {
String::String(string value) : value(value) {};
bool String::operator==(const Rule &rule) const {
const String *other = dynamic_cast<const String *>(&rule);
return other && (other->value == value);
}
size_t String::hash_code() const {
return hash<string>()(value);
}
rule_ptr String::copy() const {
return std::make_shared<String>(*this);
}
string String::to_string() const {
return string("#<string '") + value + "'>";
}
void String::accept(Visitor &visitor) const {
visitor.visit(this);
}
}
}