Skip to content

Commit 7a8201f

Browse files
feat: retain IO metadata in toexpr(::AbstractSystem)
1 parent 3542211 commit 7a8201f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/systems/abstractsystem.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,17 @@ function push_vars!(stmt, name, typ, vars)
18221822
ex = nameof(s)
18231823
end
18241824
push!(vars_expr.args, ex)
1825+
1826+
meta_kvps = Expr[]
1827+
if isinput(s)
1828+
push!(meta_kvps, :(input = true))
1829+
end
1830+
if isoutput(s)
1831+
push!(meta_kvps, :(output = true))
1832+
end
1833+
if !isempty(meta_kvps)
1834+
push!(vars_expr.args, Expr(:vect, meta_kvps...))
1835+
end
18251836
end
18261837
push!(stmt, :($name = $collect($vars_expr)))
18271838
return

0 commit comments

Comments
 (0)