From cbc9877afa590bc9bdb3b524972c3333de3b6df1 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 25 Aug 2023 01:02:48 -0400 Subject: [PATCH] chore: update docs/bindings/manifests --- .gitattributes | 6 +----- .gitignore | 7 ++----- .npmignore | 13 ++++++------- README.md | 9 ++++----- bindings/rust/README.md | 5 ++--- bindings/rust/build.rs | 2 +- bindings/rust/lib.rs | 14 +++++++------- 7 files changed, 23 insertions(+), 33 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1491f7e1..951a1940 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,6 @@ -/src/** linguist-vendored /examples/* linguist-vendored +src/tree_sitter/* linguist-generated src/grammar.json linguist-generated src/node-types.json linguist-generated src/parser.c linguist-generated - -src/grammar.json -diff -src/node-types.json -diff -src/parser.c -diff diff --git a/.gitignore b/.gitignore index 58e59bb5..c9971383 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,7 @@ Cargo.lock +package-lock.json node_modules -.node-version build *.log -/test.js -/examples/npm -package-lock.json +/examples/*/ /target/ -.build/ \ No newline at end of file diff --git a/.npmignore b/.npmignore index 6467752b..0f438b55 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,6 @@ -test -build -script -examples -*.log -test.js -target +/test +/examples +/build +/script +/target +bindings/rust diff --git a/README.md b/README.md index 98c14bcf..f1d3bd79 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -tree-sitter-javascript -=========================== +# tree-sitter-javascript -[![CI Status](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml) +[![CI](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml) JavaScript and JSX grammar for [tree-sitter][]. For TypeScript, see [tree-sitter-typescript][]. @@ -10,5 +9,5 @@ JavaScript and JSX grammar for [tree-sitter][]. For TypeScript, see [tree-sitter References -* [The ESTree Spec](https://github.com/estree/estree) -* [The ECMAScript 2015 Spec](http://www.ecma-international.org/ecma-262/6.0/) +- [The ESTree Spec](https://github.com/estree/estree) +- [The ECMAScript 2015 Spec](http://www.ecma-international.org/ecma-262/6.0/) diff --git a/bindings/rust/README.md b/bindings/rust/README.md index fefd8979..473f52fb 100644 --- a/bindings/rust/README.md +++ b/bindings/rust/README.md @@ -8,8 +8,8 @@ way.) ``` toml [dependencies] -tree-sitter = "0.20" -tree-sitter-javascript = "0.20" +tree-sitter = "~0.20.10" +tree-sitter-javascript = "~0.20.1" ``` Typically, you will use the [language][language func] function to add this @@ -39,7 +39,6 @@ fn main() { If you have any questions, please reach out to us in the [tree-sitter discussions] page. -[Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html [language func]: https://docs.rs/tree-sitter-javascript/*/tree_sitter_javascript/fn.language.html [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html [tree-sitter]: https://tree-sitter.github.io/ diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs index 79518dda..3a8ac8b6 100644 --- a/bindings/rust/build.rs +++ b/bindings/rust/build.rs @@ -5,7 +5,7 @@ fn main() { let src_dir = Path::new("src"); let mut c_config = cc::Build::new(); - c_config.include(&src_dir); + c_config.include(src_dir); c_config .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable") diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index 6b5edbcf..5378cae5 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -44,27 +44,27 @@ pub fn language() -> Language { } /// The source of the JavaScript tree-sitter grammar description. -pub const GRAMMAR: &'static str = include_str!("../../grammar.js"); +pub const GRAMMAR: &str = include_str!("../../grammar.js"); /// The syntax highlighting query for this language. -pub const HIGHLIGHT_QUERY: &'static str = include_str!("../../queries/highlights.scm"); +pub const HIGHLIGHT_QUERY: &str = include_str!("../../queries/highlights.scm"); /// The syntax highlighting query for languages injected into this one. -pub const INJECTION_QUERY: &'static str = include_str!("../../queries/injections.scm"); +pub const INJECTION_QUERY: &str = include_str!("../../queries/injections.scm"); /// The syntax highlighting query for JSX. -pub const JSX_HIGHLIGHT_QUERY: &'static str = include_str!("../../queries/highlights-jsx.scm"); +pub const JSX_HIGHLIGHT_QUERY: &str = include_str!("../../queries/highlights-jsx.scm"); /// The local-variable syntax highlighting query for this language. -pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm"); +pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm"); /// The content of the [`node-types.json`][] file for this grammar. /// /// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types -pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json"); +pub const NODE_TYPES: &str = include_str!("../../src/node-types.json"); /// The symbol tagging query for this language. -pub const TAGGING_QUERY: &'static str = include_str!("../../queries/tags.scm"); +pub const TAGGING_QUERY: &str = include_str!("../../queries/tags.scm"); #[cfg(test)] mod tests {