Reference
Contents
Index
ModuleMixins.Passes.passModuleMixins.Passes.passModuleMixins.Passes.walkModuleMixins.substitute_top_levelModuleMixins.@composeModuleMixins.@for_eachModuleMixins.Spec.@spec
ModuleMixins.substitute_top_level — Method
substitute_top_level(var, val, mod, expr)Takes a syntax object expr and substitutes every occurence of module var for val, only if the resulting object is actually present in module mod. The mod module should correspond with a lookup of val in the caller's namespace.
ModuleMixins.@compose — Macro
@compose module Name
[@mixin Parents, ...]
...
endCreates a new composable module Name. Structs inside this module are merged with those of the same name in Parents.
ModuleMixins.@for_each — Macro
@for_each(M -> M.method(), lst::Vector{Symbol})Calls method() for each module in lst that actually implements that method. Here lst should be a vector of symbols that are all in the current module's namespace.
ModuleMixins.Passes.pass — Method
pass(x::CompositePass, expr)Tries all passes in a composite pass in order, and returns with the first that succeeds (i.e. doesn't return no_match). You may create a CompositePass by adding passes with the + operator.
ModuleMixins.Passes.pass — Method
pass(x::Pass, expr)Interface. An implementation of the pass function should take a Pass object and an expression (or symbol), and return no_match if the expression did not match the pattern.
You can use the given Pass object to store information about this pass, return syntax that should replace the current expression, or nothing if it should be removed.
ModuleMixins.Passes.walk — Method
walk(x::Pass, expr_list)Calls MacroTools.prewalk with the given Pass. If no_match is returned, the expression stays untouched.
ModuleMixins.Spec.@spec — Macro
@spec module *name*
*body*...
endCreate a spec. The @spec macro itself doesn't perform any operations other than creating a module and storing its own AST as const *name*.AST.
This macro is only here for teaching purposes.