tree-sitter/test/helpers/tree_helpers.h
Max Brunsfeld 2169c45da9 Store subtree's lookahead byte count relative to its end offset
This improves test coverage for incremental parsing by generalizing
the randomized tests in `real_grammars.cc` to make *multiple* edits
before incrementally re-parsing.
2018-11-02 15:23:38 -07:00

19 lines
638 B
C++

#ifndef HELPERS_TREE_HELPERS_H_
#define HELPERS_TREE_HELPERS_H_
#include "runtime/subtree.h"
#include <vector>
#include <string>
extern const char *symbol_names[24];
SubtreeArray *tree_array(std::vector<Subtree> trees);
std::ostream &operator<<(std::ostream &stream, Subtree tree);
std::ostream &operator<<(std::ostream &stream, const TSNode &node);
bool operator==(const TSNode &left, const TSNode &right);
bool operator==(const std::vector<Subtree> &right, const SubtreeArray &array);
std::string to_string(const TSTree *);
void assert_consistent_tree_sizes(const TSTree *, const std::string &);
#endif // HELPERS_TREE_HELPERS_H_