Skip to content

Conversation

@astrozot
Copy link
Contributor

@astrozot astrozot commented Dec 8, 2025

This pull request introduces a new utility function, rmdocs, which can be used to remove Core.@doc macro calls, leaving only the associated definition. For example

julia> ex = quote
  "A simple function that duplicate its argument."
  function f(x)
    return 2x
  end
end;

Then one has

julia> MacroTools.prewalk(MacroTools.rmlines  MacroTools.rmdocs, ex)
quote
    function f(x)
        return 2x
    end
end

@cstjean
Copy link
Collaborator

cstjean commented Dec 9, 2025

Sounds good to me. Could you add tests, please?

@astrozot
Copy link
Contributor Author

astrozot commented Dec 9, 2025

Thank you for your fast reaction @cstjean. I added the tests for rmdocs, but since I have not seen tests for the similar function rmlines, I also added tests for this one.

@cstjean
Copy link
Collaborator

cstjean commented Dec 12, 2025

Great PR, thanks!

@cstjean cstjean merged commit ac4492a into FluxML:master Dec 12, 2025
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants