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

Support capturing Expr for use in abbreviations. #133

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

MichaelHatherly
Copy link
Member

@MichaelHatherly MichaelHatherly commented May 26, 2022

Should help handle #54, and possibly make other things easier to handle, such as #19 and other places where digging into the lowered code is a pain while dealing with the raw Expr would be more useful.

This intercepts documented expressions during macro expansion of Core.@doc and makes the documented Expr available for capturing and usage in abbreviation objects.

Add a generic interface function `interpolation` that hooks into the
stage after macro expansion so that interpolated values in docstrings
can implement their own behaviour rather than being directly
interpolated into the docstring. Pass the documented expression through
to `interpolation` such that abbreviation implementations can make use
of this expression for their own needs.
@MichaelHatherly
Copy link
Member Author

Should be good to go as an initial interface for capturing the expressions, I'll leave leveraging this feature in current abbreviation implementations that could make use of it as separate follow up PRs at some point (unless anyone else gets there before me). @mortenpi feel free to review this one if you find the time to :)

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The test got me confused for a sec, hence the comment.

src/utilities.jl Show resolved Hide resolved
test/interpolation.jl Show resolved Hide resolved
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
test/interpolation.jl Outdated Show resolved Hide resolved
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.

None yet

2 participants