On 16.05.11 05:04, Jason Garber wrote:
> Am I doing it wrong? Do you have suggestions for doing what I want to do
> within the existing confines of Parslet::Transform and yet avoid smelly
> code?

Hei Jason,

Maybe you'd like to check out the parslet master, it features transforms 
that you can inject variables into.

Like

   transform.apply(tree, :doc => MyDoc.new)

Your helper methods would then be in the doc object. The rule would then 
look like

   rule(...) { doc.do_something_or_other(...) }

This will be released soonish, but I'll first fix the m10n issue I am 
having, and its a tough one.

regards,
kaspar


Reply via email to