Move public rule functions out of rule namespace
This way, there's only one public namespace: tree_sitter
This commit is contained in:
parent
e386c634aa
commit
bd77ab1ac9
66 changed files with 127 additions and 167 deletions
27
src/compiler/rule.cc
Normal file
27
src/compiler/rule.cc
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "compiler/rule.h"
|
||||
#include <set>
|
||||
|
||||
namespace tree_sitter {
|
||||
|
||||
using std::ostream;
|
||||
using std::string;
|
||||
|
||||
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() {}
|
||||
|
||||
} // namespace tree_sitter
|
||||
Loading…
Add table
Add a link
Reference in a new issue