I like it.

What happens if two matches have the same precedence?
Do you need to specify the precedence explicitly?

...or could it be applied by the order the matches are mentioned.

ie:
rule(:expression) { infix_expression(integer,
       [mul_op, :left],
       [add_op, :right]) }

will match mul_op before add_op.



---
"No man is an island... except Philip"


On Fri, Jun 21, 2013 at 12:04 AM, Jonathan Rochkind <[email protected]>wrote:

> PS: This is super useful convenience, thank you!
>
> On 6/20/2013 8:15 AM, Kaspar Schiess wrote:
> >> I like the idea; I'm having trouble understanding exacty what the
> infix_expression method does, how it's used, what the arguments are.  Even
> with the example.
> >
> > I suppose you've looked at the code documentation?
> >
> https://github.com/kschiess/parslet/blob/master/lib/parslet.rb#L203-L229
> >
> > It's rather hard to explain without explaining infix expressions at the
> > same time, which seems redundant given the amount of explanations on the
> > subject. This is a good starting point:
> >       https://en.wikipedia.org/wiki/Infix_notation
> >
> > Do you have a specific question and/or problem?
> >
> > regards,
> > kaspar
> >
> >
>

Reply via email to