Skip to content

Commit a1aac3a

Browse files
committed
WIP
1 parent 2cb4091 commit a1aac3a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/systems/connectors.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function get_var(mod::Module, b)
9393
b isa Symbol ? getproperty(mod, b) : b
9494
end
9595
macro model(name::Symbol, expr)
96-
model_macro(@__MODULE__, name, expr)
96+
esc(model_macro(@__MODULE__, name, expr))
9797
end
9898
function model_macro(mod, name, expr)
9999
exprs = Expr(:block)
@@ -126,8 +126,12 @@ function parse_components!(exprs, dict, body)
126126
arg isa LineNumberNode && continue
127127
MLStyle.@match arg begin
128128
Expr(:(=), a, b) => begin
129+
arg = deepcopy(arg)
130+
b = deepcopy(arg.args[2])
131+
push!(b.args, Expr(:kw, :name, Meta.quot(a)))
132+
arg.args[2] = b
129133
push!(comps, String(a) => readable_code(b))
130-
push!(exprs, arg)
134+
push!(exprs, @show arg)
131135
end
132136
_ => error("`@components` only takes assignment expressions. Got $arg")
133137
end

0 commit comments

Comments
 (0)