Closed p6rt closed 14 years ago
The attached patch adds support for variable and block-result interpolation into regexes.
It does so by means of a new PAST::Regex node pasttype 'interpolator'.
The following syntaxes are supported by this patch:
/ $var / -- Interpolates as literal string, unless it's a Regex object
/ @foo / -- Interpolated as ||-style alternations of literal strings
or Regex objects
/ \<$var> / -- compiled into a Regex (unless it's already one), then
interpolated
/ \<@foo> / -- A list of ||-style alternations of things to be
compiled into Regexes (unless they already are)
/ \<{ ... }> / -- Result of capture is interpolated as a Regex,
compiling if necessary
/ \<?{ ... }> / -- Unchanged
/ { ... } / -- Capture is merely executed, but not interpolated.
(Unchanged)
On Sun, Mar 28, 2010 at 10:01:42PM -0700, Bruce Keeler wrote:
The attached patch adds support for variable and block-result interpolation into regexes.
The patch is a very good start, but please don't apply it yet. I've only had a chance to do a preliminary review, but there are a few areas that need changing before the patch gets applied (otherwise we start painting ourselves into corners that may be difficult to get out of).
I'm finally back at home again, so I expect to be able to do some of this review and updating in the next couple of days.
Pm
The RT System itself - Status changed from 'new' to 'open'
A variant of this patch has been applied; and it's amply tested. I'm closing this ticket now.
Thanks for your patch!
@moritz - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#73862 (status was 'resolved')
Searchable as RT73862$