forked from extern/nushell
b943cbedff
This pr - fixes https://github.com/nushell/nushell/issues/10143 - fixes https://github.com/nushell/nushell/issues/5559 # Description Current `lite_parse` does not handle multiple line comments and eols in pipeline. When parsing the following tokens: | `"abcdefg"` | ` \|` | `# foobar` | ` \n` | `split chars` | | ------------- | ------------- |------------- |------------- |------------- | | [Command] | [Pipe] | [Comment] | [Eol] | [Command] | | | | Last Token |Current Token | | `TokenContent::Eol` handler only checks if `last_token` is `Pipe` but it will be broken if there exist any other thing, e.g. extra `[Comment]` in this example. This pr make the following change: - While parsing `[Eol]`, try to find the last non-comment token as `last_token` - Comment is supposed as `[Comment]+` or `([Comment] [Eol])+` - `[Eol]+` is still parsed just like current nu (i.e. generates `nothing`). Notice that this pr is just a quick patch if more comment/eol related issue occures, `lite_parser` may need a rewrite. # User-Facing Changes Now the following pipeline works: ```bash 1 | # comment each { |it| $it + 2 } | # comment math sum ``` Comment will not end the pipeline in interactive mode: ```bash ❯ 1 | # comment (now enter multiple line mode instead of end) ▶▶ # foo ▶▶ 2 ``` # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting None --------- Co-authored-by: Horasal <horsal@horsal.dev> |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-dataframe | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.