doc
                                
                                 doc copied to clipboard
                                
                                    doc copied to clipboard
                            
                            
                            
                        Declarators don't know the name of attributes in p6doc
The problem
If I try to use declarator syntax to document an attribute, p6doc doesn't know what to call it:
unit class TestClass;
#| Absolutely imperative you supply this
has $.prop is required;
p6doc TestClass.pm
class Attribute.new
Absolutely imperative that you supply this
(I was advised this is the correct repo to report problems with the p6doc program itself. Hope it is so.)
Yep, p6doc is hosted here. Thanks a lot for the report!
This may be a Rakudo pod 6 issue.
@tbrowder can you please clarify?
It looks like a problem with p6doc to me, not the rakudo pod parser.
Currently p6doc internally calls perl6 --doc which produces the same result as described by @Altreus:
Given the test file TestClass.pm6:
unit class TestClass;
#| Absolutely imperative you supply this
has $.prop is required;
Using p6doc:
$ p6doc TestClass.pm6
class Attribute.new
Absolutely imperative you supply this
Using perl6 --doc:
$ perl6 --doc TestClass.pm6
class Attribute.new
Absolutely imperative you supply this
Thus I'd assume the problem does not root in p6doc, or am I misunderstanding something?
@tbrowder @noisegul what we have to find out is if this is a documentation error or (as in, there should be a line break between the definition of the class and the documentation for the attribute) or a pod error (as in, #| should always document what's next, never what's above). What do specs say?
Or if #! can be used to document attributes at all. I wouldn't be so sure it does.
With p6doc spun off, what's left for this ticket in this repo?
Perhaps it could be migrated.
If I try to use declarator syntax to document an attribute, p6doc doesn't know what to call it
Putting p6doc aside, note this:
class foo {
  #| bar doc
  has $bar
}
.say for $=pod[0], $=pod[0].WHEREFORE;
displays
bar doc
Mu $!bar