# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #117067]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117067 >


<colomon> loliblogged:
http://justrakudoit.wordpress.com/2013/03/06/philosophical-issues-with-rakudos-parse/
<colomon> parse already does ^ by default on both Rakudo and Niecza.
<colomon> and TOP is sort of the least interesting case
<masak> colomon++ # blag
<masak> colomon: IMNSHO, .parse (and .parsefile) should auto-anchor
the ends of the string.
* colomon hopes that's Humble and not Honest.  ;)
<masak> yeah :)
<masak> colomon: what I *don't* know is whether it should be that way
becuase (a) .parse contains some magic or (b) TOP contains some magic.
<masak> and honestly/humbly, I can't say I see the repercussions of it.
<masak> but hey, that's what the spectest suite is for, neh? :)
<colomon> masak: the thing is, as often as not I'm not parsing against TOP
<colomon> and I still always want auto-anchoring
* colomon is not sure if he has ever used TOP, actually.
<colomon> For instance, the ABC grammar has two rules that abc2ly
parses against: tune_file (which would be TOP if I had TOP, I guess)
and key.   It would also be very reasonable to parse against tune.
<colomon> And for testing purposes I directly parse against many of the rules.
<masak> colomon: then I suggest the default of .parse be "anchor both
ends of string", no matter what :rule. and there should be a :substr
(modulo name bikeshedding) option.
<colomon> masak: That would be my preference as well.  (:partial maybe?)
<masak> yeah, I was sniffing around in the vicinity of :part, too.
<masak> :anywhere
<masak> :unanchored
<pmichaud> I think that the default of .parse is currently "anchor one
end of string", since that's what normally happens with a subrule
match.
<masak> rn: grammar G { regex TOP { 'ab' } }; say so G.parse("abc")
<p6eval> niecza v24-28-g2a7e0fd: OUTPUT«False␤»
<p6eval> ..rakudo fec64a: OUTPUT«True␤»
<masak> :)
* masak , fwiw, is with Niecza
<arnsholt> I'd agree with .parse requiring a match from 0 to the end
of the input
* masak submits rakuodbug

Reply via email to