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

Escaped parentheses inside test expression cause error #269

Open
SalBakraa opened this issue Jul 21, 2024 · 0 comments
Open

Escaped parentheses inside test expression cause error #269

SalBakraa opened this issue Jul 21, 2024 · 0 comments

Comments

@SalBakraa
Copy link

[ \( 'aaa' = 'bbb' \) -o \( 'ccc' = 'ccc' \) ] is parsed incorrectly as:

ERROR [0, 0] - [0, 46]
  command [0, 2] - [0, 46]
    name: command_name [0, 2] - [0, 4]
      word [0, 2] - [0, 4]
    argument: raw_string [0, 5] - [0, 10]
    argument: word [0, 11] - [0, 12]
    argument: raw_string [0, 13] - [0, 18]
    argument: word [0, 19] - [0, 21]
    argument: word [0, 22] - [0, 24]
    argument: word [0, 25] - [0, 27]
    argument: raw_string [0, 28] - [0, 33]
    argument: word [0, 34] - [0, 35]
    argument: raw_string [0, 36] - [0, 41]
    argument: word [0, 42] - [0, 44]
    argument: word [0, 45] - [0, 46]

on the other hand [ ( 'aaa' = 'bbb' ) -o ( 'ccc' = 'ccc' ) ] generates the correct parse tree:

test_command [0, 0] - [0, 42]
  binary_expression [0, 2] - [0, 40]
    left: parenthesized_expression [0, 2] - [0, 19]
      binary_expression [0, 4] - [0, 17]
        left: raw_string [0, 4] - [0, 9]
        right: raw_string [0, 12] - [0, 17]
    operator: test_operator [0, 20] - [0, 22]
    right: parenthesized_expression [0, 23] - [0, 40]
      binary_expression [0, 25] - [0, 38]
        left: raw_string [0, 25] - [0, 30]
        right: raw_string [0, 33] - [0, 38]

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