On Tue, 24 Jan 2017 22:58:44 -0800, comdog wrote:
> This program consistently segfaults for me:
> 
>     grammar Grammar::Foo {
>         rule TOP {
>             'z' | <unicode_escape>
>             }
>         token unicode_escape { '\\u' :i <[0..9a..f]> ** 4 }
>         }
> 
>     my $res = Grammar::Foo.parse( '\u2603' );
> 
> 
> This one blows up and writes a bunch of long hex numbers to the terminal:
> 
>     grammar Grammar::Foo {
>         rule TOP {
>             'z' | <unicode_escape>
>             }
>         token unicode_escape { 'u' :i <[0..9a..f]> ** 4 }
>         }
> 
>     my $res = Grammar::Foo.parse( 'u2603' );
> 
> I stripped this down from a much larger thing I was working on, and
> if I remove anything else I don't have the problem.
> 
> 
> And, some details:
> 
>     $ perl6 -v
>     This is Rakudo version 2016.11 built on MoarVM version 2016.11
>     implementing Perl 6.c.
>     $ uname -a
>     Darwin macpro.local 14.5.0 Darwin Kernel Version 14.5.0

It golfs further still, it seems. This one also blows up:

grammar Grammar::Foo {
    token TOP {
        'z' | :i <[0..9]> ** 4
    }
}   
my $res = Grammar::Foo.parse( '2603' );

And is fixed by the removal of the :i, so that's likely playing a role. Will 
dig further.

Reply via email to