ruby_tree_sitter 1.9.0-aarch64-linux-musl → 1.10.0-aarch64-linux-musl
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/tree_sitter/language.c +8 -4
- data/ext/tree_sitter/query.c +2 -1
- data/lib/tree_sitter/3.0/tree_sitter.so +0 -0
- data/lib/tree_sitter/3.1/tree_sitter.so +0 -0
- data/lib/tree_sitter/3.2/tree_sitter.so +0 -0
- data/lib/tree_sitter/3.3/tree_sitter.so +0 -0
- data/lib/tree_sitter/error.rb +27 -0
- data/lib/tree_sitter/mixins/language.rb +1 -1
- data/lib/tree_sitter/version.rb +1 -1
- data/lib/tree_sitter.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74eeced6b9742f48bca4b43d8daf3445ff48d952eb88e6240adac85c6c72bbc0
|
4
|
+
data.tar.gz: 31e53820141087dbb8cfad8ff3c879e620d5a9be7588afa137e8a1cc7b1f39f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b2faa02afed2e398d9fe697083991273321e1e38c944a37418a67b6e1a0db0a0bbd6fe067738d3c23622739f2cf1f368f40bfab6ba9b089a353533a59838bc
|
7
|
+
data.tar.gz: 10505cae4f50b2eb30ad17d6f98932a92407b1076005a38cbdc30a73ed194d96c39ffde6a97a8cbd463cfe70c8e9528cd1526c9dce66dee700827c803eabf33f
|
data/ext/tree_sitter/language.c
CHANGED
@@ -42,7 +42,8 @@ static VALUE language_load(VALUE self, VALUE name, VALUE path) {
|
|
42
42
|
void *lib = dlopen(path_cstr, RTLD_NOW);
|
43
43
|
const char *err = dlerror();
|
44
44
|
if (err != NULL) {
|
45
|
-
|
45
|
+
VALUE parser_not_found = rb_const_get(mTreeSitter, rb_intern("ParserNotFoundError"));
|
46
|
+
rb_raise(parser_not_found,
|
46
47
|
"Could not load shared library `%s'.\nReason: %s", path_cstr, err);
|
47
48
|
}
|
48
49
|
|
@@ -52,7 +53,8 @@ static VALUE language_load(VALUE self, VALUE name, VALUE path) {
|
|
52
53
|
err = dlerror();
|
53
54
|
if (err != NULL) {
|
54
55
|
dlclose(lib);
|
55
|
-
|
56
|
+
VALUE symbol_not_found = rb_const_get(mTreeSitter, rb_intern("SymbolNotFoundError"));
|
57
|
+
rb_raise(symbol_not_found,
|
56
58
|
"Could not load symbol `%s' from library `%s'.\nReason:%s",
|
57
59
|
StringValueCStr(name), path_cstr, err);
|
58
60
|
}
|
@@ -60,7 +62,8 @@ static VALUE language_load(VALUE self, VALUE name, VALUE path) {
|
|
60
62
|
TSLanguage *lang = make_ts_language();
|
61
63
|
if (lang == NULL) {
|
62
64
|
dlclose(lib);
|
63
|
-
|
65
|
+
VALUE language_load_error = rb_const_get(mTreeSitter, rb_intern("LanguageLoadError"));
|
66
|
+
rb_raise(language_load_error,
|
64
67
|
"TSLanguage = NULL for language `%s' in library `%s'.\nCall your "
|
65
68
|
"local TSLanguage supplier.",
|
66
69
|
StringValueCStr(name), path_cstr);
|
@@ -68,7 +71,8 @@ static VALUE language_load(VALUE self, VALUE name, VALUE path) {
|
|
68
71
|
|
69
72
|
uint32_t version = ts_language_version(lang);
|
70
73
|
if (version < TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION) {
|
71
|
-
|
74
|
+
VALUE version_error = rb_const_get(mTreeSitter, rb_intern("ParserVersionError"));
|
75
|
+
rb_raise(version_error,
|
72
76
|
"Language %s (v%d) from `%s' is old.\nMinimum supported ABI: "
|
73
77
|
"v%d.\nCurrent ABI: v%d.",
|
74
78
|
StringValueCStr(name), version, path_cstr,
|
data/ext/tree_sitter/query.c
CHANGED
@@ -134,7 +134,8 @@ static VALUE query_initialize(VALUE self, VALUE language, VALUE source) {
|
|
134
134
|
TSQuery *res = ts_query_new(lang, src, len, &error_offset, &error_type);
|
135
135
|
|
136
136
|
if (res == NULL || error_offset > 0) {
|
137
|
-
|
137
|
+
VALUE query_creation_error = rb_const_get(mTreeSitter, rb_intern("QueryCreationError"));
|
138
|
+
rb_raise(query_creation_error, "Could not create query: TSQueryError%s",
|
138
139
|
query_error_str(error_type));
|
139
140
|
} else {
|
140
141
|
SELF = res;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TreeSitter
|
4
|
+
# Base tree-sitter error.
|
5
|
+
class TreeSitterError < Exception
|
6
|
+
end
|
7
|
+
|
8
|
+
# Raised when query creation fails.
|
9
|
+
class QueryCreationError < TreeSitterError
|
10
|
+
end
|
11
|
+
|
12
|
+
# Raised when the language symbol is found, but loading it returns nothing.
|
13
|
+
class LanguageLoadError < TreeSitterError
|
14
|
+
end
|
15
|
+
|
16
|
+
# Raised when a parser is not found.
|
17
|
+
class ParserNotFoundError < TreeSitterError
|
18
|
+
end
|
19
|
+
|
20
|
+
# Raised when the parser version is incompatible with the current tree-sitter.
|
21
|
+
class ParserVersionError < TreeSitterError
|
22
|
+
end
|
23
|
+
|
24
|
+
# Raised when a parser is not found.
|
25
|
+
class SymbolNotFoundError < TreeSitterError
|
26
|
+
end
|
27
|
+
end
|
data/lib/tree_sitter/version.rb
CHANGED
data/lib/tree_sitter.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_tree_sitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: aarch64-linux-musl
|
6
6
|
authors:
|
7
7
|
- Firas al-Khalil
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sorbet-runtime
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/tree_sitter/3.1/tree_sitter.so
|
79
79
|
- lib/tree_sitter/3.2/tree_sitter.so
|
80
80
|
- lib/tree_sitter/3.3/tree_sitter.so
|
81
|
+
- lib/tree_sitter/error.rb
|
81
82
|
- lib/tree_sitter/helpers.rb
|
82
83
|
- lib/tree_sitter/mixins/language.rb
|
83
84
|
- lib/tree_sitter/node.rb
|