Skip to content

Commit f652d1e

Browse files
committed
0.208.1 Update modules
1 parent 160c825 commit f652d1e

File tree

13 files changed

+134
-46
lines changed

13 files changed

+134
-46
lines changed

Sources/tree_sitter_language_resources/LanguageResources/html/highlights.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
"<"
1010
">"
1111
"</"
12+
"/>"
1213
] @punctuation.bracket

Sources/tree_sitter_language_resources/LanguageResources/java/highlights.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
(character_literal)
7474
(string_literal)
7575
] @string
76+
(escape_sequence) @string.escape
7677

7778
[
7879
(true)

Sources/tree_sitter_language_resources/LanguageResources/php/tags.scm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
(namespace_definition
2+
name: (namespace_name) @name) @module
3+
4+
(interface_declaration
5+
name: (name) @name) @definition.interface
6+
7+
(trait_declaration
8+
name: (name) @name) @definition.interface
9+
110
(class_declaration
211
name: (name) @name) @definition.class
312

13+
(class_interface_clause [(name) (qualified_name)] @name) @impl
14+
15+
(property_declaration
16+
(property_element (variable_name (name) @name))) @definition.field
17+
418
(function_definition
519
name: (name) @name) @definition.function
620

scripts/build-tree-sitter.sh

Lines changed: 2 additions & 2 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.7
71+
git checkout v0.20.8
7272
CFLAGS="${MACOS_COMMON_FLAGS} -std=gnu99 -O3 -Wall -Wextra" \
7373
CXXFLAGS="${MACOS_COMMON_FLAGS} -O3 -Wall -Wextra" \
7474
LDFLAGS="${MACOS_COMMON_FLAGS}" \
@@ -132,7 +132,7 @@ build_parser "java"
132132

133133
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python.git
134134
pushd tree-sitter-python
135-
gh pr checkout 165
135+
gh pr checkout 162
136136
popd
137137
build_parser "python"
138138

tree_sitter.xcframework/Info.plist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>macos-arm64_x86_64</string>
9+
<string>ios-arm64</string>
1010
<key>LibraryPath</key>
1111
<string>tree_sitter.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
1414
<string>arm64</string>
15-
<string>x86_64</string>
1615
</array>
1716
<key>SupportedPlatform</key>
18-
<string>macos</string>
17+
<string>ios</string>
1918
</dict>
2019
<dict>
2120
<key>LibraryIdentifier</key>
@@ -34,7 +33,7 @@
3433
</dict>
3534
<dict>
3635
<key>LibraryIdentifier</key>
37-
<string>ios-arm64_x86_64-maccatalyst</string>
36+
<string>macos-arm64_x86_64</string>
3837
<key>LibraryPath</key>
3938
<string>tree_sitter.framework</string>
4039
<key>SupportedArchitectures</key>
@@ -43,21 +42,22 @@
4342
<string>x86_64</string>
4443
</array>
4544
<key>SupportedPlatform</key>
46-
<string>ios</string>
47-
<key>SupportedPlatformVariant</key>
48-
<string>maccatalyst</string>
45+
<string>macos</string>
4946
</dict>
5047
<dict>
5148
<key>LibraryIdentifier</key>
52-
<string>ios-arm64</string>
49+
<string>ios-arm64_x86_64-maccatalyst</string>
5350
<key>LibraryPath</key>
5451
<string>tree_sitter.framework</string>
5552
<key>SupportedArchitectures</key>
5653
<array>
5754
<string>arm64</string>
55+
<string>x86_64</string>
5856
</array>
5957
<key>SupportedPlatform</key>
6058
<string>ios</string>
59+
<key>SupportedPlatformVariant</key>
60+
<string>maccatalyst</string>
6161
</dict>
6262
</array>
6363
<key>CFBundlePackageType</key>

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ TSNode ts_tree_root_node_with_offset(
381381
*/
382382
const TSLanguage *ts_tree_language(const TSTree *);
383383

384+
/**
385+
* Get the array of included ranges that was used to parse the syntax tree.
386+
*
387+
* The returned pointer must be freed by the caller.
388+
*/
389+
TSRange *ts_tree_included_ranges(const TSTree *, uint32_t *length);
390+
384391
/**
385392
* Edit the syntax tree to keep it in sync with source code that has been
386393
* edited.
@@ -413,7 +420,7 @@ TSRange *ts_tree_get_changed_ranges(
413420
/**
414421
* Write a DOT graph describing the syntax tree to the given file.
415422
*/
416-
void ts_tree_print_dot_graph(const TSTree *, FILE *);
423+
void ts_tree_print_dot_graph(const TSTree *, int file_descriptor);
417424

418425
/******************/
419426
/* Section - Node */
@@ -743,15 +750,26 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
743750
uint32_t *length
744751
);
745752

746-
bool ts_query_is_pattern_rooted(
747-
const TSQuery *self,
748-
uint32_t pattern_index
749-
);
753+
/*
754+
* Check if the given pattern in the query has a single root node.
755+
*/
756+
bool ts_query_is_pattern_rooted(const TSQuery *self, uint32_t pattern_index);
750757

751-
bool ts_query_is_pattern_guaranteed_at_step(
752-
const TSQuery *self,
753-
uint32_t byte_offset
754-
);
758+
/*
759+
* Check if the given pattern in the query is 'non local'.
760+
*
761+
* A non-local pattern has multiple root nodes and can match within a
762+
* repeating sequence of nodes, as specified by the grammar. Non-local
763+
* patterns disable certain optimizations that would otherwise be possible
764+
* when executing a query on a specific range of a syntax tree.
765+
*/
766+
bool ts_query_is_pattern_non_local(const TSQuery *self, uint32_t pattern_index);
767+
768+
/*
769+
* Check if a given pattern is guaranteed to match once a given step is reached.
770+
* The step is specified by its byte offset in the query's source code.
771+
*/
772+
bool ts_query_is_pattern_guaranteed_at_step(const TSQuery *self, uint32_t byte_offset);
755773

756774
/**
757775
* Get the name and length of one of the query's captures, or one of the
Binary file not shown.

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ TSNode ts_tree_root_node_with_offset(
381381
*/
382382
const TSLanguage *ts_tree_language(const TSTree *);
383383

384+
/**
385+
* Get the array of included ranges that was used to parse the syntax tree.
386+
*
387+
* The returned pointer must be freed by the caller.
388+
*/
389+
TSRange *ts_tree_included_ranges(const TSTree *, uint32_t *length);
390+
384391
/**
385392
* Edit the syntax tree to keep it in sync with source code that has been
386393
* edited.
@@ -413,7 +420,7 @@ TSRange *ts_tree_get_changed_ranges(
413420
/**
414421
* Write a DOT graph describing the syntax tree to the given file.
415422
*/
416-
void ts_tree_print_dot_graph(const TSTree *, FILE *);
423+
void ts_tree_print_dot_graph(const TSTree *, int file_descriptor);
417424

418425
/******************/
419426
/* Section - Node */
@@ -743,15 +750,26 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
743750
uint32_t *length
744751
);
745752

746-
bool ts_query_is_pattern_rooted(
747-
const TSQuery *self,
748-
uint32_t pattern_index
749-
);
753+
/*
754+
* Check if the given pattern in the query has a single root node.
755+
*/
756+
bool ts_query_is_pattern_rooted(const TSQuery *self, uint32_t pattern_index);
750757

751-
bool ts_query_is_pattern_guaranteed_at_step(
752-
const TSQuery *self,
753-
uint32_t byte_offset
754-
);
758+
/*
759+
* Check if the given pattern in the query is 'non local'.
760+
*
761+
* A non-local pattern has multiple root nodes and can match within a
762+
* repeating sequence of nodes, as specified by the grammar. Non-local
763+
* patterns disable certain optimizations that would otherwise be possible
764+
* when executing a query on a specific range of a syntax tree.
765+
*/
766+
bool ts_query_is_pattern_non_local(const TSQuery *self, uint32_t pattern_index);
767+
768+
/*
769+
* Check if a given pattern is guaranteed to match once a given step is reached.
770+
* The step is specified by its byte offset in the query's source code.
771+
*/
772+
bool ts_query_is_pattern_guaranteed_at_step(const TSQuery *self, uint32_t byte_offset);
755773

756774
/**
757775
* Get the name and length of one of the query's captures, or one of the

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ TSNode ts_tree_root_node_with_offset(
381381
*/
382382
const TSLanguage *ts_tree_language(const TSTree *);
383383

384+
/**
385+
* Get the array of included ranges that was used to parse the syntax tree.
386+
*
387+
* The returned pointer must be freed by the caller.
388+
*/
389+
TSRange *ts_tree_included_ranges(const TSTree *, uint32_t *length);
390+
384391
/**
385392
* Edit the syntax tree to keep it in sync with source code that has been
386393
* edited.
@@ -413,7 +420,7 @@ TSRange *ts_tree_get_changed_ranges(
413420
/**
414421
* Write a DOT graph describing the syntax tree to the given file.
415422
*/
416-
void ts_tree_print_dot_graph(const TSTree *, FILE *);
423+
void ts_tree_print_dot_graph(const TSTree *, int file_descriptor);
417424

418425
/******************/
419426
/* Section - Node */
@@ -743,15 +750,26 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern(
743750
uint32_t *length
744751
);
745752

746-
bool ts_query_is_pattern_rooted(
747-
const TSQuery *self,
748-
uint32_t pattern_index
749-
);
753+
/*
754+
* Check if the given pattern in the query has a single root node.
755+
*/
756+
bool ts_query_is_pattern_rooted(const TSQuery *self, uint32_t pattern_index);
750757

751-
bool ts_query_is_pattern_guaranteed_at_step(
752-
const TSQuery *self,
753-
uint32_t byte_offset
754-
);
758+
/*
759+
* Check if the given pattern in the query is 'non local'.
760+
*
761+
* A non-local pattern has multiple root nodes and can match within a
762+
* repeating sequence of nodes, as specified by the grammar. Non-local
763+
* patterns disable certain optimizations that would otherwise be possible
764+
* when executing a query on a specific range of a syntax tree.
765+
*/
766+
bool ts_query_is_pattern_non_local(const TSQuery *self, uint32_t pattern_index);
767+
768+
/*
769+
* Check if a given pattern is guaranteed to match once a given step is reached.
770+
* The step is specified by its byte offset in the query's source code.
771+
*/
772+
bool ts_query_is_pattern_guaranteed_at_step(const TSQuery *self, uint32_t byte_offset);
755773

756774
/**
757775
* Get the name and length of one of the query's captures, or one of the

0 commit comments

Comments
 (0)