Skip to content

Disambiguation #235

@stereobooster

Description

@stereobooster

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions