-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid macro-expand recursion into
Expr(:toplevel, ...)
(#53515)
Here's an example output from macroexpand: ``` Expr head: Symbol thunk args: Array{Any}((1,)) 1: Core.CodeInfo code: Array{Any}((2,)) 1: Expr head: Symbol toplevel args: Array{Any}((17,)) 1: Expr head: Symbol hygienic-scope args: Array{Any}((3,)) 1: LineNumberNode 2: Module Base.Enums 3: LineNumberNode 2: Expr head: Symbol hygienic-scope args: Array{Any}((3,)) 1: Expr 2: Module Base.Enums 3: LineNumberNode 3: Expr head: Symbol hygienic-scope args: Array{Any}((3,)) 1: LineNumberNode 2: Module Base.Enums 3: LineNumberNode 4: Expr head: Symbol hygienic-scope args: Array{Any}((3,)) 1: Expr 2: Module Base.Enums 3: LineNumberNode ... ``` Currently fails during bootstrap with: ``` LoadError("sysimg.jl", 3, LoadError("Base.jl", 542, ErrorException("cannot document the following expression:\n\n#= mpfr.jl:65 =# @enum MPFRRoundingMode begin\n #= mpfr.jl:66 =#\n MPFRRoundNearest\n #= mpfr.jl:67 =#\n MPFRRoundToZero\n #= mpfr.jl:68 =#\n MPFRRoundUp\n #= mpfr.jl:69 =#\n MPFRRoundDown\n #= mpfr.jl:70 =#\n MPFRRoundFromZero\n #= mpfr.jl:71 =#\n MPFRRoundFaithful\n end\n\n'@enum' not documentable. See 'Base.@__doc__' docs for details.\n"))) ``` Perhaps we can do better than wrapping each `Expr(:toplevel, ...)` arg individually, or I should be filtering out the LineNumberNodes? --------- Co-authored-by: Keno Fischer <keno@juliacomputing.com> Co-authored-by: Keno Fischer <keno@juliahub.com>
- Loading branch information
1 parent
f24364a
commit 612393c
Showing
6 changed files
with
185 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.