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
6868 children:: Vector{Any}
6969end
7070
71+ function MetadataImpl ()
72+ MetadataImpl (nothing , Vector ())
73+ end
74+
7175@kwdef struct BasicSymbolic{T} <: Symbolic{T}
7276 expr:: BasicSymbolicImpl{T}
7377 meta:: MetadataImpl
7478end
7579
80+ getmetaimpl (x:: BasicSymbolic ) = x. meta
81+ getmetaimpl (:: Any ) = nothing
82+
7683function SymbolicIndexingInterface. symbolic_type (:: Type{<:BasicSymbolic} )
7784 ScalarSymbolic ()
7885end
210217TermInterface. children (x:: BasicSymbolic ) = arguments (x)
211218TermInterface. sorted_children (x:: BasicSymbolic ) = sorted_arguments (x)
212219function 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
214233end
215234function TermInterface. arguments (x:: BasicSymbolicImpl )
216235 @compactified x:: BasicSymbolicImpl begin
You can’t perform that action at this time.
0 commit comments