File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,18 @@ struct MetadataImpl
68
68
children:: Vector{Any}
69
69
end
70
70
71
+ function MetadataImpl ()
72
+ MetadataImpl (nothing , Vector ())
73
+ end
74
+
71
75
@kwdef struct BasicSymbolic{T} <: Symbolic{T}
72
76
expr:: BasicSymbolicImpl{T}
73
77
meta:: MetadataImpl
74
78
end
75
79
80
+ getmetaimpl (x:: BasicSymbolic ) = x. meta
81
+ getmetaimpl (:: Any ) = nothing
82
+
76
83
function SymbolicIndexingInterface. symbolic_type (:: Type{<:BasicSymbolic} )
77
84
ScalarSymbolic ()
78
85
end
210
217
TermInterface. children (x:: BasicSymbolic ) = arguments (x)
211
218
TermInterface. sorted_children (x:: BasicSymbolic ) = sorted_arguments (x)
212
219
function TermInterface. arguments (x:: BasicSymbolic )
213
- arguments (x. expr)
220
+ args = arguments (x. expr)
221
+ args_metadata = x. meta. children
222
+ res = Vector ()
223
+ for (arg, meta) in zip (args, args_metadata)
224
+ if arg isa BasicSymbolicImpl
225
+ if isnothing (meta)
226
+ meta = MetadataImpl ()
227
+ end
228
+ arg = BasicSymbolic (arg, meta)
229
+ end
230
+ push! (res, arg)
231
+ end
232
+ res
214
233
end
215
234
function TermInterface. arguments (x:: BasicSymbolicImpl )
216
235
@compactified x:: BasicSymbolicImpl begin
You can’t perform that action at this time.
0 commit comments