Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (30 sloc) 882 Bytes
use("core")
use("define")
use("control-flow")
macro(when-compiling ~(b: Block)):
b body evaluate(Atomy::CodeLoader context)
'nil
module(Atomy::AST):
class(LetMacro < Node):
children(#body, [#macros])
generate
bytecode(g) := do:
[mod, bnd] = Atomy make-wrapper-module
mod delegate = Atomy::CodeLoader module
before-mod = Atomy::CodeLoader module
before-ctx = Atomy::CodeLoader context
{ Atomy::CodeLoader module = mod
Atomy::CodeLoader context = bnd
@macros each [m]:
mod define-macro(m pattern, m body, Atomy::CodeLoader compiling)
body compile(g)
} ensuring:
Atomy::CodeLoader module = before-mod
Atomy::CodeLoader context = before-ctx
macro(let-macro(~*ms) ~(b: Block)):
LetMacro new(
node line
b body
ms collect [`(~p = ~b)]:
`(macro(~p): ~b)
)
Jump to Line
Something went wrong with that request. Please try again.