Some fixes for the new evaluator#40
Merged
sophiajt merged 1 commit intonushell:masterfrom May 28, 2019
Merged
Conversation
elferherrera
pushed a commit
to elferherrera/nushell
that referenced
this pull request
Feb 7, 2022
Parse errors for def, let and alias
fdncred
pushed a commit
that referenced
this pull request
Sep 10, 2023
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description Fixes #10300 , where using variables didnt work with `ucp` as it was only expecting a `Expr::FilePath`. Before: (from the issue) ``` ❯ ucp -r $var $folder Error: × Missing file operand ╭─[entry #40:1:1] 1 │ ucp -r $var $folder · ─┬─ · ╰── Missing file operand ╰──── help: Please provide source and destination paths ``` Now: ``` `ucp -r $var $folder` # success ``` Also added the test to ensure its working:) . Oh, and I tweaked again slightly the messages on two tests because now the whole `path` is printed rather than `a`. Say: ``` #before `cp a a` --> 'a' and 'a' are the same file # now `cp a a` --> /home/current/location/a and /home/current/location/a are the same file ``` <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - [X] `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - [X] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - [X] `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - [X] `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library <!-- > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
sholderbach
pushed a commit
that referenced
this pull request
Aug 12, 2025
… commands to utilize that (#16414) # Description - Implemented `FromValue` for `std::time::Duration`. - It only converts positive `Value::Duration` values, negative ones raise `ShellError::NeedsPositiveValue`. - Refactor `job recv` and `watch` commands to use this implementation rather than handling it ad-hoc. - Simplified `watch`'s `debounce` & `debounce-ms` and factored it to a function. Should make removing `debounce-ms` after its deprecation period ends. - `job recv` previously used a numeric cast (`i64 as u64`) which would result in extremely long duration values rather than raising an error when negative duration arguments were given. # User-Facing Changes Changes in error messages: - Providing the wrong type (bypassing parse time type checking): - Before ``` Error: nu::shell::type_mismatch × Type mismatch. ╭─[entry #40:1:9] 1 │ watch . --debounce (1 | $in) {|| } · ──────────┬───────── · ╰── Debounce duration must be a duration ╰──── ``` - After ``` Error: nu:🐚:cant_convert × Can't convert to duration. ╭─[entry #2:1:9] 1 │ watch . --debounce (1 | $in) {|| } · ──────────┬───────── · ╰── can't convert int to duration ╰──── ``` - Providing a negative duration value: - Before ``` Error: nu:🐚:type_mismatch × Type mismatch. ╭─[entry #41:1:9] 1 │ watch . --debounce -100ms {|| } · ────────┬──────── · ╰── Debounce duration is invalid ╰──── ``` - After ``` Error: nu:🐚:needs_positive_value × Negative value passed when positive one is required ╭─[entry #4:1:9] 1 │ watch . --debounce -100ms {|| } · ────────┬──────── · ╰── use a positive value ╰──── ```
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a couple bugfixes for the new evaluator to get us back to pre-evaluator parity.