Skip to content

use of parse-help throws nu::parser::expected_keyword #586

Open

Description

@selfagency

this:

use ~/Developer/nu_scripts/custom-completions/auto-generate/parse-fish.nu

throws this:

Error: nu::parser::expected_keyword

  × Expected keyword.
    ╭─[/Users/daniel/Developer/nu_scripts/custom-completions/auto-generate/parse-fish.nu:86:1]
 86 │ 
 87 │ let quote = '"' # "
    · ─┬─
    ·  ╰── expected def, const, def-env, extern, extern-wrapped, alias, use, module, export or export-env keyword
 88 │ 
    ╰────

Activity

  1. horasal commented on Aug 31, 2023

    @horasal

    Could you try source prase-fish.nu?

    Code containing non-function can only be used source but not use, I think?

    It may be a good idea to make quote a function like

    def quote [] {
        '"' # "
    }
    
  2. LoicRiegel commented on Aug 26, 2024

    @LoicRiegel
    Contributor

    source parse-fish.nu does not raise an error on my side. The error is there when using use.

    I just tried quickly to replace let quote = '"' # " by const quote = '"' # " and then it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions