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

Longest prefix in || alterations not to spec in Rakudo #4398

Closed
p6rt opened this issue Jul 13, 2015 · 4 comments
Closed

Longest prefix in || alterations not to spec in Rakudo #4398

p6rt opened this issue Jul 13, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 13, 2015

Migrated from rt.perl.org#125608 (status was 'resolved')

Searchable as RT125608$

@p6rt
Copy link
Author

p6rt commented Jul 13, 2015

From @masak

<hoelzro> when determining the longest literal prefix for a rule, I
see that | alternation variants can extend the literal prefix. Does
the same apply for ||?
<masak> no.
<hoelzro> thanks masak
<jnthn> Yeah, hitting a sequential alternation marks the end of the
declarative prefix.
<jnthn> (just checked that's exactly what happens in the code)
<hoelzro> I saw the behavior, just checking to see that it made sense
spec-wise =)
<jnthn> aye, I believe so
<FROGGS> 'think so too fwiw
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' || 'doof')/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»
<TimToady> hmm, STD would've picked 'food' there
<FROGGS> ò.ó
<TimToady> it counts the first part of the || as declarative
<jnthn> TimToady​: Declarative but optional, I presume?
<TimToady> it counts the 'food' as part of LTM, iirc
<TimToady> on the assumption that most || are just error throws
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' <!> || 'doof')/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»
<masak> TimToady​: well, does that have any support in S05? otherwise
S05 should probably mention that...
<TimToady> masak​: depends on how you read it...it says that LTM is
terminated by a ||
<TimToady> masak​: actually, it's explicitly required at S05​:2885
<TimToady> so this is a bug, by that
* masak submits rakudobug
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' <!> || die "Should die here")/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»

@p6rt
Copy link
Author

p6rt commented Jul 15, 2015

From @jnthn

On Mon Jul 13 13​:19​:15 2015, masak wrote​:

<hoelzro> when determining the longest literal prefix for a rule, I
see that | alternation variants can extend the literal prefix. Does
the same apply for ||?
<masak> no.
<hoelzro> thanks masak
<jnthn> Yeah, hitting a sequential alternation marks the end of the
declarative prefix.
<jnthn> (just checked that's exactly what happens in the code)
<hoelzro> I saw the behavior, just checking to see that it made sense
spec-wise =)
<jnthn> aye, I believe so
<FROGGS> 'think so too fwiw
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' || 'doof')/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»
<TimToady> hmm, STD would've picked 'food' there
<FROGGS> ò.ó
<TimToady> it counts the first part of the || as declarative
<jnthn> TimToady​: Declarative but optional, I presume?
<TimToady> it counts the 'food' as part of LTM, iirc
<TimToady> on the assumption that most || are just error throws
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' <!> || 'doof')/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»
<masak> TimToady​: well, does that have any support in S05? otherwise
S05 should probably mention that...
<TimToady> masak​: depends on how you read it...it says that LTM is
terminated by a ||
<TimToady> masak​: actually, it's explicitly required at S05​:2885
<TimToady> so this is a bug, by that
* masak submits rakudobug
<TimToady> m​: say 'food' ~~ / 'foo' | ('food' <!> || die "Should die here")/
<camelia> rakudo-moar 533d1a​: OUTPUT«「foo」␤»

Fixed, and tested in S05-metasyntax/longest-alternative.t.

@p6rt
Copy link
Author

p6rt commented Jul 15, 2015

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

@p6rt p6rt closed this as completed Jul 15, 2015
@p6rt
Copy link
Author

p6rt commented Jul 15, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant