File tree Expand file tree Collapse file tree 21 files changed +104
-23
lines changed
Sources/tree_sitter_language_resources/LanguageResources
ios-arm64_x86_64-maccatalyst/tree_sitter.framework
ios-arm64_x86_64-simulator/tree_sitter.framework
ios-arm64/tree_sitter.framework
macos-arm64_x86_64/tree_sitter.framework/Versions/A Expand file tree Collapse file tree 21 files changed +104
-23
lines changed Original file line number Diff line number Diff line change 1
1
; Function calls
2
2
3
+ (call_expression
4
+ function: (identifier) @function.builtin
5
+ (.match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))
6
+
3
7
(call_expression
4
8
function: (identifier) @function )
5
9
Original file line number Diff line number Diff line change 17
17
name: (name) @function.method )
18
18
19
19
(function_call_expression
20
- function: (qualified_name (name)) @function )
20
+ function: [ (qualified_name (name)) (name)] @function )
21
21
22
22
(scoped_call_expression
23
23
name: (name) @function )
44
44
45
45
((name) @constant
46
46
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
47
+ ((name) @constant.builtin
48
+ (#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
47
49
48
50
((name) @constructor
49
51
(#match? @constructor "^[A-Z]"))
54
56
(variable_name) @variable
55
57
56
58
; Basic tokens
57
-
58
- (string) @string
59
- (heredoc) @string
59
+ [
60
+ (string)
61
+ (string_value)
62
+ (encapsed_string)
63
+ (heredoc)
64
+ (heredoc_body)
65
+ (nowdoc_body)
66
+ ] @string
60
67
(boolean) @constant.builtin
61
68
(null) @constant.builtin
62
69
(integer) @number
Original file line number Diff line number Diff line change 21
21
(function_declaration [" init" @constructor])
22
22
(throws) @keyword
23
23
" async" @keyword
24
+ " await" @keyword
24
25
(where_keyword) @keyword
25
26
(parameter external_name: (simple_identifier) @parameter)
26
27
(parameter name: (simple_identifier) @parameter)
33
34
" typealias"
34
35
" struct"
35
36
" class"
37
+ " actor"
36
38
" enum"
37
39
" protocol"
38
40
" extension"
39
41
" indirect"
42
+ " nonisolated"
43
+ " override"
44
+ " convenience"
45
+ " required"
40
46
" some"
41
47
] @keyword
42
48
54
60
(enum_entry [" case" @keyword])
55
61
56
62
; Function calls
57
- (call_expression (simple_identifier) @function) ; foo()
63
+ (call_expression (simple_identifier) @function.call ) ; foo()
58
64
(call_expression ; foo.bar.baz(): highlight the baz()
59
65
(navigation_expression
60
- (navigation_suffix (simple_identifier) @function)))
66
+ (navigation_suffix (simple_identifier) @function.call )))
61
67
((navigation_expression
62
68
(simple_identifier) @type) ; SomeType.method(): highlight SomeType as a type
63
69
(#match? @type " ^[A-Z]" ))
68
74
; Statements
69
75
(for_statement [" for" @repeat])
70
76
(for_statement [" in" @repeat])
71
- (for_statement item: (simple_identifier ) @variable)
77
+ (for_statement (pattern ) @variable)
72
78
(else) @keyword
73
79
(as_operator) @keyword
74
80
91
97
(statement_label) @label
92
98
93
99
; Comments
94
- (comment) @comment
95
- (multiline_comment) @comment
100
+ [
101
+ (comment)
102
+ (multiline_comment)
103
+ ] @comment @spell
96
104
97
105
; String literals
98
106
(line_str_text) @string
117
125
(boolean_literal) @boolean
118
126
" nil" @variable.builtin
119
127
128
+ ; Regex literals
129
+ (regex_literal) @string.regex
130
+
120
131
; Operators
121
132
(custom_operator) @operator
122
133
[
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ function build_parser () {
68
68
git clone https://github.com/tree-sitter/tree-sitter.git
69
69
70
70
pushd tree-sitter
71
- git checkout v0.20.6
71
+ git checkout v0.20.7
72
72
CFLAGS=" ${MACOS_COMMON_FLAGS} -std=gnu99 -O3 -Wall -Wextra" \
73
73
CXXFLAGS=" ${MACOS_COMMON_FLAGS} -O3 -Wall -Wextra" \
74
74
LDFLAGS=" ${MACOS_COMMON_FLAGS} " \
@@ -111,7 +111,6 @@ build_parser "ruby"
111
111
112
112
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-json.git
113
113
pushd tree-sitter-json
114
- gh pr checkout 19
115
114
popd
116
115
build_parser " json"
117
116
@@ -133,7 +132,7 @@ build_parser "java"
133
132
134
133
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python.git
135
134
pushd tree-sitter-python
136
- gh pr checkout 162
135
+ gh pr checkout 165
137
136
popd
138
137
build_parser " python"
139
138
@@ -144,7 +143,7 @@ build_parser "html"
144
143
145
144
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-css.git
146
145
pushd tree-sitter-css
147
- gh pr checkout 26
146
+ gh pr checkout 27
148
147
popd
149
148
build_parser " css"
150
149
Original file line number Diff line number Diff line change 6
6
<array >
7
7
<dict >
8
8
<key >LibraryIdentifier </key >
9
- <string >ios -arm64_x86_64-maccatalyst </string >
9
+ <string >macos -arm64_x86_64 </string >
10
10
<key >LibraryPath </key >
11
11
<string >tree_sitter.framework </string >
12
12
<key >SupportedArchitectures </key >
15
15
<string >x86_64 </string >
16
16
</array >
17
17
<key >SupportedPlatform </key >
18
- <string >ios </string >
19
- <key >SupportedPlatformVariant </key >
20
- <string >maccatalyst </string >
18
+ <string >macos </string >
21
19
</dict >
22
20
<dict >
23
21
<key >LibraryIdentifier </key >
24
- <string >macos -arm64_x86_64 </string >
22
+ <string >ios -arm64_x86_64-maccatalyst </string >
25
23
<key >LibraryPath </key >
26
24
<string >tree_sitter.framework </string >
27
25
<key >SupportedArchitectures </key >
30
28
<string >x86_64 </string >
31
29
</array >
32
30
<key >SupportedPlatform </key >
33
- <string >macos </string >
31
+ <string >ios </string >
32
+ <key >SupportedPlatformVariant </key >
33
+ <string >maccatalyst </string >
34
34
</dict >
35
35
<dict >
36
36
<key >LibraryIdentifier </key >
Original file line number Diff line number Diff line change @@ -366,6 +366,16 @@ void ts_tree_delete(TSTree *self);
366
366
*/
367
367
TSNode ts_tree_root_node (const TSTree * self );
368
368
369
+ /**
370
+ * Get the root node of the syntax tree, but with its position
371
+ * shifted forward by the given offset.
372
+ */
373
+ TSNode ts_tree_root_node_with_offset (
374
+ const TSTree * self ,
375
+ uint32_t offset_bytes ,
376
+ TSPoint offset_point
377
+ );
378
+
369
379
/**
370
380
* Get the language that was used to parse the syntax tree.
371
381
*/
@@ -733,6 +743,11 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
733
743
uint32_t * length
734
744
);
735
745
746
+ bool ts_query_is_pattern_rooted (
747
+ const TSQuery * self ,
748
+ uint32_t pattern_index
749
+ );
750
+
736
751
bool ts_query_is_pattern_guaranteed_at_step (
737
752
const TSQuery * self ,
738
753
uint32_t byte_offset
Original file line number Diff line number Diff line change @@ -13,4 +13,4 @@ extern TSLanguage *tree_sitter_css();
13
13
}
14
14
#endif
15
15
16
- #endif // TREE_SITTER_CSS_H_
16
+ #endif // TREE_SITTER_CSS_H_
File renamed without changes.
Original file line number Diff line number Diff line change @@ -366,6 +366,16 @@ void ts_tree_delete(TSTree *self);
366
366
*/
367
367
TSNode ts_tree_root_node (const TSTree * self );
368
368
369
+ /**
370
+ * Get the root node of the syntax tree, but with its position
371
+ * shifted forward by the given offset.
372
+ */
373
+ TSNode ts_tree_root_node_with_offset (
374
+ const TSTree * self ,
375
+ uint32_t offset_bytes ,
376
+ TSPoint offset_point
377
+ );
378
+
369
379
/**
370
380
* Get the language that was used to parse the syntax tree.
371
381
*/
@@ -733,6 +743,11 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
733
743
uint32_t * length
734
744
);
735
745
746
+ bool ts_query_is_pattern_rooted (
747
+ const TSQuery * self ,
748
+ uint32_t pattern_index
749
+ );
750
+
736
751
bool ts_query_is_pattern_guaranteed_at_step (
737
752
const TSQuery * self ,
738
753
uint32_t byte_offset
You can’t perform that action at this time.
0 commit comments