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

26 lines
606 B
C++
Raw Normal View History

#include "rule.h"
2013-12-15 14:41:51 -08:00
#include <set>
using std::ostream;
using std::string;
2013-11-12 08:17:19 -08:00
namespace tree_sitter {
namespace rules {
bool Rule::operator!=(const Rule &other) const {
return !this->operator==(other);
}
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
}
}