-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
'env': { | ||
'commonjs': true, | ||
'es2021': true, | ||
}, | ||
'extends': 'google', | ||
'overrides': [ | ||
], | ||
'parserOptions': { | ||
'ecmaVersion': 'latest', | ||
'sourceType': 'module', | ||
}, | ||
'rules': { | ||
'indent': ['error', 2, {'SwitchCase': 1}], | ||
'max-len': [ | ||
'error', | ||
{'code': 120, 'ignoreComments': true, 'ignoreUrls': true, 'ignoreStrings': true}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
/src/** linguist-vendored | ||
/examples/* linguist-vendored | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Cargo.lock | ||
node_modules | ||
build | ||
*.log | ||
package-lock.json | ||
target | ||
Cargo.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
target | ||
Cargo.lock | ||
build | ||
/test | ||
/examples | ||
/build | ||
/script | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
[package] | ||
name = "tree-sitter-jsdoc" | ||
description = "jsdoc grammar for the tree-sitter parsing library" | ||
version = "0.0.1" | ||
description = "JSDoc grammar for tree-sitter" | ||
version = "0.20.0" | ||
authors = [ | ||
"Max Brunsfeld <[email protected]>", | ||
"Amaan Qureshi <[email protected]>" | ||
] | ||
license = "MIT" | ||
readme = "bindings/rust/README.md" | ||
keywords = ["incremental", "parsing", "jsdoc"] | ||
categories = ["parsing", "text-editors"] | ||
repository = "https://github.com/tree-sitter/tree-sitter-javascript" | ||
edition = "2018" | ||
license = "MIT" | ||
edition = "2021" | ||
autoexamples = false | ||
|
||
build = "bindings/rust/build.rs" | ||
include = [ | ||
"bindings/rust/*", | ||
"grammar.js", | ||
"queries/*", | ||
"src/*", | ||
] | ||
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] | ||
|
||
[lib] | ||
path = "bindings/rust/lib.rs" | ||
|
||
[dependencies] | ||
tree-sitter = "0.17" | ||
tree-sitter = "~0.20.10" | ||
|
||
[build-dependencies] | ||
cc = "1.0" | ||
cc = "~1.0.83" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Max Brunsfeld | ||
Copyright (c) 2018 Max Brunsfeld <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
tree-sitter-jsdoc | ||
================= | ||
# tree-sitter-jsdoc | ||
|
||
[![Build Status](https://travis-ci.org/tree-sitter/tree-sitter-jsdoc.svg?branch=master)](https://travis-ci.org/tree-sitter/tree-sitter-jsdoc) | ||
[![build](https://github.com/tree-sitter/tree-sitter-python/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-python/actions/workflows/ci.yml) | ||
|
||
JSDoc grammar for [tree-sitter][]. | ||
|
||
[tree-sitter]: https://github.com/tree-sitter/tree-sitter | ||
|
||
References | ||
|
||
* [UseJSDoc](https://jsdoc.app/) | ||
[JSDoc](<(https://jsdoc.app/)>) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# tree-sitter-jsdoc | ||
|
||
This crate provides a JSDoc grammar for the [tree-sitter][] parsing library. | ||
To use this crate, add it to the `[dependencies]` section of your `Cargo.toml` | ||
file. (Note that you will probably also need to depend on the | ||
[`tree-sitter`][tree-sitter crate] crate to use the parsed result in any useful | ||
way.) | ||
|
||
```toml | ||
[dependencies] | ||
tree-sitter = "0.20.10" | ||
tree-sitter-jsdoc = "0.20.0" | ||
``` | ||
|
||
Typically, you will use the [language][language func] function to add this | ||
grammar to a tree-sitter [Parser][], and then use the parser to parse some code: | ||
|
||
```rust | ||
let code = r#" | ||
def double(x): | ||
return x * 2 | ||
"#; | ||
let mut parser = Parser::new(); | ||
parser.set_language(tree_sitter_jsdoc::language()).expect("Error loading JSDoc grammar"); | ||
let parsed = parser.parse(code, None); | ||
``` | ||
|
||
If you have any questions, please reach out to us in the [tree-sitter | ||
discussions] page. | ||
|
||
[language func]: https://docs.rs/tree-sitter-jsdoc/*/tree_sitter_jsdoc/fn.language.html | ||
[Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html | ||
[tree-sitter]: https://tree-sitter.github.io/ | ||
[tree-sitter crate]: https://crates.io/crates/tree-sitter | ||
[tree-sitter discussions]: https://github.com/tree-sitter/tree-sitter/discussions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
{ | ||
"name": "tree-sitter-jsdoc", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "JSDoc grammar for tree-sitter", | ||
"main": "bindings/node", | ||
"keywords": [ | ||
"parser", | ||
"lexer" | ||
"lexer", | ||
"jsdoc" | ||
], | ||
"authors": [ | ||
"Max Brunsfeld <[email protected]>" | ||
"author": "Max Brunsfeld <[email protected]>", | ||
"contributors": [ | ||
"Amaan Qureshi <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"nan": "^2.14.1" | ||
"nan": "^2.17.0" | ||
}, | ||
"devDependencies": { | ||
"tree-sitter-cli": "^0.19.1" | ||
"eslint": "^8.47.0", | ||
"eslint-config-google": "^0.14.0", | ||
"tree-sitter-cli": "^0.20.8" | ||
}, | ||
"scripts": { | ||
"build": "tree-sitter generate && node-gyp build", | ||
"lint": "eslint grammar.js", | ||
"parse": "tree-sitter parse", | ||
"test": "tree-sitter test" | ||
}, | ||
"repository": "https://github.com/tree-sitter/tree-sitter-jsdoc", | ||
"tree-sitter": [ | ||
{ | ||
"scope": "text.jsdoc", | ||
"injection-regex": "jsdoc" | ||
"injection-regex": "jsdoc", | ||
"highlights": [ | ||
"queries/highlights.scm" | ||
] | ||
} | ||
] | ||
} |