mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Fix variable names that end in a duration suffix can't be on the right part of a range (#14848)
# Description Fixes: #14844 The issue occurs when nushell is parsing a value with `SyntaxShape::Any`, it checks `Duration` and `Filesize` first, then `Range`. Nushell raises errors too early while parsing `Duration/Filesize`. This pr changes the order of parsing to fix the issue. # User-Facing Changes The following code should be able to run after this pr ```nushell let runs = 10; 1..$runs ``` # Tests + Formatting Added 2 tests, one for filesize, one for duration. # After Submitting NaN
This commit is contained in:
@ -4950,9 +4950,9 @@ pub fn parse_value(
|
||||
} else {
|
||||
let shapes = [
|
||||
SyntaxShape::Binary,
|
||||
SyntaxShape::Range,
|
||||
SyntaxShape::Filesize,
|
||||
SyntaxShape::Duration,
|
||||
SyntaxShape::Range,
|
||||
SyntaxShape::DateTime,
|
||||
SyntaxShape::Int,
|
||||
SyntaxShape::Number,
|
||||
|
Reference in New Issue
Block a user