Skip to content

Commit ca9a274

Browse files
committed
init
1 parent dfca232 commit ca9a274

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/chemistry_functionality.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function make_compound(expr)
9999
# - Any ivs attached to it (ivs, e.g. `[]` or `[t,x]`).
100100
# - The expression which creates the compound (species_expr, e.g. `CO2 = 1.0, [metadata=true]`).
101101
species_expr = expr.args[2]
102-
species_name, ivs, _, _ = find_varinfo_in_declaration(expr.args[2])
102+
species_name, ivs, _, _, _ = find_varinfo_in_declaration(expr.args[2])
103103

104104
# If no ivs were given, inserts an expression which evaluates to the union of the ivs
105105
# for the species the compound depends on.

src/dsl.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ function read_observables_option(options, all_ivs, us_declared, all_syms; requir
757757

758758
for (idx, obs_eq) in enumerate(obs_eqs.args)
759759
# Extract the observable, checks for errors.
760-
obs_name, ivs, defaults, metadata = find_varinfo_in_declaration(obs_eq.args[2])
760+
obs_name, ivs, _, defaults, metadata = find_varinfo_in_declaration(obs_eq.args[2])
761761

762762
# Error checks.
763763
(requiredec && !in(obs_name, us_declared)) &&

src/expression_utils.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@ function find_varinfo_in_declaration(expr::ExprValues)
8787
ivs = expr.args[2:end]
8888
expr = expr.args[1]
8989
end
90+
isnothing(ivs) && (ivs = [])
9091

92+
# If escaped expression, extract symbol. Checks that the expression is a symbol (e.g. `X` in `:(X(t))`).
93+
Meta.isexpr(expr, :escape) && (expr = expr.args[1])
9194
(expr isa Symbol) ||
9295
error("Erroneous expression encountered in `find_varinfo_in_declaration` (got `$expr` after processing, this should be a symbol).")
93-
return (;ivs, idxs, default, metadata)
96+
return (;sym = expr, ivs, idxs, default, metadata)
9497
end
9598

9699
# Converts an expression of the forms:

0 commit comments

Comments
 (0)