Move public rule functions out of rule namespace

This way, there's only one public namespace: tree_sitter
This commit is contained in:
Max Brunsfeld 2015-09-03 17:49:20 -07:00
parent e386c634aa
commit bd77ab1ac9
66 changed files with 127 additions and 167 deletions

27
src/compiler/rule.cc Normal file
View 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