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

Wrong tag associated with expression? #984

Closed
jmandel opened this issue Feb 29, 2024 · 0 comments · Fixed by #985
Closed

Wrong tag associated with expression? #984

jmandel opened this issue Feb 29, 2024 · 0 comments · Fixed by #985
Labels

Comments

@jmandel
Copy link

jmandel commented Feb 29, 2024

Describe the bug
When I use tags with optional expressions, the wrong tag is sometimes assigned to an expression

To Reproduce

Reproduction at https://pest.rs/?g=N4Ig5gTghgtjURALhAUwB4AcIAIC8OwAOgHY44DKA8gJI4B%2Bp5AxFCQMYAWA9hHgBQUAKgEEASgEoA-AxzMAzgFcAZsoCW6PABEqQqU1kBRWqQC%2BpUsPF5iIAFREQ5kjqE3HAOkfOQAGhBqJJiKAC7I9k5AA#editor

  1. Parse * as a expr in the example grammar
expr = {
  SOI ~
  #prefix=(STAR)? ~ #suffix=DOT?
  ~ EOI
}

STAR={"*"}
DOT={"."}

Expected behavior

- expr
  - (#prefix) STAR: "*"
  - EOI: ""

Observed behavior

- expr
  - (#suffix) STAR: "*"
  - EOI: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant