perl6/roast — Issue #8: define meaning of <prior> in S05
Author: coke
Created: 2011-10-21 12:54:09+00:00
State: open

Originally opened as https://rt.perl.org/rt3/Ticket/Display.html?id=58290

Subject:	not implemented in rules in Rakudo
Date:	Sat, 23 Aug 2008 11:26:49 +0200
To:	rakudobug@perl.org
From:	"Carl M?sak"
To match whatever the prior successful regex matched, use:

/ /

r30466:
$ ./perl6 -e 'my $s = "hello"; say $s ~~ /ll/; say $s ~~ /ll/' # works
ll
ll
$ ./perl6 -e 'my $s = "hello"; say $s ~~ /ll/; say $s ~~ / /'
# not implemented
ll
Unable to find regex 'prior'
Null PMC access in invoke()
[...]

This feature request is perhaps more accurately classified as
pertaining to PGE. Please re-tag as needed.

Subject:	Re: [perl #58290] not implemented in rules in Rakudo
Date:	Sat, 23 Aug 2008 08:16:43 -0500
To:	perl6-compiler@perl.org
From:	"Patrick R. Michaud"
On Sat, Aug 23, 2008 at 02:27:10AM -0700, Carl M?sak wrote:
> To match whatever the prior successful regex matched, use:
>
> / /
>
> r30466:
> $ ./perl6 -e 'my $s = "hello"; say $s ~~ /ll/; say $s ~~ /ll/' # works
> ll
> ll
> $ ./perl6 -e 'my $s = "hello"; say $s ~~ /ll/; say $s ~~ / /'
> # not implemented
> ll
> Unable to find regex 'prior'
> Null PMC access in invoke()
> [...]
>
> This feature request is perhaps more accurately classified as
> pertaining to PGE. Please re-tag as needed.

...correct -- C<< >> is not yet implemented. I'm not
certain if it belongs in PGE or in Rakudo... I'm guessing that
needs to refer to the "prior successful regex" in a
statement-level context, as opposed to a regex context. For
example, if we interpret S05 literally then in the regex

/ /

it's pretty clear that C<< >> is the prior successful regex
matched, and I think that's not what is intended by C<< >>.
(If it is what is intended, then C<< >> becomes much
simpler. :-)

Pm

RT-Send-CC:	perl6-compiler@perl.org

I've changed this ticket to indicate that it's waiting on spec
clarification as to the exact meaning of in regexes.

Pm