Skip to content

Commit 9806763

Browse files
committed
0.20.7. Update modules.
1 parent 80c297a commit 9806763

File tree

21 files changed

+104
-23
lines changed

21 files changed

+104
-23
lines changed

Sources/tree_sitter_language_resources/LanguageResources/go/highlights.scm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
; Function calls
22

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+
37
(call_expression
48
function: (identifier) @function)
59

Sources/tree_sitter_language_resources/LanguageResources/php/highlights.scm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
name: (name) @function.method)
1818

1919
(function_call_expression
20-
function: (qualified_name (name)) @function)
20+
function: [(qualified_name (name)) (name)] @function)
2121

2222
(scoped_call_expression
2323
name: (name) @function)
@@ -44,6 +44,8 @@
4444

4545
((name) @constant
4646
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
47+
((name) @constant.builtin
48+
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
4749

4850
((name) @constructor
4951
(#match? @constructor "^[A-Z]"))
@@ -54,9 +56,14 @@
5456
(variable_name) @variable
5557

5658
; 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
6067
(boolean) @constant.builtin
6168
(null) @constant.builtin
6269
(integer) @number

Sources/tree_sitter_language_resources/LanguageResources/swift/highlights.scm

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
(function_declaration ["init" @constructor])
2222
(throws) @keyword
2323
"async" @keyword
24+
"await" @keyword
2425
(where_keyword) @keyword
2526
(parameter external_name: (simple_identifier) @parameter)
2627
(parameter name: (simple_identifier) @parameter)
@@ -33,10 +34,15 @@
3334
"typealias"
3435
"struct"
3536
"class"
37+
"actor"
3638
"enum"
3739
"protocol"
3840
"extension"
3941
"indirect"
42+
"nonisolated"
43+
"override"
44+
"convenience"
45+
"required"
4046
"some"
4147
] @keyword
4248

@@ -54,10 +60,10 @@
5460
(enum_entry ["case" @keyword])
5561

5662
; Function calls
57-
(call_expression (simple_identifier) @function) ; foo()
63+
(call_expression (simple_identifier) @function.call) ; foo()
5864
(call_expression ; foo.bar.baz(): highlight the baz()
5965
(navigation_expression
60-
(navigation_suffix (simple_identifier) @function)))
66+
(navigation_suffix (simple_identifier) @function.call)))
6167
((navigation_expression
6268
(simple_identifier) @type) ; SomeType.method(): highlight SomeType as a type
6369
(#match? @type "^[A-Z]"))
@@ -68,7 +74,7 @@
6874
; Statements
6975
(for_statement ["for" @repeat])
7076
(for_statement ["in" @repeat])
71-
(for_statement item: (simple_identifier) @variable)
77+
(for_statement (pattern) @variable)
7278
(else) @keyword
7379
(as_operator) @keyword
7480

@@ -91,8 +97,10 @@
9197
(statement_label) @label
9298

9399
; Comments
94-
(comment) @comment
95-
(multiline_comment) @comment
100+
[
101+
(comment)
102+
(multiline_comment)
103+
] @comment @spell
96104

97105
; String literals
98106
(line_str_text) @string
@@ -117,6 +125,9 @@
117125
(boolean_literal) @boolean
118126
"nil" @variable.builtin
119127

128+
; Regex literals
129+
(regex_literal) @string.regex
130+
120131
; Operators
121132
(custom_operator) @operator
122133
[

scripts/build-tree-sitter.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function build_parser () {
6868
git clone https://github.com/tree-sitter/tree-sitter.git
6969

7070
pushd tree-sitter
71-
git checkout v0.20.6
71+
git checkout v0.20.7
7272
CFLAGS="${MACOS_COMMON_FLAGS} -std=gnu99 -O3 -Wall -Wextra" \
7373
CXXFLAGS="${MACOS_COMMON_FLAGS} -O3 -Wall -Wextra" \
7474
LDFLAGS="${MACOS_COMMON_FLAGS}" \
@@ -111,7 +111,6 @@ build_parser "ruby"
111111

112112
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-json.git
113113
pushd tree-sitter-json
114-
gh pr checkout 19
115114
popd
116115
build_parser "json"
117116

@@ -133,7 +132,7 @@ build_parser "java"
133132

134133
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python.git
135134
pushd tree-sitter-python
136-
gh pr checkout 162
135+
gh pr checkout 165
137136
popd
138137
build_parser "python"
139138

@@ -144,7 +143,7 @@ build_parser "html"
144143

145144
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-css.git
146145
pushd tree-sitter-css
147-
gh pr checkout 26
146+
gh pr checkout 27
148147
popd
149148
build_parser "css"
150149

tree_sitter.xcframework/Info.plist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-arm64_x86_64-maccatalyst</string>
9+
<string>macos-arm64_x86_64</string>
1010
<key>LibraryPath</key>
1111
<string>tree_sitter.framework</string>
1212
<key>SupportedArchitectures</key>
@@ -15,13 +15,11 @@
1515
<string>x86_64</string>
1616
</array>
1717
<key>SupportedPlatform</key>
18-
<string>ios</string>
19-
<key>SupportedPlatformVariant</key>
20-
<string>maccatalyst</string>
18+
<string>macos</string>
2119
</dict>
2220
<dict>
2321
<key>LibraryIdentifier</key>
24-
<string>macos-arm64_x86_64</string>
22+
<string>ios-arm64_x86_64-maccatalyst</string>
2523
<key>LibraryPath</key>
2624
<string>tree_sitter.framework</string>
2725
<key>SupportedArchitectures</key>
@@ -30,7 +28,9 @@
3028
<string>x86_64</string>
3129
</array>
3230
<key>SupportedPlatform</key>
33-
<string>macos</string>
31+
<string>ios</string>
32+
<key>SupportedPlatformVariant</key>
33+
<string>maccatalyst</string>
3434
</dict>
3535
<dict>
3636
<key>LibraryIdentifier</key>

tree_sitter.xcframework/ios-arm64/tree_sitter.framework/Headers/api.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ void ts_tree_delete(TSTree *self);
366366
*/
367367
TSNode ts_tree_root_node(const TSTree *self);
368368

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+
369379
/**
370380
* Get the language that was used to parse the syntax tree.
371381
*/
@@ -733,6 +743,11 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
733743
uint32_t *length
734744
);
735745

746+
bool ts_query_is_pattern_rooted(
747+
const TSQuery *self,
748+
uint32_t pattern_index
749+
);
750+
736751
bool ts_query_is_pattern_guaranteed_at_step(
737752
const TSQuery *self,
738753
uint32_t byte_offset

tree_sitter.xcframework/ios-arm64/tree_sitter.framework/Headers/css.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ extern TSLanguage *tree_sitter_css();
1313
}
1414
#endif
1515

16-
#endif // TREE_SITTER_CSS_H_
16+
#endif // TREE_SITTER_CSS_H_
Binary file not shown.

tree_sitter.xcframework/ios-arm64_x86_64-maccatalyst/tree_sitter.framework/Headers/api.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ void ts_tree_delete(TSTree *self);
366366
*/
367367
TSNode ts_tree_root_node(const TSTree *self);
368368

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+
369379
/**
370380
* Get the language that was used to parse the syntax tree.
371381
*/
@@ -733,6 +743,11 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
733743
uint32_t *length
734744
);
735745

746+
bool ts_query_is_pattern_rooted(
747+
const TSQuery *self,
748+
uint32_t pattern_index
749+
);
750+
736751
bool ts_query_is_pattern_guaranteed_at_step(
737752
const TSQuery *self,
738753
uint32_t byte_offset

0 commit comments

Comments
 (0)