tree-sitter/test/helpers/point_helpers.h
Max Brunsfeld 87c992a7f0 Add lexer API for detecting boundaries of included ranges
Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
2018-07-17 13:58:26 -07:00

27 lines
841 B
C++

#ifndef HELPERS_POINT_HELPERS_H_
#define HELPERS_POINT_HELPERS_H_
#include "runtime/length.h"
#include <ostream>
bool operator==(const TSPoint &left, const TSPoint &right);
bool operator<(const TSPoint &left, const TSPoint &right);
bool operator>(const TSPoint &left, const TSPoint &right);
bool operator==(const TSRange &left, const TSRange &right);
bool operator==(const Length &left, const Length &right);
std::ostream &operator<<(std::ostream &stream, const TSPoint &point);
std::ostream &operator<<(std::ostream &stream, const TSRange &range);
std::ostream &operator<<(std::ostream &stream, const Length &length);
TSPoint extent_for_string(const std::string &text, size_t end_index = std::string::npos);
TSRange range_for_substring(const std::string &text, const std::string &substring);
#endif // HELPERS_POINT_HELPERS_H_