Re: [perl #133541] Grammer bug <alnum> vs <alpha>

[email protected] (Brent Laabs) Fri, 28 Sep 2018 02:26:41 -0700
Newsgroups perl.perl6.compiler
Message-ID <CAAPDpByW8kBoiXOdWx_70Brt4U06Ky8UF73mMo1nuUA0exJNJA@mail.gmail.com>
--0000000000005c07c50576eb0e31
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Are you sure about that?  Underscore has been part of the specs (synopses)
for <alpha> for at least 10 years, probably longer.

 >  "_" ~~ /<alpha>/
=EF=BD=A2_=EF=BD=A3
 alpha =3D> =EF=BD=A2_=EF=BD=A3

On Thu, Sep 27, 2018 at 7:52 PM Brandon Allbery <[email protected]> wrote=
:

> "_" 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]=
g>
> 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
>>
>
>
> --
> brandon s allbery kf8nh
> [email protected]
>

--0000000000005c07c50576eb0e31
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Are you sure about that?=C2=A0 Underscore=
 has been part of the specs (synopses) for &lt;alpha&gt; for at least 10 ye=
ars, probably longer.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">=C2=
=A0&gt;=C2=A0 &quot;_&quot; ~~ /&lt;alpha&gt;/<br>=EF=BD=A2_=EF=BD=A3<br>=
=C2=A0alpha =3D&gt; =EF=BD=A2_=EF=BD=A3<br></div></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr">On Thu, Sep 27, 2018 at 7:52 PM Brandon Allbery=
 &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">&quot;_&quot; =
is not an alphabetic character. It&#39;s allowed in &quot;alnum&quot; becau=
se that is by intent what is \w in other regex implementations, which inclu=
des &quot;_&quot;.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On =
Thu, Sep 27, 2018 at 10:47 PM Vijayvithal &lt;<a href=3D"mailto:perl6-bugs-=
[email protected]" target=3D"_blank">[email protected]</a>&gt; w=
rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"># New Ticket Created 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>
# &lt;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> &gt;<br>
<br>
<br>
In the attached code, the only difference between the Grammars G0 and G1<br=
>
is the defination of token &#39;type&#39; it is defined as &lt;alpha&gt; in=
 one case<br>
and as &lt;alnum&gt; in another.<br>
<br>
Since the string being matched is &#39;sc_in&#39; 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 &lt;alnum&gt; 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 &lt;alpha&gt; Example=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<br>
=EF=BD=A2sc_in&lt;foo&gt; bar=EF=BD=A3<br>
ruport =3D&gt; =EF=BD=A2sc_in=EF=BD=A3<br>
type =3D&gt; =EF=BD=A2sc_in=EF=BD=A3<br>
alpha =3D&gt; =EF=BD=A2s=EF=BD=A3<br>
alpha =3D&gt; =EF=BD=A2c=EF=BD=A3<br>
alpha =3D&gt; =EF=BD=A2_=EF=BD=A3<br>
alpha =3D&gt; =EF=BD=A2i=EF=BD=A3<br>
alpha =3D&gt; =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"m_-1020343542952280186gmail_signature" data-smartmail=3D"gmail_si=
gnature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div>brandon s allbery kf8n=
h</div><div><a href=3D"mailto:[email protected]" target=3D"_blank">allber=
[email protected]</a></div></div></div></div></div>
</blockquote></div>

--0000000000005c07c50576eb0e31--