Skip to content

(range) parsing is weird #11274

@crides

Description

@crides

Describe the bug

> let day = 9
> 0..<$day
Error:   × duration value must be a number
   ╭─[entry #37:1:1]
 1 │ 0..<$day
   · ──┬──
   ·   ╰── not a number
   ╰────

> let ab = 8
> 0..$ab
Error:   × filesize value must be a number
   ╭─[entry #40:1:1]
 1 │ 0..$ab
   · ──┬──
   ·   ╰── not a number
   ╰────

The workaround for now is parenthesize the variable, i.e. 0..<($day)

How to reproduce

see above

Expected behavior

Both of them parsed as ranges without parentheses

Neither 0..<$ or 0..$ (replace 0 with any other number value) can't contain duration or filesize values, due to .. or $ not a possible token within a number.

Screenshots

No response

Configuration

key value
version 0.87.2
branch main
commit_hash aacf481
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.72.1 (d5c2e9c34 2023-09-13)
rust_channel 1.72.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.72.1 (103a7ff2e 2023-08-15)
build_time 2023-12-08 23:21:17 -08:00
build_rust_channel release
allocator mimalloc
features default, extra, sqlite, trash, which, zip
installed_plugins

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:parserIssues related to parsingcategory:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions