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

The rule to match routines/symbols is overriding the rule to match versions, because of LTM #2992

Closed
p6rt opened this issue Dec 7, 2012 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 7, 2012

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

Searchable as RT116016$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2012

From cedric.vincent@gmail.com

http://irclog.perlgeek.de/perl6/2012-11-27#i_6190391

<supernovus> r​: v10
<p6eval> rakudo e6e158​: OUTPUT«===SORRY!===␤CHECK FAILED​:␤Undefined
routine '&v10' called (line 1)␤»
<supernovus> std​: v10
<p6eval> std a8bc48f​: OUTPUT«===[0mSORRY!===[0mâ�¤Undeclared
routine​:â�¤ 'v10' used at line 1â�¤Check failedâ�¤FAILED 00​:00
41m�»
<supernovus> The rule to match routines/symbols is overriding the rule
to match versions.
  I guess just use Version.new('10.0') for now for any major version over 10.
<jnthn> Probably because LTM
<masak> oh, 'course.
  that makes 100% sense.

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @masak

<pmichaud> I'm pretty sure Perl 6 defines a Version type :-)
<pmichaud> m​: say v6.0.0.WHAT
<camelia> rakudo-moar d3a284​: OUTPUT«(Version)␤»
<pmichaud> maybe we should use it. :)
<lizmat> ok, how do we *compare* the version in blead sensibly ?
<FROGGS> lizmat​: you can compare versions, on?
<pmichaud> m​: say v6.0.0 after v5.9.9
<camelia> rakudo-moar d3a284​: OUTPUT«True␤»
<lizmat> m​: say $*VM.version
<camelia> rakudo-moar d3a284​: OUTPUT«v2014.9.14.g.0.df.2.d.6.f␤»
<FROGGS> m​: say $*VM.version cmp v2014.10
<camelia> rakudo-moar d3a284​: OUTPUT«===SORRY!=== Error while
compiling /tmp/gKuhEGsVtz␤Missing semicolon.␤at
/tmp/gKuhEGsVtz​:1␤------> say $*VM.version cmp v2014.⏏10 [...]
<pmichaud> m​: say $*VM.version after v2014.10
<camelia> rakudo-moar d3a284​: OUTPUT«===SORRY!=== Error while
compiling /tmp/ZvfwZtMgab␤Missing semicolon.␤at
/tmp/ZvfwZtMgab​:1␤------> say $*VM.version after v2014.⏏10 [...]
<FROGGS> m​: say $*VM.version cmp v2014.10.0
<camelia> rakudo-moar d3a284​: OUTPUT«===SORRY!=== Error while
compiling /tmp/H7htjAkmA4␤Missing semicolon.␤at
/tmp/H7htjAkmA4​:1␤------> say $*VM.version cmp v2014.⏏10.0 [...]
<FROGGS> ?
<lizmat> yuck?
<pmichaud> m​: say $*VM.version.WHAT
<camelia> rakudo-moar d3a284​: OUTPUT«(Version)␤»
<FROGGS> m​: say $*VM.version cmp Version.new('2014.10')
<camelia> rakudo-moar d3a284​: OUTPUT«Less␤»
<FROGGS> m​: say $*VM.version cmp Version.new('2014.09')
<camelia> rakudo-moar d3a284​: OUTPUT«More␤»
<pmichaud> m​: say $*VM.version after v2014.10
<camelia> rakudo-moar d3a284​: OUTPUT«===SORRY!=== Error while
compiling /tmp/7wAWLodWxu␤Missing semicolon.␤at
/tmp/7wAWLodWxu​:1␤------> say $*VM.version after v2014.⏏10 [...]
<FROGGS> that's weird
<pmichaud> feels like a rakudobug
* masak submits rakuodbug
<lizmat> that's looks like a parsing issue
<FROGGS> m​: say v1.2
<camelia> rakudo-moar d3a284​: OUTPUT«v1.2␤»
<FROGGS> m​: say v10.2
<camelia> rakudo-moar d3a284​: OUTPUT«===SORRY!=== Error while
compiling /tmp/WHm04xB1jm␤Missing semicolon.␤at
/tmp/WHm04xB1jm​:1␤------> say v10.⏏2 [...]
<FROGGS> only one digit allowed??
<FROGGS> /o\ we are doomed
<FROGGS> std has 'v' <?before \d> :​: <vnum> +% '.' '+'?, and we miss the :​:

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @masak

<pmichaud> std​: say v2013.4.5
<camelia> std fc92e1e​: OUTPUT«===SORRY!===␤Confused at /tmp/W0MHCqFo4M line 1​:␤------> say v2013.⏏4.5 [...]
<pmichaud> aha
<lizmat> :-)
<pmichaud> looks like STD and Rakudo agree here about multi-digit version numbers
<masak> I recognize this failure mode.
<masak> we've encountered it before
<pmichaud> it's a longest-token-matching issue
<masak> (not just earlier today)
<masak> I bet there is an RT ticket with it somewhere
* masak goes hunting for it
<pmichaud> I suspect that v123.10 ends up with "v123" as identifier over 'v1'
<masak> *nod*
<pmichaud> because the grammar rule is
<pmichaud> token version​:sym<v> {
<pmichaud> 'v' <?before \d> :​: <vnum> +% '.' '+'?
<pmichaud> }
<pmichaud> which means LTM stops at the :​:
<masak> https://rt-archive.perl.org/perl6/Ticket/Display.html?id=116016
<masak> is that one related?
<masak> it's from 2012
<pmichaud> yes, it looks exactly the same
* masak merges the two tickets
<pmichaud> I wonder why we need the <?before \d> :​: part
<pmichaud> well, <?before \d> is guarding against "v*.3.4" as a version identifier
<pmichaud> I wonder what happens if we get rid of the '​::'
<FROGGS> and the :​: commits to that token, no?
<FROGGS> so it won't try other rules, at least in theory
<pmichaud> no
<pmichaud> :​: commits to an alternation

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

From @FROGGS

Rakudo patch​: rakudo/rakudo@d329723627
STD patch​: perl6/std@f214dca295
test​: Raku/roast@2e4270c20a

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

@FROGGS - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Oct 11, 2014
@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