Skip to content

Loading…

define meaning of <prior> in S05 #8

Closed
coke opened this Issue · 1 comment

1 participant

@coke

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

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

/ <prior> /

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 ~~ / <prior> /'
# 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] <prior> not implemented in rules in Rakudo
Date:   Sat, 23 Aug 2008 08:16:43 -0500
To: perl6-compiler@perl.org
From:   "Patrick R. Michaud" <pmichaud@pobox.com>
On Sat, Aug 23, 2008 at 02:27:10AM -0700, Carl M?sak wrote:
> To match whatever the prior successful regex matched, use:
> 
> / <prior> /
> 
> 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 ~~ / <prior> /'
> # 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<< <prior> >> is not yet implemented. I'm not
certain if it belongs in PGE or in Rakudo... I'm guessing that
<prior> 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

/ <foo> <prior> /

it's pretty clear that C<< <foo> >> is the prior successful regex 
matched, and I think that's not what is intended by C<< <prior> >>.
(If it is what is intended, then C<< <prior> >> 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 <prior> in regexes.

Pm
@coke

whoops, moved to perl6/specs#5

@coke coke closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.