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.
________________________________________
From: [email protected] [[email protected]] on behalf of
Kaspar Schiess [[email protected]]
Sent: Thursday, June 20, 2013 5:41 AM
To: [email protected]
Subject: [ruby.parslet] Infix Expressions
Hi everyone,
I've implemented a new parslet atom, called 'infix_expression'. It
allows you to very rapidly implement the infix expression parser we all
struggle with routinely! Here's a quick byte:
rule(:expression) { infix_expression(integer,
[mul_op, 2, :left],
[add_op, 1, :right]) }
For the main dish, please look at [1].
Comments & Critique are welcome!
kaspar
[1] https://github.com/kschiess/parslet/blob/master/example/prec_calc.rb