Skip to content

Failed parsing compound operator without brackets in function body. #239

Closed

Description

@asumbek

In Bash, you can have anything listed in compound operators as function body, including [[ ... ]], ((...)), if ...; then ...; fi, etc. But the parser failed to parse those.

For example:

is_foo() [[ "$1" = foo ]] # The parser failed in here because there's no brackets.
assert()
  if ! $1; then # Failed here because there's no brackets and the parser expected one.
    echo "${2:-assertion failed}" >&2
    return 1
  fi

Activity

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