Solomon
234484b6f8
normalize special characters in module names to allow variable access (#14353)
Fixes #14252
# User-Facing Changes
- Special characters in module names are replaced with underscores when
importing constants, preventing "expected valid variable name":
```nushell
> module foo-bar { export const baz = 1 }
> use foo-bar
> $foo_bar.baz
```
- "expected valid variable name" errors now include a suggestion list:
```nushell
> module foo-bar { export const baz = 1 }
> use foo-bar
> $foo-bar
Error: nu::parser::parse_mismatch_with_did_you_mean
× Parse mismatch during operation.
╭─[entry #1:1:1]
1 │ $foo-bar;
· ────┬───
· ╰── expected valid variable name. Did you mean '$foo_bar'?
╰────
```
2024-12-05 21:35:15 +08:00
..
2024-05-13 13:37:53 +00:00
2024-08-22 21:22:10 +02:00
2024-05-13 13:37:53 +00:00
2024-05-13 13:37:53 +00:00
2024-05-13 13:37:53 +00:00
2024-11-27 13:52:47 +08:00
2024-10-11 18:40:32 +02:00
2024-05-13 13:37:53 +00:00
2024-10-20 23:12:57 +02:00
2024-07-25 18:28:44 +08:00
2024-05-13 13:37:53 +00:00
2024-10-05 15:19:26 +02:00
2024-05-13 13:37:53 +00:00
2024-05-13 13:37:53 +00:00
2024-05-13 13:37:53 +00:00
2024-07-21 01:32:36 -07:00
2024-08-22 11:54:27 +02:00
2024-12-05 21:35:15 +08:00
2024-10-11 07:53:39 -05:00
2024-10-22 10:34:41 -05:00
2024-05-13 13:37:53 +00:00
2024-11-06 07:36:56 -06:00
2024-11-02 10:28:10 -05:00
2024-10-03 06:28:22 -05:00
2024-06-28 09:47:12 +08:00
2024-05-13 13:37:53 +00:00
2024-11-23 13:42:00 -08:00
2024-05-13 13:37:53 +00:00