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

22 lines
485 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 {
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-28 23:26:20 -08:00
stream << string("#<null rule>");
return stream;
}
2013-11-12 08:17:19 -08:00
}
}