Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differing behavior of multi grammar rules with and without "multi" #3724

Open
p6rt opened this issue Mar 8, 2015 · 3 comments
Open

Differing behavior of multi grammar rules with and without "multi" #3724

p6rt opened this issue Mar 8, 2015 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Mar 8, 2015

Migrated from rt.perl.org#124018 (status was 'open')

Searchable as RT124018$

@p6rt
Copy link
Author

p6rt commented Mar 8, 2015

From @skids

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」

@p6rt
Copy link
Author

p6rt commented Dec 1, 2017

From @AlexDaniel

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​:

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」

@p6rt
Copy link
Author

p6rt commented Dec 1, 2017

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant