Skip to content

Commit 169cf1e

Browse files
committed
updated tree-sitter to v0.22.5
1 parent c890dce commit 169cf1e

19 files changed

+691
-371
lines changed

_automation/treesitter_updater/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
// Constants for the Tree Sitter version and download URL
19-
const sitterVersion = "0.21.0"
19+
const sitterVersion = "0.22.5"
2020
const sitterURL = "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v" + sitterVersion + ".tar.gz"
2121

2222
func main() {

alloc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "alloc.h"
2+
#include "api.h"
23
#include <stdlib.h>
34

45
static void *ts_malloc_default(size_t size) {
@@ -29,10 +30,10 @@ static void *ts_realloc_default(void *buffer, size_t size) {
2930
}
3031

3132
// Allow clients to override allocation functions dynamically
32-
void *(*ts_current_malloc)(size_t) = ts_malloc_default;
33-
void *(*ts_current_calloc)(size_t, size_t) = ts_calloc_default;
34-
void *(*ts_current_realloc)(void *, size_t) = ts_realloc_default;
35-
void (*ts_current_free)(void *) = free;
33+
TS_PUBLIC void *(*ts_current_malloc)(size_t) = ts_malloc_default;
34+
TS_PUBLIC void *(*ts_current_calloc)(size_t, size_t) = ts_calloc_default;
35+
TS_PUBLIC void *(*ts_current_realloc)(void *, size_t) = ts_realloc_default;
36+
TS_PUBLIC void (*ts_current_free)(void *) = free;
3637

3738
void ts_set_allocator(
3839
void *(*new_malloc)(size_t size),

alloc.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
#ifndef TREE_SITTER_ALLOC_H_
22
#define TREE_SITTER_ALLOC_H_
33

4-
#include "api.h"
5-
64
#ifdef __cplusplus
75
extern "C" {
86
#endif
97

10-
#include <stdlib.h>
118
#include <stdbool.h>
129
#include <stdio.h>
10+
#include <stdlib.h>
11+
12+
#if defined(TREE_SITTER_HIDDEN_SYMBOLS) || defined(_WIN32)
13+
#define TS_PUBLIC
14+
#else
15+
#define TS_PUBLIC __attribute__((visibility("default")))
16+
#endif
1317

14-
extern void *(*ts_current_malloc)(size_t);
15-
extern void *(*ts_current_calloc)(size_t, size_t);
16-
extern void *(*ts_current_realloc)(void *, size_t);
17-
extern void (*ts_current_free)(void *);
18+
TS_PUBLIC extern void *(*ts_current_malloc)(size_t);
19+
TS_PUBLIC extern void *(*ts_current_calloc)(size_t, size_t);
20+
TS_PUBLIC extern void *(*ts_current_realloc)(void *, size_t);
21+
TS_PUBLIC extern void (*ts_current_free)(void *);
1822

1923
// Allow clients to override allocation functions
2024
#ifndef ts_malloc
@@ -34,4 +38,4 @@ extern void (*ts_current_free)(void *);
3438
}
3539
#endif
3640

37-
#endif // TREE_SITTER_ALLOC_H_
41+
#endif // TREE_SITTER_ALLOC_H_

api.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef TREE_SITTER_API_H_
22
#define TREE_SITTER_API_H_
33

4+
#ifndef TREE_SITTER_HIDE_SYMBOLS
45
#if defined(__GNUC__) || defined(__clang__)
56
#pragma GCC visibility push(default)
67
#endif
8+
#endif
79

810
#ifdef __cplusplus
911
extern "C" {
@@ -103,7 +105,7 @@ typedef struct TSNode {
103105
typedef struct TSTreeCursor {
104106
const void *tree;
105107
const void *id;
106-
uint32_t context[2];
108+
uint32_t context[3];
107109
} TSTreeCursor;
108110

109111
typedef struct TSQueryCapture {
@@ -1255,8 +1257,10 @@ void ts_set_allocator(
12551257
}
12561258
#endif
12571259

1260+
#ifndef TREE_SITTER_HIDE_SYMBOLS
12581261
#if defined(__GNUC__) || defined(__clang__)
12591262
#pragma GCC visibility pop
12601263
#endif
1264+
#endif
12611265

12621266
#endif // TREE_SITTER_API_H_

0 commit comments

Comments
 (0)