In compiler, distinguish between anonymous tokens and hidden rules
This commit is contained in:
parent
4b270c8604
commit
5982b77c97
46 changed files with 41131 additions and 40884 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include "compiler/prepared_grammar.h"
|
||||
|
||||
using std::cout;
|
||||
|
||||
|
|
@ -83,4 +84,16 @@ inline std::ostream& operator<<(std::ostream &stream, const std::pair<T1, T2> &p
|
|||
|
||||
} // namespace std
|
||||
|
||||
namespace tree_sitter {
|
||||
|
||||
using std::ostream;
|
||||
using std::string;
|
||||
using std::to_string;
|
||||
|
||||
inline ostream &operator<<(ostream &stream, const RuleEntry &entry) {
|
||||
return stream << string("{") << entry.name << string(", ") << entry.rule << string(", ") << to_string(entry.type) << string("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue