Compute transitions for regex pattern rules

This commit is contained in:
Max Brunsfeld 2013-11-14 21:25:58 -08:00
parent 040ec86000
commit ecd317ccd9
13 changed files with 206 additions and 23 deletions

View file

@ -2,10 +2,23 @@
namespace tree_sitter {
namespace rules {
bool Rule::operator==(const rule_ptr other) const {
return true;
}
std::ostream& operator<<(std::ostream& stream, const Rule &rule)
{
stream << rule.to_string();
return stream;
}
std::ostream& operator<<(std::ostream& stream, const rule_ptr &rule)
{
if (rule.get() == nullptr)
stream << std::string("<NULL rule>");
else
stream << rule->to_string();
return stream;
}
}
}