-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
305 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule src
updated
7 files
+50 −0 | grammar.js | |
+593 −144 | src/grammar.json | |
+37,303 −37,233 | src/parser.c | |
+1 −1 | src/scanner.c | |
+6 −6 | src/tree_sitter/parser.h | |
+1 −1 | test/corpus/c/expressions.txt | |
+89 −0 | test/corpus/expressions.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule src
updated
31 files
+9 −0 | .github/workflows/CICD.yml | |
+4 −1 | .github/workflows/build.yml | |
+1 −0 | .github/workflows/sanitize.yml | |
+0 −22 | .github/workflows/sync.yml | |
+0 −4 | .gitignore | |
+0 −12 | CMakeLists.txt | |
+5 −2 | Makefile | |
+100 −17 | cli/loader/src/lib.rs | |
+15 −5 | cli/npm/dsl.d.ts | |
+2 −1 | cli/src/generate/render.rs | |
+2 −2 | cli/src/highlight.rs | |
+56 −5 | cli/src/main.rs | |
+17 −7 | cli/src/test_highlight.rs | |
+20 −4 | cli/src/tests/corpus_test.rs | |
+11 −6 | cli/src/tests/helpers/dirs.rs | |
+9 −2 | cli/src/tests/helpers/fixtures.rs | |
+61 −0 | cli/src/tests/highlight_test.rs | |
+17 −0 | cli/src/tests/query_test.rs | |
+2 −1 | highlight/include/tree_sitter/highlight.h | |
+9 −3 | highlight/src/c_lib.rs | |
+22 −7 | highlight/src/lib.rs | |
+2 −1 | lib/binding_rust/build.rs | |
+44 −0 | lib/binding_rust/lib.rs | |
+5 −0 | lib/binding_web/binding.c | |
+11 −0 | lib/binding_web/binding.js | |
+1 −0 | lib/binding_web/exports.json | |
+16 −0 | lib/binding_web/test/node-test.js | |
+133 −135 | lib/include/tree_sitter/api.h | |
+16 −2 | lib/src/stack.c | |
+5 −5 | lib/src/subtree.c | |
+0 −6 | lib/src/subtree.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
EXPORTS | ||
ts_parser_new | ||
ts_parser_delete | ||
ts_parser_language | ||
ts_parser_set_language | ||
ts_parser_set_included_ranges | ||
ts_parser_included_ranges | ||
ts_parser_parse | ||
ts_parser_parse_string | ||
ts_parser_parse_string_encoding | ||
ts_parser_reset | ||
ts_parser_set_timeout_micros | ||
ts_parser_timeout_micros | ||
ts_parser_set_cancellation_flag | ||
ts_parser_cancellation_flag | ||
ts_parser_set_logger | ||
ts_parser_logger | ||
ts_parser_print_dot_graphs | ||
ts_tree_copy | ||
ts_tree_delete | ||
ts_tree_root_node | ||
ts_tree_root_node_with_offset | ||
ts_tree_language | ||
ts_tree_included_ranges | ||
ts_tree_edit | ||
ts_tree_get_changed_ranges | ||
ts_tree_print_dot_graph | ||
ts_node_type | ||
ts_node_symbol | ||
ts_node_language | ||
ts_node_grammar_type | ||
ts_node_grammar_symbol | ||
ts_node_start_byte | ||
ts_node_start_point | ||
ts_node_end_byte | ||
ts_node_end_point | ||
ts_node_string | ||
ts_node_is_null | ||
ts_node_is_named | ||
ts_node_is_missing | ||
ts_node_is_extra | ||
ts_node_has_changes | ||
ts_node_has_error | ||
ts_node_is_error | ||
ts_node_parse_state | ||
ts_node_next_parse_state | ||
ts_node_parent | ||
ts_node_child | ||
ts_node_field_name_for_child | ||
ts_node_child_count | ||
ts_node_named_child | ||
ts_node_named_child_count | ||
ts_node_child_by_field_name | ||
ts_node_child_by_field_id | ||
ts_node_next_sibling | ||
ts_node_prev_sibling | ||
ts_node_next_named_sibling | ||
ts_node_prev_named_sibling | ||
ts_node_first_child_for_byte | ||
ts_node_first_named_child_for_byte | ||
ts_node_descendant_count | ||
ts_node_descendant_for_byte_range | ||
ts_node_descendant_for_point_range | ||
ts_node_named_descendant_for_byte_range | ||
ts_node_named_descendant_for_point_range | ||
ts_node_edit | ||
ts_node_eq | ||
ts_tree_cursor_new | ||
ts_tree_cursor_delete | ||
ts_tree_cursor_reset | ||
ts_tree_cursor_reset_to | ||
ts_tree_cursor_current_node | ||
ts_tree_cursor_current_field_name | ||
ts_tree_cursor_current_field_id | ||
ts_tree_cursor_goto_parent | ||
ts_tree_cursor_goto_next_sibling | ||
ts_tree_cursor_goto_previous_sibling | ||
ts_tree_cursor_goto_first_child | ||
ts_tree_cursor_goto_last_child | ||
ts_tree_cursor_goto_descendant | ||
ts_tree_cursor_current_descendant_index | ||
ts_tree_cursor_current_depth | ||
ts_tree_cursor_goto_first_child_for_byte | ||
ts_tree_cursor_goto_first_child_for_point | ||
ts_tree_cursor_copy | ||
ts_query_new | ||
ts_query_delete | ||
ts_query_pattern_count | ||
ts_query_capture_count | ||
ts_query_string_count | ||
ts_query_start_byte_for_pattern | ||
ts_query_predicates_for_pattern | ||
ts_query_is_pattern_rooted | ||
ts_query_is_pattern_non_local | ||
ts_query_is_pattern_guaranteed_at_step | ||
ts_query_capture_name_for_id | ||
ts_query_capture_quantifier_for_id | ||
ts_query_string_value_for_id | ||
ts_query_disable_capture | ||
ts_query_disable_pattern | ||
ts_query_cursor_new | ||
ts_query_cursor_delete | ||
ts_query_cursor_exec | ||
ts_query_cursor_did_exceed_match_limit | ||
ts_query_cursor_match_limit | ||
ts_query_cursor_set_match_limit | ||
ts_query_cursor_set_byte_range | ||
ts_query_cursor_set_point_range | ||
ts_query_cursor_next_match | ||
ts_query_cursor_remove_match | ||
ts_query_cursor_next_capture | ||
ts_query_cursor_set_max_start_depth | ||
ts_language_symbol_count | ||
ts_language_state_count | ||
ts_language_symbol_name | ||
ts_language_symbol_for_name | ||
ts_language_field_count | ||
ts_language_field_name_for_id | ||
ts_language_field_id_for_name | ||
ts_language_symbol_type | ||
ts_language_version | ||
ts_language_next_state | ||
ts_lookahead_iterator_new | ||
ts_lookahead_iterator_delete | ||
ts_lookahead_iterator_reset_state | ||
ts_lookahead_iterator_reset | ||
ts_lookahead_iterator_language | ||
ts_lookahead_iterator_next | ||
ts_lookahead_iterator_current_symbol | ||
ts_lookahead_iterator_current_symbol_name | ||
ts_set_allocator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TreeSitterSharp.Native; | ||
|
||
namespace TreeSitterSharp.Json | ||
{ | ||
public unsafe class JsonLanguageProvider : ILanguageProvider | ||
{ | ||
[DllImport("libtree-sitter-json", EntryPoint = "tree_sitter_json", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] | ||
private static extern unsafe TsLanguage* tree_sitter_json(); | ||
|
||
public static Language GetLanguage() => Language.FromNative(tree_sitter_json()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>true</IsPackable> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="libtree-sitter-json" /> | ||
<PackageReference Include="GitVersion.MsBuild"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\TreeSitterSharp\TreeSitterSharp.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.