nushell/crates/nu-parser/src
pwygab f0a073b397
prevent parser from parsing variables as units (#12378)
# Description

Resolves #11274.

```
~/CodingProjects/nushell> let day = 2; echo 0..<$day
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 1 │
╰───┴───╯
~/CodingProjects/nushell> let kb = "jan"; echo 0..$kb 
Error: nu:🐚:type_mismatch

  × Type mismatch during operation.
   ╭─[entry #1:1:22]
 1 │ let kb = "jan"; echo 0..$kb
   ·                      ┬─┬─┬─
   ·                      │ │ ╰── string
   ·                      │ ╰── type mismatch for operator
   ·                      ╰── int
   ╰────
```


# Tests + Formatting

Relevant test added 🆙 

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2024-04-04 09:55:14 +02:00
..
deparse.rs update deps calamine and quick-xml (#11582) 2024-01-19 12:23:51 -06:00
exportable.rs Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
flatten.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
known_external.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
lex.rs Fix: lex now throws error on unbalanced closing parentheses (issue #11982) (#12098) 2024-03-07 06:05:04 -06:00
lib.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
lite_parser.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parse_keywords.rs Reuse existing small allocations if possible (#12335) 2024-03-30 14:04:11 +01:00
parse_patterns.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parse_shape_specs.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parser_path.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parser.rs prevent parser from parsing variables as units (#12378) 2024-04-04 09:55:14 +02:00
type_check.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00