Re: [perl #133541] Grammer bug <alnum> vs <alpha>
[email protected] (Brandon Allbery) Thu, 27 Sep 2018 22:52:06 -0400
| Newsgroups | perl.perl6.compiler |
|---|---|
| Message-ID | <CAKFCL4UVWb7tH=cOohnA_xCwH9ptPwqsPhUwz+cC3OSFsygPbA@mail.gmail.com> |
--000000000000407ac70576e58be6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable "_" is not an alphabetic character. It's allowed in "alnum" because that is by intent what is \w in other regex implementations, which includes "_". On Thu, Sep 27, 2018 at 10:47 PM Vijayvithal <[email protected]> wrote: > # New Ticket Created by Vijayvithal > # Please include the string: [perl #133541] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=3D133541 > > > > In the attached code, the only difference between the Grammars G0 and G1 > is the defination of token 'type' it is defined as <alpha> in one case > and as <alnum> in another. > > Since the string being matched is 'sc_in' both the alpha and alnum > tokens should have captured it. But we see the following result on > execution > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <alnum> Example=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > Nil > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <alpha> Example=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > =EF=BD=A2sc_in<foo> bar=EF=BD=A3 > ruport =3D> =EF=BD=A2sc_in=EF=BD=A3 > type =3D> =EF=BD=A2sc_in=EF=BD=A3 > alpha =3D> =EF=BD=A2s=EF=BD=A3 > alpha =3D> =EF=BD=A2c=EF=BD=A3 > alpha =3D> =EF=BD=A2_=EF=BD=A3 > alpha =3D> =EF=BD=A2i=EF=BD=A3 > alpha =3D> =EF=BD=A2n=EF=BD=A3 > > > Perl Version is > > This is Rakudo Star version 2018.06 built on MoarVM version 2018.06 > implementing Perl 6.c. > > > > -- > Vijayvithal > Dyumnin Semiconductors > --=20 brandon s allbery kf8nh [email protected] --000000000000407ac70576e58be6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">"_" is not an alphabetic character. It's all= owed in "alnum" because that is by intent what is \w in other reg= ex implementations, which includes "_".</div><br><div class=3D"gm= ail_quote"><div dir=3D"ltr">On Thu, Sep 27, 2018 at 10:47 PM Vijayvithal &l= t;<a href=3D"mailto:[email protected]">perl6-bugs-followup@perl.= org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"marg= in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># New Ticket Cre= ated by=C2=A0 Vijayvithal <br> # Please include the string:=C2=A0 [perl #133541]<br> # in the subject line of all future correspondence about this issue. <br> # <URL: <a href=3D"https://rt.perl.org/Ticket/Display.html?id=3D133541" = rel=3D"noreferrer" target=3D"_blank">https://rt.perl.org/Ticket/Display.htm= l?id=3D133541</a> ><br> <br> <br> In the attached code, the only difference between the Grammars G0 and G1<br= > is the defination of token 'type' it is defined as <alpha> in= one case<br> and as <alnum> in another.<br> <br> Since the string being matched is 'sc_in' both the alpha and alnum<= br> tokens should have captured it. But we see the following result on<br> execution<br> <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <alnum> Example=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D<br> Nil<br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <alpha> Example=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D<br> =EF=BD=A2sc_in<foo> bar=EF=BD=A3<br> ruport =3D> =EF=BD=A2sc_in=EF=BD=A3<br> type =3D> =EF=BD=A2sc_in=EF=BD=A3<br> alpha =3D> =EF=BD=A2s=EF=BD=A3<br> alpha =3D> =EF=BD=A2c=EF=BD=A3<br> alpha =3D> =EF=BD=A2_=EF=BD=A3<br> alpha =3D> =EF=BD=A2i=EF=BD=A3<br> alpha =3D> =EF=BD=A2n=EF=BD=A3<br> <br> <br> Perl Version is <br> <br> This is Rakudo Star version 2018.06 built on MoarVM version 2018.06<br> implementing Perl 6.c.<br> <br> <br> <br> -- <br> Vijayvithal<br> Dyumnin Semiconductors<br> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l= tr"><div><div dir=3D"ltr"><div>brandon s allbery kf8nh</div><div><a href=3D= "mailto:[email protected]" target=3D"_blank">[email protected]</a></div= ></div></div></div></div> --000000000000407ac70576e58be6--