Skip to content

Commit

Permalink
chore: update docs/bindings/manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Aug 25, 2023
1 parent 0c0b18d commit cbc9877
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 33 deletions.
6 changes: 1 addition & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
13 changes: 6 additions & 7 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test
build
script
examples
*.log
test.js
target
/test
/examples
/build
/script
/target
bindings/rust
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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][].

Expand All @@ -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/)
5 changes: 2 additions & 3 deletions bindings/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cbc9877

Please sign in to comment.