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

make() with Hash argument sets $/.ast to pairlist #2231

Closed
p6rt opened this issue Oct 21, 2010 · 3 comments
Closed

make() with Hash argument sets $/.ast to pairlist #2231

p6rt opened this issue Oct 21, 2010 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Oct 21, 2010

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

Searchable as RT78510$

@p6rt
Copy link
Author

p6rt commented Oct 21, 2010

From @moritz

01​:31 <+p6eval> rakudo d35769​: OUTPUT«"a" => 1␤»
01​:32 < moritz_> rakudo​: class A { method TOP($/) { make ( a => 1, b =>
2 ).hash } }; grammar B { token TOP { ^. } }; say B.parse('x',
:actions(A.new)).ast.perl
01​:32 <+p6eval> rakudo d35769​: OUTPUT«("a" => 1, "b" => 2)␤»

The result should be the hash that the (a => 1, b => 2).hash generated,
instead it's just a list of of pairs.

Adding a $/.perl shows that it's the make() step that misbehaves, not
the retrieval via .ast​:

01​:31 < moritz_> rakudo​: class A { method TOP($/) { make ( a => 1
).hash; say $/.perl } }; grammar B { token TOP { ^. } }; say
B.parse('x', :actions(A.new)).ast.perl
01​:31 <+p6eval> rakudo d35769​: OUTPUT«Match.new(␤ ast => "a" => 1,␤
from => 0,␤ orig => "x",␤ to => 1,␤)␤"a" => 1␤»

@p6rt
Copy link
Author

p6rt commented Oct 2, 2011

From @moritz

works fine now, and tested in S05-grammar/action-stubs.t.

@p6rt
Copy link
Author

p6rt commented Oct 2, 2011

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

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