Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #58290] <prior> not implemented in rules in Rakudo

1 view
Skip to first unread message

Carl Mäsak

unread,
Aug 23, 2008, 5:27:10 AM8/23/08
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #58290]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58290 >


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.

Patrick R. Michaud

unread,
Aug 23, 2008, 9:16:43 AM8/23/08
to perl6-c...@perl.org
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

Patrick R. Michaud via RT

unread,
Jun 30, 2009, 10:55:27 PM6/30/09
to perl6-c...@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

Will Coleda via RT

unread,
Oct 21, 2011, 8:54:54 AM10/21/11
to perl6-c...@perl.org
Since this ticket is about a clarification to the specification, it's been
migrated to the spec's issue queue:

https://github.com/perl6/roast/issues/8

--
Will "Coke" Coleda

Will Coleda via RT

unread,
Oct 21, 2011, 8:58:19 AM10/21/11
to perl6-c...@perl.org
Whoops, I meant:

https://github.com/perl6/specs/issues/5

--
Will "Coke" Coleda
0 new messages