Merge branch 'master' into include-symbol_id-in-node-types-json
This commit is contained in:
commit
f1f11bde00
37 changed files with 1090 additions and 478 deletions
|
|
@ -146,8 +146,9 @@ window.initializePlayground = async (opts) => {
|
|||
});
|
||||
|
||||
queryEditor.on('keydown', (_, event) => {
|
||||
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
||||
event.stopPropagation(); // Prevent mdBook from going back/forward
|
||||
const key = event.key;
|
||||
if (key === 'ArrowLeft' || key === 'ArrowRight' || key === '?') {
|
||||
event.stopPropagation(); // Prevent mdBook from going back/forward, or showing help
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,18 @@ A list of test names to skip fuzzing.
|
|||
|
||||
The directory containing the parser. This is primarily useful in multi-language repositories.
|
||||
|
||||
### `-p/--grammar-path`
|
||||
|
||||
The path to the directory containing the grammar.
|
||||
|
||||
### `--lib-path`
|
||||
|
||||
The path to the parser's dynamic library. This is used instead of the cached or automatically generated dynamic library.
|
||||
|
||||
### `--lang-name`
|
||||
|
||||
If `--lib-path` is used, the name of the language used to extract the library's language function
|
||||
|
||||
### `--edits <EDITS>`
|
||||
|
||||
The maximum number of edits to perform. The default is 3.
|
||||
|
|
|
|||
|
|
@ -34,17 +34,6 @@ The ABI to use for parser generation. The default is ABI 15, with ABI 14 being a
|
|||
|
||||
Only generate `grammar.json` and `node-types.json`
|
||||
|
||||
### `-0/--debug-build`
|
||||
|
||||
Compile the parser with debug flags enabled. This is useful when debugging issues that require a debugger like `gdb` or `lldb`.
|
||||
|
||||
### `--libdir <PATH>`
|
||||
|
||||
The directory to place the compiled parser(s) in.
|
||||
On Unix systems, the default path is `$XDG_CACHE_HOME/tree-sitter` if `$XDG_CACHE_HOME` is set,
|
||||
otherwise `$HOME/.config/tree-sitter` is used. On Windows, the default path is `%LOCALAPPDATA%\tree-sitter` if available,
|
||||
otherwise `$HOME\AppData\Local\tree-sitter` is used.
|
||||
|
||||
### `-o/--output`
|
||||
|
||||
The directory to place the generated parser in. The default is `src/` in the current directory.
|
||||
|
|
@ -55,7 +44,7 @@ Print the overview of states from the given rule. This is useful for debugging a
|
|||
item sets for all given states in a given rule. To solely view state count numbers for rules, pass in `-` for the rule argument.
|
||||
To view the overview of states for every rule, pass in `*` for the rule argument.
|
||||
|
||||
### `--json`
|
||||
### `--json-summary`
|
||||
|
||||
Report conflicts in a JSON format.
|
||||
|
||||
|
|
@ -65,3 +54,7 @@ The path to the JavaScript runtime executable to use when generating the parser.
|
|||
Note that you can also set this with `TREE_SITTER_JS_RUNTIME`. Starting from version 0.26.0, you can
|
||||
also pass in `native` to use the native QuickJS runtime that comes bundled with the CLI. This avoids
|
||||
the dependency on a JavaScript runtime entirely.
|
||||
|
||||
### `--disable-optimization`
|
||||
|
||||
Disable optimizations when generating the parser. Currently, this only affects the merging of compatible parse states.
|
||||
|
|
|
|||
|
|
@ -57,3 +57,7 @@ The path to an alternative configuration (`config.json`) file. See [the init-con
|
|||
### `-n/--test-number <TEST_NUMBER>`
|
||||
|
||||
Highlight the contents of a specific test.
|
||||
|
||||
### `-r/--rebuild`
|
||||
|
||||
Force a rebuild of the parser before running the fuzzer.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# `tree-sitter parse`
|
||||
|
||||
The `parse` command parses source files using a Tree-sitter parser. You can pass any number of file paths and glob patterns
|
||||
to `tree-sitter parse`, and it will parse all the given files. The command will exit with a non-zero status code if any
|
||||
parse errors occurred.
|
||||
to `tree-sitter parse`, and it will parse all the given files. If no paths are provided, input will be parsed from stdin.
|
||||
The command will exit with a non-zero status code if any parse errors occurred.
|
||||
|
||||
```bash
|
||||
tree-sitter parse [OPTIONS] [PATHS]... # Aliases: p
|
||||
|
|
@ -18,6 +18,14 @@ The path to a file that contains paths to source files to parse.
|
|||
|
||||
The path to the directory containing the grammar.
|
||||
|
||||
### `-l/--lib-path`
|
||||
|
||||
The path to the parser's dynamic library. This is used instead of the cached or automatically generated dynamic library.
|
||||
|
||||
### `--lang-name`
|
||||
|
||||
If `--lib-path` is used, the name of the language used to extract the library's language function
|
||||
|
||||
### `--scope <SCOPE>`
|
||||
|
||||
The language scope to use for parsing. This is useful when the language is ambiguous.
|
||||
|
|
@ -81,7 +89,7 @@ in `UTF-16BE` or `UTF-16LE`. If no `BOM` is present, `UTF-8` is the default. One
|
|||
|
||||
When using the `--debug-graph` option, open the log file in the default browser.
|
||||
|
||||
### `-j/--json`
|
||||
### `-j/--json-summary`
|
||||
|
||||
Output parsing results in a JSON format.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@ For this to work, you must have already built the parser as a Wasm module. This
|
|||
|
||||
## Options
|
||||
|
||||
### `-e/--export <EXPORT_PATH>`
|
||||
|
||||
Export static playground files to the specified directory instead of serving them.
|
||||
|
||||
### `-q/--quiet`
|
||||
|
||||
Don't automatically open the playground in the default browser.
|
||||
|
|
@ -24,3 +20,7 @@ Don't automatically open the playground in the default browser.
|
|||
### `--grammar-path <GRAMMAR_PATH>`
|
||||
|
||||
The path to the directory containing the grammar and wasm files.
|
||||
|
||||
### `-e/--export <EXPORT_PATH>`
|
||||
|
||||
Export static playground files to the specified directory instead of serving them.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,14 @@ tree-sitter query [OPTIONS] <QUERY_PATH> [PATHS]... # Aliases: q
|
|||
|
||||
The path to the directory containing the grammar.
|
||||
|
||||
### `--lib-path`
|
||||
|
||||
The path to the parser's dynamic library. This is used instead of the cached or automatically generated dynamic library.
|
||||
|
||||
### `--lang-name`
|
||||
|
||||
If `--lib-path` is used, the name of the language used to extract the library's language function
|
||||
|
||||
### `-t/--time`
|
||||
|
||||
Print the time taken to execute the query on the file.
|
||||
|
|
@ -51,3 +59,7 @@ The path to an alternative configuration (`config.json`) file. See [the init-con
|
|||
### `-n/--test-number <TEST_NUMBER>`
|
||||
|
||||
Query the contents of a specific test.
|
||||
|
||||
### `-r/--rebuild`
|
||||
|
||||
Force a rebuild of the parser before executing the query.
|
||||
|
|
|
|||
|
|
@ -36,3 +36,7 @@ The path to an alternative configuration (`config.json`) file. See [the init-con
|
|||
### `-n/--test-number <TEST_NUMBER>`
|
||||
|
||||
Generate tags from the contents of a specific test.
|
||||
|
||||
### `-r/--rebuild`
|
||||
|
||||
Force a rebuild of the parser before running the tags.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,14 @@ Only run tests from the given filename in the corpus.
|
|||
|
||||
The path to the directory containing the grammar.
|
||||
|
||||
### `--lib-path`
|
||||
|
||||
The path to the parser's dynamic library. This is used instead of the cached or automatically generated dynamic library.
|
||||
|
||||
### `--lang-name`
|
||||
|
||||
If `--lib-path` is used, the name of the language used to extract the library's language function
|
||||
|
||||
### `-u/--update`
|
||||
|
||||
Update the expected output of tests.
|
||||
|
|
@ -78,3 +86,7 @@ Force a rebuild of the parser before running tests.
|
|||
### `--overview-only`
|
||||
|
||||
Only show the overview of the test results, and not the diff.
|
||||
|
||||
### `--json-summary`
|
||||
|
||||
Output the test summary in a JSON format.
|
||||
|
|
|
|||
|
|
@ -42,3 +42,11 @@ tree-sitter version
|
|||
### `-p/--grammar-path <PATH>`
|
||||
|
||||
The path to the directory containing the grammar.
|
||||
|
||||
### `--bump`
|
||||
|
||||
Automatically bump the version. Possible values are:
|
||||
|
||||
- `patch`: Bump the patch version.
|
||||
- `minor`: Bump the minor version.
|
||||
- `major`: Bump the major version.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue