mirror of
https://github.com/nushell/nushell.git
synced 2025-02-22 13:31:34 +01:00
# Description
The parsing logic for several of our keywords is conditional on the
particular commands for those keywords being in scope:
|
||
---|---|---|
.. | ||
fuzz_targets | ||
.gitignore | ||
Cargo.toml | ||
gather_seeds.nu | ||
README.md | ||
rust-toolchain.toml |
Fuzzer for nu-parser
- For detailed info, please look at cargo-fuzz
Quick start guide
- Install cargo-fuzz by
cargo install cargo-fuzz
- Run
gather_seeds.nu
for preparing the initial seeds corpus. This pulls.nu
files in the nushell repository as checked out and uses them as a starting of point. You can add additional files to increase diversity. - Make an output directory
mkdir out
- Run the fuzzer with
cargo fuzz run parse out seeds
whereparse
is the name of the target
Targets
parse
just pulls innu-parser
and reaches the lexing and parsing logic. No command gets executed.parse_with_keywords
also loadsnu-cmd-lang
providing the command implementations for the core keywords. This permits the fuzzer to reach more code paths as some parts depend on the availability of those declarations. This may also execute the const eval code paths of the keyword commands. As of now this command set should not have negative side effects upon const eval. The overall code is not executed by this target.