Suzhou-Tongyuan / ObjectOriented.jl

Conventional object-oriented programming in Julia without breaking Julia's core design ideas
MIT License
88 stars 6 forks source link

allow documenting a struct #13

Closed t-bltg closed 7 months ago

t-bltg commented 7 months ago

Fix the following issues with docstrings:

using ObjectOriented

"""
Documented struct fancy docstring
"""
@oodef struct DocumentedStruct
    a :: Int
    """
    Constructor docstring
    """
    function new(x)
        @mk a = 2x
    end
end

ERROR: LoadError: unrecognised statement in DocumentedStruct definition: Constructor docstring

# and

ERROR: LoadError: cannot document the following expression:

'@oodef' not documentable. See 'Base.@__doc__' docs for details.
thautwarm commented 7 months ago

Looks good