On 24 Jul 2007, at 12:43, Russell Norris wrote:
> I missed the point that the regex was being greedy there. I presume
> the naive suggestion of using non-greedy matching has been tried
> already.
The general problem is more fundamental than that -- finite state
machines (i.e. the programs encoded by regular expressions) lack the
computational power to do unlimited parenthesis balancing -- but
regardless, non-greedy matching will fail whenever parentheses are
nested more than one level deep:
%foo{:bar => { ... }}
Here we'd match the first '{' with the first '}' (which isn't its
partner) so it's just the opposite problem.
I don't know off the top of my head whether people typically use
nested hashes in tags, but in the general case they do.
(A thousand beers to the person who rewrites Haml and Sass to use
Ragel and a real parser.)
Cheers,
-Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---