Re: generating grammars, capturing in regex interpolation, etc.

2015-04-20 Thread Nathan Gray
Am 17.04.2015 um 04:34 schrieb Nathan Gray: # Call it if it is a routine. This will capture if requested. return (var)(self) if nqp::istype(var,Callable); This seems to indicate that captures in the embedded regexes should capture. On Fri, Apr 17, 2015 at 09:47:22AM +0200, Tobias

Re: generating grammars, capturing in regex interpolation, etc.

2015-04-17 Thread Tobias Leich
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The comment in INTERPOLATE is about subcaptures... but if you do not capture the interpolated regex itself, you break that chain. Am 17.04.2015 um 04:34 schrieb Nathan Gray: On Wed, Apr 15, 2015 at 09:45:39PM -0400, Nathan Gray wrote: I had given

Re: generating grammars, capturing in regex interpolation, etc.

2015-04-16 Thread Nathan Gray
On Wed, Apr 15, 2015 at 09:45:39PM -0400, Nathan Gray wrote: I had given up on using regexes embedded within regexes, because I could not get capturing to work. I did a backtrace on one of the test cases that fails, which led me to src/core/Cursor.pm in method INTERPOLATE(\var, $i = 0,

Re: generating grammars, capturing in regex interpolation, etc.

2015-04-15 Thread Nathan Gray
On Tue, Apr 14, 2015 at 08:58:29PM -0500, Patrick R. Michaud wrote: Just an idea: instead of building strings to be interpolated into a regex, could you just build regexes directly? my $pattern = rx/$greeting=[hello]/; my $match = hello ~~ / pattern=$pattern /; The resulting

Re: generating grammars, capturing in regex interpolation, etc.

2015-04-14 Thread Patrick R. Michaud
On Tue, Apr 14, 2015 at 08:58:27PM -0400, Nathan Gray wrote: I've run into a snag, in that my strptime processing in Perl 5 relies on building a string that looks like a regex with named captures, and then interpolating that into a real regex. [...] my $pattern = Q/$greeting=[hello]/;