nushell/src
mike 0e4729b203
improve parsing of values with units (#9190)
closes #9111 

# Description

this pr improves parsing of values with units (`filesizes`, `durations`
and any other **future values**) by:

1. allowing underscores in the value part
```nu
> 42kb          # okay
> 42_sec        # okay
> 1_000_000mib  # okay
> 69k_b         # not okay, underscores not allowed in the unit
```

2. improving error messages involving these values
```nu
> sleep 40-sec

# before
Error: nu::parser::parse_mismatch

  × Parse mismatch during operation.
   ╭─[entry #42:1:1]
 1 │ sleep 40-sec
   ·       ──┬──
   ·         ╰── expected duration with valid units
   ╰────

# now
Error:
  × duration value must be a number
   ╭─[entry #41:1:1]
 1 │ sleep 40-sec
   ·       ─┬─
   ·        ╰── not a number
   ╰────
```

3. unifying parsing of these values. now all of these use one function

# User-Facing Changes

filesizes and durations can now have underscores for readability
2023-05-17 18:54:35 -05:00
..
tests improve parsing of values with units (#9190) 2023-05-17 18:54:35 -05:00
command.rs add --ide-ast for a simplistic ast for editors (#8995) 2023-04-28 08:51:51 -05:00
config_files.rs Fix warning on declared config variable that originates from commands (#8891) 2023-04-26 09:21:51 -05:00
ide.rs add --ide-ast for a simplistic ast for editors (#8995) 2023-04-28 08:51:51 -05:00
logger.rs Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
main.rs resolve standard library before ide commands (#9126) 2023-05-07 07:29:15 -05:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs REFACTOR: move the banner from the rust source to the standard library (#8406) 2023-05-10 07:05:01 -05:00
signals.rs Cleanup of src/main.rs (#7801) 2023-01-20 10:44:49 -08:00
terminal.rs Move all functions of main.rs into modules (#7803) 2023-01-20 13:20:38 -08:00
test_bins.rs REFACTOR: move the banner from the rust source to the standard library (#8406) 2023-05-10 07:05:01 -05:00
tests.rs Parameter defaults to $nu.scope.commands (#9152) 2023-05-11 13:59:56 -05:00

Nushell REPL

This directory contains the main Nushell REPL (read eval print loop) as part of the CLI portion of Nushell, which creates the nu binary itself.

Current versions of the nu binary will use the Nu argument parsing logic to parse the commandline arguments passed to nu, leaving the logic here to be a thin layer around what the core libraries.