Not needed at the moment because rule pointers are are always wrapped in shared_ptrs. Still, don't want to forget this if I stopped using shared_ptrs at some point.
27 lines
647 B
C++
27 lines
647 B
C++
#include "compiler/rules/rule.h"
|
|
#include <set>
|
|
|
|
namespace tree_sitter {
|
|
using std::ostream;
|
|
using std::string;
|
|
|
|
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();
|
|
}
|
|
|
|
ostream& operator<<(ostream& stream, const rule_ptr &rule) {
|
|
if (rule.get())
|
|
stream << *rule;
|
|
else
|
|
stream << string("#<null-rule>");
|
|
return stream;
|
|
}
|
|
|
|
Rule::~Rule() {}
|
|
}
|
|
}
|