FluxML / MacroTools.jl

MacroTools provides a library of tools for working with Julia code and expressions.
https://fluxml.ai/MacroTools.jl/stable/
Other
308 stars 77 forks source link

Define @qq #200

Closed cstjean closed 5 months ago

cstjean commented 6 months ago

I found it pretty hard to write the docstring, improvements are welcome.

julia> macro my_fff_def(a)
           @qq function fff() $a end
       end
@my_fff_def (macro with 1 method)

julia> @macroexpand @my_fff_def begin   # line where fff() is defined
           function g()    # line where fff()() is defined
               22
           end
       end
:(function Main.fff()
      #= REPL[46]:1 =#          # with normal quotation, this line is from the macro construction site
      #= REPL[46]:1 =#
      begin
          #= REPL[46]:2 =#
          function var"#82#g"()
              #= REPL[46]:2 =#
              #= REPL[46]:3 =#
              22
          end
      end
  end)
codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6b3034a) 79.66% compared to head (9db5a11) 79.20%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #200 +/- ## ========================================== - Coverage 79.66% 79.20% -0.47% ========================================== Files 10 10 Lines 423 428 +5 ========================================== + Hits 337 339 +2 - Misses 86 89 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.