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

Pod config dropping value when using :[number][alpha] syntax #2793

Closed
JJ opened this issue Mar 24, 2019 · 9 comments
Closed

Pod config dropping value when using :[number][alpha] syntax #2793

JJ opened this issue Mar 24, 2019 · 9 comments
Assignees
Labels

Comments

@JJ
Copy link
Collaborator

JJ commented Mar 24, 2019

The Problem

This program:

=begin pod :3foo
Does not really matter
=end pod

=begin pod :foo(3)
Does not really matter much
=end pod

dd $=pod;

Expected Behavior

Should have the same value for config, since :3foo === :foo(3)

Actual Behavior

, but it prints

Array element = [Pod::Block::Named.new(name => "pod", config => {:foo}, contents => [Pod::Block::Para.new(config => {}, contents => ["Does not really matter"])]), Pod::Block::Named.new(name => "pod", config => {:foo(3)}, contents => [Pod::Block::Para.new(config => {}, contents => ["Does not really matter much"])])]

In the case of :3foo, the 3 is dropped and the value turned into a Bool

Steps to Reproduce

Environment

  • Operating system: Ubuntu 16.04
  • Compiler version (perl6 -v):
This is Rakudo version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d
@tbrowder
Copy link
Member

I don't see that sugar method mentioned in S26, so I didn't think of implementing it, but it should be possible.

@JJ
Copy link
Collaborator Author

JJ commented Mar 24, 2019

Well, if only for consistency... If documented, we can just drop it.

@tbrowder
Copy link
Member

Hm, mark it NYI?

@JJ
Copy link
Collaborator Author

JJ commented Mar 24, 2019

Maybe. Come to think of it, the problem with that syntax is that it's erroneously processed, with :3whatever exactly equal than :whatever. So it should either fail as NYI or be implemented, whatever is the easiest.

@tbrowder
Copy link
Member

If you mean throw some kind of NYI error, I would have as much trouble with that as with implementing it! So I might as well take it on.

@tbrowder tbrowder self-assigned this Mar 24, 2019
@tbrowder
Copy link
Member

After looking at a two-digit test (e.g., "=begin pod :34foo") using module Data::Dump for more details on the current structure produced by rakudo, I believe the fix is relatively straight forward by:

  • modifying the boolean (key = 'numbered') path in sub make_config in "src/Perl6/Pod.nqp"

@JJ
Copy link
Collaborator Author

JJ commented Mar 25, 2019 via email

lizmat added a commit that referenced this issue Mar 27, 2019
@tbrowder
Copy link
Member

Closed with 0d47db8.

@tbrowder
Copy link
Member

tbrowder commented Mar 28, 2019

By the way, the "number" must be a UInt (in decimal form) and the docs should reflect that but I don't think that's true.

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

3 participants