#include "symbol.h" #include "transition_map.h" namespace tree_sitter { namespace rules { Symbol::Symbol(int id) : id(id) {}; TransitionMap Symbol::transitions() const { return TransitionMap({ copy() }, { new Blank() }); } bool Symbol::operator==(const Rule &rule) const { const Symbol *other = dynamic_cast(&rule); return (other != NULL) && (other->id == id); } Symbol * Symbol::copy() const { return new Symbol(id); } std::string Symbol::to_string() const { return std::to_string(id); } } }