diff --git a/src/onepass.jl b/src/onepass.jl index b1ff16a..630ca18 100644 --- a/src/onepass.jl +++ b/src/onepass.jl @@ -1382,7 +1382,7 @@ function def_fun(e; log=false) $p_ocp = $pref.PreModel() $code $pref.definition!($p_ocp, $ee) - $pref.time_dependence!($p_ocp; autonomous=$p.is_autonomous) # not $(p.xxxx) as this info is known statically + $pref.time_dependence!($p_ocp; autonomous=($p.is_autonomous)) # not $(p.xxxx) as this info is known statically end if is_active_backend(:exa) diff --git a/src/utils.jl b/src/utils.jl index 360593f..788901b 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -134,7 +134,7 @@ function subs2(e, x, y, j; k=__symgen(:k)) _ => f end end - expr_it(e, foo(x, y, j), x -> x) + return expr_it(e, foo(x, y, j), x -> x) end """ @@ -163,7 +163,7 @@ function subs3(e, x, y, i, j) _ => f end end - expr_it(e, foo(x, y, i, j), x -> x) + return expr_it(e, foo(x, y, i, j), x -> x) end """ @@ -210,7 +210,7 @@ function subs2m(e, x, y, j; k=__symgen(:k)) _ => f end end - expr_it(e, foo(x, y, j), x -> x) + return expr_it(e, foo(x, y, j), x -> x) end """ @@ -283,7 +283,7 @@ function replace_call(e, x::Vector{<:Union{Nothing,Symbol}}, t, y) _ => ee end end - expr_it(e, foo(x, t, y), x -> x) + return expr_it(e, foo(x, t, y), x -> x) end """ @@ -369,7 +369,7 @@ function has(e, x, t) end end end - expr_it(e, foo(x, t), x -> x) == :yes + return expr_it(e, foo(x, t), x -> x) == :yes end """ diff --git a/test/test_onepass_exa.jl b/test/test_onepass_exa.jl index af79abc..057f832 100644 --- a/test/test_onepass_exa.jl +++ b/test/test_onepass_exa.jl @@ -1450,9 +1450,9 @@ function __test_onepass_exa( N = 200 t = (tfs * 0):N - xs = _xs.(t); + xs = _xs.(t) xs = stack(xs[:]) - us = _us.(t); + us = _us.(t) us = stack(us[:]) m, _ = discretise_exa_full( diff --git a/test/test_utils_bis.jl b/test/test_utils_bis.jl index 6f48764..406fc6b 100644 --- a/test/test_utils_bis.jl +++ b/test/test_utils_bis.jl @@ -167,9 +167,8 @@ function test_utils_bis() # Block + non-block e1 = :( begin - ; - a = 1; - b = 2; + a = 1 + b = 2 end ) e2 = :(c = 3) @@ -182,9 +181,8 @@ function test_utils_bis() e1 = :(z = 0) e2 = :( begin - ; - p = 1; - q = 2; + p = 1 + q = 2 end ) e = concat(e1, e2)