Helpers for defining public macro wrappers around DSL scope modules.
Summary
Functions
Import public macro-definition helpers.
Defines a macro from a quoted template with an explicit caller-block yield.
Defines a block macro with start and finish calls.
Defines a macro that expands to a single call.
Build and escape caller source metadata for generated macro wrappers.
Expand variables in a quoted template with caller-provided AST bindings.
Replace yield() markers in a template with a caller block.
Functions
Import public macro-definition helpers.
Defines a macro from a quoted template with an explicit caller-block yield.
defaround project(name) do
start_project(name)
yield()
finish_project()
endPass optional: true to also define a no-body form where yield() expands
to nil.
Defines a block macro with start and finish calls.
defblock project(name, opts \ []) do
start MyScope.start_project(name, opts)
finish MyScope.finish_project()
endPass source: true to make a source variable available to start and
finish expressions. The generated macro uses DSL.Source.escape_caller/1.
Defines a macro that expands to a single call.
defdirective providers(providers) do
MyScope.put_providers(providers)
end
@spec escape_source(true | module(), Macro.Env.t()) :: Macro.t()
Build and escape caller source metadata for generated macro wrappers.
Expand variables in a quoted template with caller-provided AST bindings.
Replace yield() markers in a template with a caller block.