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

Parse docstrings within structs as K"doc" #511

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Commits on Oct 5, 2024

  1. Parse docstrings within structs as K"doc"

    Julia's ecosystem (including Base.Docs and flisp lowering) assumes that
    strings within `struct` definitions are per-field docstrings, but the
    flisp parser doesn't handle these - they are only recognized when the
    struct itself has a docstring and are processed by the `@doc` macro
    recursing into the struct's internals. For example, the following
    doesn't result in any docs attached to `A`.
    
    ```julia
    struct A
        "x_docs"
        x
    
        "y_docs"
        y
    end
    ```
    
    This change adds `K"doc"` node parsing to the insides of a struct,
    making the semantics clearer in the parser tree and making it possible
    to address this problems in the future within JuliaLowering.
    
    Also ensure that the `Expr` form is unaffected by this change.
    c42f committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    42a980c View commit details
    Browse the repository at this point in the history