Skip to content

Commit

Permalink
Use tree-sitter-make from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 21, 2024
1 parent 8bf5b90 commit dda6433
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 45,646 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 0.63 (unreleased)

### Parsing

Updated to the latest tree-sitter parser for Make.

## 0.62 (released 20th December 2024)

### Diffing
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 @@ -96,6 +96,7 @@ tree-sitter-css = "0.23.1"
tree-sitter-toml-ng = "0.7.0"
tree-sitter-lua = "0.2.0"
tree-sitter-xml = "0.7.0"
tree-sitter-make = "1.1.1"

[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 @@ -162,11 +162,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-latex-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-make",
src_dir: "vendored_parsers/tree-sitter-make-src",
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-newick",
src_dir: "vendored_parsers/tree-sitter-newick-src",
Expand Down
2 changes: 1 addition & 1 deletion manual/src/languages_supported.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ with `difft --list-languages`.
| Julia | [tree-sitter/tree-sitter-julia](https://github.com/tree-sitter/tree-sitter-julia) |
| Kotlin | [fwcd/tree-sitter-kotlin](https://github.com/fwcd/tree-sitter-kotlin) |
| Lua | [tree-sitter-grammars/tree-sitter-lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) |
| Make | [alemuller/tree-sitter-make](https://github.com/alemuller/tree-sitter-make) |
| Make | [tree-sitter-grammars/tree-sitter-make](https://github.com/tree-sitter-grammars/tree-sitter-make) |
| Nix | [cstrahan/tree-sitter-nix](https://github.com/cstrahan/tree-sitter-nix) |
| Objective-C | [amaanq/tree-sitter-objc](https://github.com/amaanq/tree-sitter-objc) |
| OCaml | [tree-sitter/tree-sitter-ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) |
Expand Down
12 changes: 5 additions & 7 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ extern "C" {
fn tree_sitter_janet_simple() -> ts::Language;
fn tree_sitter_kotlin() -> ts::Language;
fn tree_sitter_latex() -> ts::Language;
fn tree_sitter_make() -> ts::Language;
fn tree_sitter_newick() -> ts::Language;
fn tree_sitter_nix() -> ts::Language;
fn tree_sitter_pascal() -> ts::Language;
Expand Down Expand Up @@ -696,16 +695,15 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Make => {
let language = unsafe { tree_sitter_make() };
let language_fn = tree_sitter_make::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec!["shell_text", "text"].into_iter().collect(),
delimiter_tokens: vec![("(", ")")].into_iter().collect(),
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/make.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_make::HIGHLIGHTS_QUERY)
.unwrap(),
sub_languages: vec![TreeSitterSubLanguage {
query: ts::Query::new(&language, "(shell_function (shell_command) @contents)")
.unwrap(),
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/make.scm

This file was deleted.

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

This file was deleted.

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

This file was deleted.

14 changes: 0 additions & 14 deletions vendored_parsers/tree-sitter-make/README.md

This file was deleted.

Loading

0 comments on commit dda6433

Please sign in to comment.