tree-sitter/src/compiler/rules/rule.cc

26 lines
621 B
C++
Raw Normal View History

2014-03-09 21:37:21 -07:00
#include "compiler/rules/rule.h"
2013-12-15 14:41:51 -08:00
#include <set>
2013-11-12 08:17:19 -08:00
namespace tree_sitter {
2014-03-09 21:37:21 -07:00
using std::ostream;
using std::string;
2014-03-09 23:51:33 -07:00
2013-11-12 08:17:19 -08:00
namespace rules {
bool Rule::operator!=(const Rule &other) const {
return !this->operator==(other);
}
2014-03-09 19:49:35 -07:00
ostream& operator<<(ostream& stream, const Rule &rule) {
return stream << rule.to_string();
2013-11-12 08:17:19 -08:00
}
ostream& operator<<(ostream& stream, const rule_ptr &rule) {
2013-12-28 23:26:20 -08:00
if (rule.get())
stream << *rule;
else
2013-12-30 23:12:19 -08:00
stream << string("#<null-rule>");
return stream;
}
2013-11-12 08:17:19 -08:00
}
}