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

our scoped tokens in grammars do not accept Cursor #4240

Closed
p6rt opened this issue May 13, 2015 · 3 comments
Closed

our scoped tokens in grammars do not accept Cursor #4240

p6rt opened this issue May 13, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 13, 2015

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

Searchable as RT125169$

@p6rt
Copy link
Author

p6rt commented May 13, 2015

From @FROGGS

grammar D { our token doo { doo }; }; say 'doo' ~~ &D​::doo
rakudo-moar a6f563​: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor'␤ in regex doo at /tmp/8wglQQkyMB​:1␤ in block <unit> at /tmp/8wglQQkyMB​:1␤␤»

grammar D { token doo is export { doo }; }; import D; say 'doo' ~~ &doo
rakudo-moar a6f563​: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor'␤ in regex doo at /tmp/anZydiSimC​:1␤ in block <unit> at /tmp/anZydiSimC​:1␤␤»

It works when we mess with the invocant​:
grammar D { our token doo(Mu​:) { doo }; }; say 'doo' ~~ &D​::doo
rakudo-moar a6f563​: OUTPUT«「doo」␤»

grammar D { token doo(Mu​:) is export { doo }; }; import D; say 'doo' ~~ &doo
rakudo-moar a6f563​: OUTPUT«「doo」␤»

grammar D { our token doo(Mu​:) { doo }; }; say 'doo' ~~ / <&D​::doo> /
rakudo-moar a6f563​: OUTPUT«「doo」␤»

It should work without "restricting" the invocant to Mu.

@p6rt
Copy link
Author

p6rt commented May 17, 2015

From @FROGGS

Patch​: rakudo/rakudo@88b1203c05
Tests​: Raku/roast@b159d9b862

The code above about 'token is export' is not meant to work IMO, compare to how 'method is export' is called.

@p6rt
Copy link
Author

p6rt commented May 17, 2015

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

@p6rt p6rt closed this as completed May 17, 2015
@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