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

Disambiguation #235

Open
stereobooster opened this issue Jun 30, 2024 · 0 comments
Open

Disambiguation #235

stereobooster opened this issue Jun 30, 2024 · 0 comments

Comments

@stereobooster
Copy link

stereobooster commented Jun 30, 2024

I thought if it is possible to create disambiguation operators, see

And I realized that priority (or precedence) should be possible to express with ordered choice (from PEG):

<E>  = <"("> E <")"> / or / and / id
and  = E <"&"> E
or   = E <"|"> E
id   = #"\w+"

And it gives correct result for insta/parse. But when I use insta/parses (s). It gives me both trees as if I was using | instead of /. There are only two possible trees for a|b&c.

So I wonder why? And wouldn't it be beneficial (for memory/performance) to throw away second tree?

ast

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