Remove some unnecessary global symbols from the library

This commit is contained in:
Max Brunsfeld 2019-08-28 11:17:01 -07:00
parent f0999d7ac0
commit a3ce4a4282
3 changed files with 5 additions and 6 deletions

View file

@ -122,7 +122,7 @@ static bool iterator_done(Iterator *self) {
return self->cursor.stack.size == 0;
}
Length iterator_start_position(Iterator *self) {
static Length iterator_start_position(Iterator *self) {
TreeCursorEntry entry = *array_back(&self->cursor.stack);
if (self->in_padding) {
return entry.position;
@ -131,7 +131,7 @@ Length iterator_start_position(Iterator *self) {
}
}
Length iterator_end_position(Iterator *self) {
static Length iterator_end_position(Iterator *self) {
TreeCursorEntry entry = *array_back(&self->cursor.stack);
Length result = length_add(entry.position, ts_subtree_padding(*entry.subtree));
if (self->in_padding) {
@ -287,7 +287,7 @@ typedef enum {
IteratorMatches,
} IteratorComparison;
IteratorComparison iterator_compare(const Iterator *old_iter, const Iterator *new_iter) {
static IteratorComparison iterator_compare(const Iterator *old_iter, const Iterator *new_iter) {
Subtree old_tree = NULL_SUBTREE;
Subtree new_tree = NULL_SUBTREE;
uint32_t old_start = 0;

View file

@ -18,8 +18,6 @@ typedef struct {
Length new_end;
} Edit;
TSStateId TS_TREE_STATE_NONE = USHRT_MAX;
#ifdef TREE_SITTER_TEST
#define TS_MAX_INLINE_TREE_LENGTH 2

View file

@ -5,6 +5,7 @@
extern "C" {
#endif
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include "./length.h"
@ -13,7 +14,7 @@ extern "C" {
#include "tree_sitter/api.h"
#include "tree_sitter/parser.h"
extern TSStateId TS_TREE_STATE_NONE;
static const TSStateId TS_TREE_STATE_NONE = USHRT_MAX;
#define NULL_SUBTREE ((Subtree) {.ptr = NULL})
typedef union Subtree Subtree;