Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semicolon causes ERROR in Parameter Expansion #267

Open
jbdyn opened this issue Jun 24, 2024 · 0 comments
Open

Semicolon causes ERROR in Parameter Expansion #267

jbdyn opened this issue Jun 24, 2024 · 0 comments

Comments

@jbdyn
Copy link

jbdyn commented Jun 24, 2024

Hi!

First of all, thank you all for your amazing work and precious time. ❤️

When using a semicolon ; in a parameter expansion, it causes a parsing ERROR, although it should not:

From playground :

Example 1

In:

${a:+$a;}

Out:

program [0, 0] - [1, 0]
  ERROR [0, 0] - [0, 9]
    variable_name [0, 2] - [0, 3]
    simple_expansion [0, 5] - [0, 7]
      variable_name [0, 6] - [0, 7]

Example 2

In (note the space after ;:

${a:+$a; }

Out:

program [0, 0] - [1, 0]
  command [0, 0] - [0, 10]
    name: command_name [0, 0] - [0, 10]
      expansion [0, 0] - [0, 10]
        variable_name [0, 2] - [0, 3]
        concatenation [0, 5] - [0, 9]
          simple_expansion [0, 5] - [0, 7]
            variable_name [0, 6] - [0, 7]
          ERROR [0, 7] - [0, 8]
          word [0, 8] - [0, 9]

The error occurs also when ; is not the last character in the default word.
When ; is a prefix or suffix pattern, it seems to be fine.

@jbdyn jbdyn changed the title Semicolon causes ERROR in Paramter Expansion Semicolon causes ERROR in Parameter Expansion Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant