https://github.com/JuliaLang/julia
Revision 612393c944a0a55410e41b6d253ee10ff2f4a84b authored by Cody Tapscott on 14 March 2024, 11:01:22 UTC, committed by GitHub on 14 March 2024, 11:01:22 UTC
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>
1 parent f24364a
History
Tip revision: 612393c944a0a55410e41b6d253ee10ff2f4a84b authored by Cody Tapscott on 14 March 2024, 11:01:22 UTC
Avoid macro-expand recursion into `Expr(:toplevel, ...)` (#53515)
Tip revision: 612393c
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 571 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 1012 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 388.1 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 56.1 KB
Makefile -rw-r--r-- 30.3 KB
NEWS.md -rw-r--r-- 4.1 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.9 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 37.8 KB
pkgimage.mk -rw-r--r-- 1.4 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top