2013-11-10 14:24:25 -08:00
|
|
|
#include "rule.h"
|
2013-12-15 14:41:51 -08:00
|
|
|
#include <set>
|
2013-11-10 14:24:25 -08:00
|
|
|
|
2013-12-19 23:05:54 -08:00
|
|
|
using std::ostream;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
2013-11-12 08:17:19 -08:00
|
|
|
namespace tree_sitter {
|
|
|
|
|
namespace rules {
|
2014-01-05 01:19:32 -08:00
|
|
|
bool Rule::operator!=(const Rule &other) const {
|
|
|
|
|
return !this->operator==(other);
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-19 23:05:54 -08:00
|
|
|
ostream& operator<<(ostream& stream, const Rule &rule) {
|
|
|
|
|
return stream << rule.to_string();
|
2013-11-12 08:17:19 -08:00
|
|
|
}
|
2013-11-14 21:25:58 -08:00
|
|
|
|
2013-12-19 23:05:54 -08:00
|
|
|
ostream& operator<<(ostream& stream, const rule_ptr &rule) {
|
2013-12-28 23:26:20 -08:00
|
|
|
if (rule.get())
|
|
|
|
|
stream << *rule;
|
2013-11-14 21:25:58 -08:00
|
|
|
else
|
2013-12-30 23:12:19 -08:00
|
|
|
stream << string("#<null-rule>");
|
2013-11-14 21:25:58 -08:00
|
|
|
return stream;
|
|
|
|
|
}
|
2013-11-12 08:17:19 -08:00
|
|
|
}
|
2013-11-10 14:24:25 -08:00
|
|
|
}
|