* Fix UB access of NULL context. During the tests the global RzCons is accessed. Because it was never initialized all members were 0. Leading to undefined behavior and breaking the test with ASAN enabled. * Use correct yaml example for the command described. * Remove old shell compatibility code. * Remove dependency tree of rz_core_cmd_subst() and rz_core_cmd_subst_i(). * Remove rz_core_cmd_pipe_old() * Remove unused rz_core_hack_help() * Regenerate grammar after removal of legacy_quoted_stmt. |
||
|---|---|---|
| .. | ||
| bindings | ||
| corpus | ||
| src | ||
| .gitignore | ||
| binding.gyp | ||
| Cargo.toml | ||
| grammar.js | ||
| meson.build | ||
| meson_tree_sitter_generate.py | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tree-sitter.json | ||
rizin-shell-parser
This is the parser for rizin shell language. See https://tree-sitter.github.io/tree-sitter/creating-parsers for more info on how to create a parser with tree-sitter.
Sources
- grammar.js: defines the basic grammar
- src/scanner.c: external scanner used to scan some tokens that cannot be parsed with the regular js grammar, as that includes only the context-free part of the language.
- src/parser.c: this file is auto-generated by tree-sitter based on grammar.js
- corpus/*: list of test files used to ensure the grammar works well
How to update grammar
When you update something in grammar.js or src/scanner.c you have to re-generate the parser. The process works as follows:
- Do changes as needed to grammar.js and/or src/scanner.c
- Install npm dependencies with:
cd subprojects/rizin-shell-parser ; npm install - Re-generate the parser files:
npx tree-sitter generate - Check tests still pass:
npx tree-sitter test. Usenpx tree-sitter parse ./example-fileif you want to see the syntax tree of a custom input provided in./example-file - Commit auto-generated files and modified grammar.js and src/scanner.c into git.