On Mon, 2009-09-21 at 14:56 -0700, Luke Kanies wrote: > How does not allowing carriage returns in regexes solve the problem? > I would think that phrase would still lex incorrectly, since there's > no return in it.
To my surprise, and I don't know why, this particular regex is matching \n. So this hot-fix only fixes this corner case, and we need a proper fix for 0.25.2. Markus gave a few ideas in the ticket. > Would it be reasonable to have regexes not be recognized when > surrounded by numbers? As you say, this breaks out of the LALR a bit, > but it's at least straightforward to say something like, "if the > previous token was a number, then this can't be a regex" in the lexer, > right? That's not enough: $var = $value / $divisor / $otherdivisor will still match. We need something that says: parse regex only in some contextes. But we can't infer the contexts from the current parser context since it works the other way around. So we need to instruct the lexer when it is possible to encounter a regex and when it is not. It is kludgly. -- Brice Figureau Follow the latest Puppet Community evolutions on www.planetpuppet.org! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" 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/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
