develooper Front page | perl.perl6.language | Postings from May 2005

Re: comprehensive list of perl6 rule tokens

Thread Previous | Thread Next
From:
Jeff 'japhy' Pinyan
Date:
May 29, 2005 09:52
Subject:
Re: comprehensive list of perl6 rule tokens
Message ID:
Pine.LNX.4.61.0505291249350.18898@perlmonk.org
> On May 26, Patrick R. Michaud said:
>
>> 	<commit>	N	backtracking fails completely
>> 	<cut>		N	remove what matched up to this point from the 
>> string
>> 	<after P>	N	we must be after the pattern P
>> 	<!after P>	N	we must NOT be after the pattern P
>> 	<before P>	N	we must be before the pattern P
>> 	<!before P>	N	we must NOT be before the pattern P
>> 
>> As with ':words', etc., I'm not sure that these qualify as "tokens"
>> when parsing the regex -- the tokens are actually "<" or "<!" and

I'm curious if <commit> and <cut> "capture" anything.  They don't start 
with '?', so following the guidelines, it would appear they capture, but 
that doesn't make sense.  Should they be written as <?commit> and <?cut>, 
or is the fact that they capture silently ignored because they're not 
consuming anything?

Same thing with <null> and <prior>.  And with <after P> and <before P>. 
It should be assumed that <!after P> doesn't capture because it can only 
capture if P matches, in which case <!after P> fails.

So, what's the deal?

-- 
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About