Skip to content

Backtick strings cannot contain non-whitespace characters followed by = (?!) #6853

@webbedspace

Description

@webbedspace

Describe the bug

It seems that adding = to certain backtick strings causes them to no longer be parsed correctly. I pored over a few commits related to backtick strings, but I still don't understand what the heck is up with this.

How to reproduce

C:\Coding\nushell.github.io〉`=`
Error: nu::parser::unknown_command (link)

  × Unknown command.
   ╭─[entry #306:1:1]
 1 │ `=`
   · ─┬─
   ·  ╰── unknown command
   ╰────

C:\Coding\nushell.github.io〉`a=`
Error: nu::parser::unknown_command (link)

  × Unknown command.
   ╭─[entry #307:1:1]
 1 │ `a=`
   · ──┬─
   ·   ╰── unknown command
   ╰────

C:\Coding\nushell.github.io〉` =`
 =
C:\Coding\nushell.github.io〉`\=`
Error: nu::parser::unknown_command (link)

  × Unknown command.
   ╭─[entry #309:1:1]
 1 │ `\=`
   · ──┬─
   ·   ╰── unknown command
   ╰────

Expected behavior

Why do backtick strings have this strange exception? To me, they should just work as alternatives to single-quote strings.

Screenshots

No response

Configuration

key value
version 0.70.0
branch
commit_hash 9ef65dc
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.64.0 (a55dd71d5 2022-09-19)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.64.0 (387270bc7 2022-09-16)
pkg_version 0.70.0
build_time 2022-10-18 18:55:02 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:parserIssues related to parsing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions