Skip to content

Commit

Permalink
Update F# parser to use crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Feb 23, 2025
1 parent 5420cd1 commit 89e2a45
Show file tree
Hide file tree
Showing 76 changed files with 20 additions and 386,446 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Parsing

Updated to the latest tree-sitter parser for Pascal and Swift.
Updated to the latest tree-sitter parser for F#, Pascal and Swift.

## 0.63 (released 11th February 2025)

Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ tree-sitter-elixir = "0.3.4"
tree-sitter-nix = "0.0.2"
tree-sitter-pascal = "0.10.0"
tree-sitter-swift = "0.7.0"
tree-sitter-fsharp = "0.1.0"

[dev-dependencies]
# assert_cmd 2.0.10 requires predicates 3.
Expand Down
5 changes: 0 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-erlang-src",
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-f-sharp",
src_dir: "vendored_parsers/tree-sitter-f-sharp-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-gleam",
src_dir: "vendored_parsers/tree-sitter-gleam-src",
Expand Down
2 changes: 1 addition & 1 deletion sample_files/compare.expected
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sample_files/erlang_1.erl sample_files/erlang_2.erl
dccdb8f65d2f099ab1a8cb66011376a2 -

sample_files/f_sharp_1.fs sample_files/f_sharp_2.fs
a9251656c7808ec0e3411fbbd189f5aa -
25253b18ef64469c67cf9a7131c8c125 -

sample_files/hack_1.php sample_files/hack_2.php
c2bb0aa7d7b07d6ced79f6a5363e878b -
Expand Down
13 changes: 6 additions & 7 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ extern "C" {
fn tree_sitter_elm() -> ts::Language;
fn tree_sitter_elvish() -> ts::Language;
fn tree_sitter_erlang() -> ts::Language;
fn tree_sitter_fsharp() -> ts::Language;
fn tree_sitter_gleam() -> ts::Language;
fn tree_sitter_hare() -> ts::Language;
fn tree_sitter_hack() -> ts::Language;
Expand Down Expand Up @@ -374,16 +373,16 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
FSharp => {
let language = unsafe { tree_sitter_fsharp() };
let language_fn = tree_sitter_fsharp::LANGUAGE_FSHARP;
let language = tree_sitter::Language::new(language_fn);

TreeSitterConfig {
language: language.clone(),
atom_nodes: ["string", "triple_quoted_string"].into_iter().collect(),
delimiter_tokens: vec![("(", ")"), ("[", "]"), ("{", "}")],
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/f-sharp.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_fsharp::HIGHLIGHTS_QUERY)
.unwrap(),

sub_languages: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/f-sharp.scm

This file was deleted.

1 change: 0 additions & 1 deletion vendored_parsers/tree-sitter-f-sharp-src

This file was deleted.

43 changes: 0 additions & 43 deletions vendored_parsers/tree-sitter-f-sharp/.editorconfig

This file was deleted.

20 changes: 0 additions & 20 deletions vendored_parsers/tree-sitter-f-sharp/.eslintrc.js

This file was deleted.

11 changes: 0 additions & 11 deletions vendored_parsers/tree-sitter-f-sharp/.gitattributes

This file was deleted.

10 changes: 0 additions & 10 deletions vendored_parsers/tree-sitter-f-sharp/.github/dependabot.yml

This file was deleted.

50 changes: 0 additions & 50 deletions vendored_parsers/tree-sitter-f-sharp/.github/workflows/ci.yml

This file was deleted.

53 changes: 0 additions & 53 deletions vendored_parsers/tree-sitter-f-sharp/.github/workflows/main.yml

This file was deleted.

36 changes: 0 additions & 36 deletions vendored_parsers/tree-sitter-f-sharp/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions vendored_parsers/tree-sitter-f-sharp/.npmignore

This file was deleted.

26 changes: 0 additions & 26 deletions vendored_parsers/tree-sitter-f-sharp/Cargo.toml

This file was deleted.

21 changes: 0 additions & 21 deletions vendored_parsers/tree-sitter-f-sharp/LICENSE

This file was deleted.

Loading

0 comments on commit 89e2a45

Please sign in to comment.