@@ -148,35 +148,10 @@ emptyrn = @reaction_network
148
148
149
149
ReactionSystems generated through `@reaction_network` are compelte.
150
150
"""
151
- macro reaction_network (name :: Symbol , ex :: Expr )
152
- :(complete ($ ( make_reaction_system (MacroTools . striplines (ex); name = :( $ ( QuoteNode (name)))) )))
151
+ macro reaction_network (args ... )
152
+ return :(complete (@network_component $ (args ... )))
153
153
end
154
154
155
- # allows @reaction_network $name begin ... to interpolate variables storing a name
156
- macro reaction_network (name:: Expr , ex:: Expr )
157
- :(complete ($ (make_reaction_system (MacroTools. striplines (ex); name = :($ (esc (name. args[1 ])))))))
158
- end
159
-
160
- macro reaction_network (ex:: Expr )
161
- ex = MacroTools. striplines (ex)
162
-
163
- # no name but equations: @reaction_network begin ... end ...
164
- if ex. head == :block
165
- :(complete ($ (make_reaction_system (ex))))
166
- else # empty but has interpolated name: @reaction_network $name
167
- networkname = :($ (esc (ex. args[1 ])))
168
- return Expr (:block , :(@parameters t),
169
- :(complete (ReactionSystem (Reaction[], t, [], []; name = $ networkname))))
170
- end
171
- end
172
-
173
- # Returns a empty network (with, or without, a declared name)
174
- macro reaction_network (name:: Symbol = gensym (:ReactionSystem ))
175
- return Expr (:block , :(@parameters t),
176
- :(complete (ReactionSystem (Reaction[], t, [], []; name = $ (QuoteNode (name))))))
177
- end
178
-
179
-
180
155
"""
181
156
@network_component
182
157
0 commit comments