http://qs1969.pair.com?node_id=1153223


in reply to Whitespace-important parsing with Parse::RecDescent (eg. HAML, Python)

Are you aware Text::Haml exists?

https://metacpan.org/pod/Parse::RecDescent::FAQ::Original has some things to say about "whitespace", but you're already using <skip: so maybe you've seen it

I may have been tempted to play with it if the example was self contained :)

  • Comment on Re: Whitespace-important parsing with Parse::RecDescent (eg. HAML, Python)
  • Download Code

Replies are listed 'Best First'.
Re^2: Whitespace-important parsing with Parse::RecDescent (eg. HAML, Python)
by aufflick (Deacon) on Jan 21, 2016 at 02:02 UTC
    And thanks for the FAQ link. I had looked through that and somehow had missed the whitespace example from DC. It makes sense - I didn't want to use a regex but DC seems to suggest that the sort of backtracking needed PRD doesn't support. If I can't make it work I'll gist a self contained example for you to play with :)
Re^2: Whitespace-important parsing with Parse::RecDescent (eg. HAML, Python)
by aufflick (Deacon) on Jan 21, 2016 at 01:59 UTC
    Yes, and in fact I have a few pull requests against it and have been chatting with the author. Ultimately I'd like to write one from scratch though - there are some features missing from Text::HAML (eg. the standard helpers like surround) which will require a lot of refactoring to Text::HAML to implement. At least I'd like to try and see how it goes :)