@@ -42,8 +42,9 @@ function flatten_equations(eqs::Vector{Union{Equation, Vector{Equation}}})
42
42
end
43
43
44
44
function _model_macro (mod, fullname:: Union{Expr, Symbol} , expr, isconnector)
45
+ MTK = ModelingToolkit
45
46
if fullname isa Symbol
46
- name, type = fullname, :System
47
+ name, type = fullname, :( $ MTK . System)
47
48
else
48
49
if fullname. head == :(:: )
49
50
name, type = fullname. args
@@ -74,9 +75,9 @@ function _model_macro(mod, fullname::Union{Expr, Symbol}, expr, isconnector)
74
75
push! (exprs. args, :(parameters = []))
75
76
# We build `System` by default; vectors can't be created for `System` as it is
76
77
# a function.
77
- push! (exprs. args, :(systems = ModelingToolkit . AbstractSystem[]))
78
- push! (exprs. args, :(equations = Union{Equation, Vector{Equation}}[]))
79
- push! (exprs. args, :(defaults = Dict {Num, Union{Number, Symbol, Function}} ()))
78
+ push! (exprs. args, :(systems = $ MTK . AbstractSystem[]))
79
+ push! (exprs. args, :(equations = Union{$ MTK . Equation, Vector{$ MTK . Equation}}[]))
80
+ push! (exprs. args, :(defaults = Dict {$MTK. Num, Union{Number, Symbol, Function}} ()))
80
81
81
82
Base. remove_linenums! (expr)
82
83
for arg in expr. args
0 commit comments