Skip to content

parse error on ;;& #126

@tejing1

Description

@tejing1

The underlying parser doesn't seem to know about the ;;& terminator for case blocks.

I find it useful for compactly representing code like this:

case "$type" in
  *)
    echo do common tasks
    ;;&
  foo)
    echo do foo-specific task
    ;;&
  bar)
    echo do bar-specific task
    ;;&
  *)
    echo do more common tasks
    ;;&
  baz|quux)
    echo do yet more specialized tasks
    ;;&
esac

But trying to run resholve on such code gives:

error: Expected word type Id.KW_Esac, got Id.Op_Amp

For context, here's the shell script I was packaging when I ran into this:
https://github.com/tejing1/nixos-config/blob/98d1d077fac0f62b276b2ee18ace42e619b1e539/file-generation/regenerate-files.sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions