Skip to content

Commit

Permalink
Use tree-sitter-lua from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 20, 2024
1 parent a6eb339 commit cef0b56
Show file tree
Hide file tree
Showing 57 changed files with 19 additions and 21,353 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ with YAML.
Improved language detection when one argument is a named pipe.

Updated to the latest tree-sitter parser for Bash, C, C++, C#, CSS,
Go, Haskell, HTML, Java, JavaScript, JSON, Julia, Objective-C, OCaml,
PHP, Python, Ruby, Scala, TOML and TypeScript.
Go, Haskell, HTML, Java, JavaScript, JSON, Julia, Lua, Objective-C,
OCaml, PHP, Python, Ruby, Scala, TOML and TypeScript.

### Syntax Highlighting

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 @@ -98,6 +98,7 @@ tree-sitter-json = "0.24.8"
tree-sitter-html = "0.23.2"
tree-sitter-css = "0.23.1"
tree-sitter-toml-ng = "0.7.0"
tree-sitter-lua = "0.2.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 @@ -162,11 +162,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-latex-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-lua",
src_dir: "vendored_parsers/tree-sitter-lua-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-make",
src_dir: "vendored_parsers/tree-sitter-make-src",
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_lua() -> ts::Language;
fn tree_sitter_make() -> ts::Language;
fn tree_sitter_newick() -> ts::Language;
fn tree_sitter_nix() -> ts::Language;
Expand Down Expand Up @@ -683,18 +682,17 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Lua => {
let language = unsafe { tree_sitter_lua() };
let language_fn = tree_sitter_lua::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec!["string"].into_iter().collect(),
delimiter_tokens: vec![("(", ")"), ("{", "}"), ("[", "]")]
.into_iter()
.collect(),
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/lua.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_lua::HIGHLIGHTS_QUERY)
.unwrap(),
sub_languages: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/lua.scm

This file was deleted.

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

This file was deleted.

39 changes: 0 additions & 39 deletions vendored_parsers/tree-sitter-lua/.editorconfig

This file was deleted.

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

This file was deleted.

107 changes: 0 additions & 107 deletions vendored_parsers/tree-sitter-lua/.github/workflows/ci.yml

This file was deleted.

17 changes: 0 additions & 17 deletions vendored_parsers/tree-sitter-lua/.github/workflows/publish.yml

This file was deleted.

38 changes: 0 additions & 38 deletions vendored_parsers/tree-sitter-lua/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions vendored_parsers/tree-sitter-lua/.prettierignore

This file was deleted.

3 changes: 0 additions & 3 deletions vendored_parsers/tree-sitter-lua/.prettierrc.json

This file was deleted.

24 changes: 0 additions & 24 deletions vendored_parsers/tree-sitter-lua/Cargo.toml

This file was deleted.

21 changes: 0 additions & 21 deletions vendored_parsers/tree-sitter-lua/LICENSE.md

This file was deleted.

Loading

0 comments on commit cef0b56

Please sign in to comment.