in reply to Re: Using Parse::RecDescent to parse Perl-ish strings without resorting to string eval
in thread Using Parse::RecDescent to parse Perl-ish strings without resorting to string eval
Yes, in the original code, there's some fiddling with <skip> (since whitespace has syntactic significance in the grammar), and unescaping of Unicode hex character escapes. I left them out for clarity.
I can probably live with handrolled code that parses its own definition of a double quoted string, since most of the interpolation is unnecessary, but I'm not sure of any way out with regexes: I'd like to be able to do something like:
$text = qr/$text/$modifiers
but $modifiers doesn't interpolate, and I can't think of any easy way to simulate this without having a very large switch statement.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Using Parse::RecDescent to parse Perl-ish strings without resorting to string eval
by ikegami (Patriarch) on Feb 29, 2008 at 20:20 UTC | |
by polypompholyx (Chaplain) on Feb 29, 2008 at 20:25 UTC |