Skip to content

New utility rmdocs - #215

Merged
cstjean merged 4 commits into
FluxML:masterfrom
astrozot:master
Dec 12, 2025
Merged

New utility rmdocs#215
cstjean merged 4 commits into
FluxML:masterfrom
astrozot:master

Conversation

@astrozot

@astrozot astrozot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

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

cstjean commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

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

@astrozot

astrozot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

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

cstjean commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

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