Skip Menu |
Report information
Id: 124018
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bri [at] abrij.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Differing behavior of multi grammar rules with and without "multi"
To: rakudobug [...] perl.org
Date: Sun, 8 Mar 2015 12:22:15 -0400
From: bri <bri [...] abrij.org>
Download (untitled) / with headers
text/plain 922b
In a grammar that uses a proto+parameterized multi, the "multi" is optional according to S05. However, the presence of the "multi" seems to prevent proper operation of this feature under certain circumstances: # perl6 -e 'grammar f { proto token g {*}; token g:h<i> { i* }; token g:h<j> { j* }; proto token l {*}; multi token l:m<n> { n* }; multi token l:m<o> { o* } }; f.parse("i", :rule<g>).say; f.parse("j", :rule<g>).say; f.parse("n", :rule<l>).say; f.parse("o", :rule<l>).say;' 「i」 「j」 「n」 (Any) It seems to work fine in other circumstances. The same as above, but without the quantifiers yields: # perl6 -e 'grammar f { proto token g {*}; token g:h<i> { i }; token g:h<j> { j }; proto token l {*}; multi token l:m<n> { n }; multi token l:m<o> { o } }; f.parse("i", :rule<g>).say; f.parse("j", :rule<g>).say; f.parse("n", :rule<l>).say; f.parse("o", :rule<l>).say;' 「i」 「j」 「n」 「o」
Still reproducible (2017.11, HEAD(5929887)). It does print Nil instead of (Any), but same thing.
On 2015-03-08 09:22:25, bri@abrij.org wrote:
Show quoted text
>
> In a grammar that uses a proto+parameterized multi, the "multi" is
> optional according to S05. However, the presence of the "multi"
> seems to prevent proper operation of this feature under certain
> circumstances:
>
> # perl6 -e 'grammar f { proto token g {*}; token g:h<i> { i* }; token
> g:h<j> { j* }; proto token l {*}; multi token l:m<n> { n* }; multi
> token l:m<o> { o* } }; f.parse("i", :rule<g>).say; f.parse("j",
> :rule<g>).say; f.parse("n", :rule<l>).say; f.parse("o",
> :rule<l>).say;'
> 「i」
> 「j」
> 「n」
> (Any)
>
> It seems to work fine in other circumstances. The same as above, but
> without the quantifiers yields:
>
> # perl6 -e 'grammar f { proto token g {*}; token g:h<i> { i }; token
> g:h<j> { j }; proto token l {*}; multi token l:m<n> { n }; multi token
> l:m<o> { o } }; f.parse("i", :rule<g>).say; f.parse("j",
> :rule<g>).say; f.parse("n", :rule<l>).say; f.parse("o",
> :rule<l>).say;'
> 「i」
> 「j」
> 「n」
> 「o」




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org