Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address #25 #38

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function amr_to_string(amr)
Rate(t, f) => "$t::Rate = $(f.expression)"
Initial(t, f) => "$t::Initial = $(f.expression)"
Observable(id, n, states, f) => "# $n\n$id::Observable = $(f.expression)($states)\n"
Header(name, s, d, sn, mv) => "\"\"\"\nASKE Model Representation: $name$mv :: $sn \n $s\n\n$d\n\"\"\""
Header(name, s, d, sn, mv) => "\"\"\"\nASKE Model Representation: $name@$mv :: $sn \n $s\n\n$d\n\"\"\""
Parameter(t, n, d, u, v, dist) => "\n# $n-- $d\n$t::Parameter{$(!u)} = $v ~ $(!dist)\n"
m::ACSetSpec => "Model = begin\n$(padlines(sprint(show, m),2))\nend"
ODEList(l) => "ODE_Equations = begin\n" * padlines(join(map(!, l), "\n")) * "\nend"
Expand Down Expand Up @@ -452,12 +452,12 @@ function load(::Type{ASKEModel}, ex::Expr)
elts = map(ex.args) do arg
@match arg begin
Expr(:macrocall, var"@doc", _, s, ex) => (load(Header, s), load(ACSetSpec, ex))
Expr(:(=), :ODE_Record, body) => load(ODEList, arg)
Expr(:(=), :ODE_Record, body) => load(ODERecord, arg)
Expr(:(=), :ODE_Equations, body) => load(ODEList, arg)
Expr(:(=), :Typing, body) => load(Typing, arg)
_ => arg
end
end
ASKEModel(elts[2][1], elts[2][2], [elts[4], elts[6]])
end
end # module end
end # module end
Loading