@@ -751,7 +751,8 @@ function LocalScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
751
751
if istree (sym) && operation (sym) === getindex
752
752
args = arguments (sym)
753
753
a1 = setmetadata (args[1 ], SymScope, LocalScope ())
754
- similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ])
754
+ similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ];
755
+ metadata = metadata (sym))
755
756
else
756
757
setmetadata (sym, SymScope, LocalScope ())
757
758
end
@@ -767,7 +768,8 @@ function ParentScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
767
768
args = arguments (sym)
768
769
a1 = setmetadata (args[1 ], SymScope,
769
770
ParentScope (getmetadata (value (args[1 ]), SymScope, LocalScope ())))
770
- similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ])
771
+ similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ];
772
+ metadata = metadata (sym))
771
773
else
772
774
setmetadata (sym, SymScope,
773
775
ParentScope (getmetadata (value (sym), SymScope, LocalScope ())))
@@ -785,7 +787,8 @@ function DelayParentScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}}, N)
785
787
args = arguments (sym)
786
788
a1 = setmetadata (args[1 ], SymScope,
787
789
DelayParentScope (getmetadata (value (args[1 ]), SymScope, LocalScope ()), N))
788
- similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ])
790
+ similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ];
791
+ metadata = metadata (sym))
789
792
else
790
793
setmetadata (sym, SymScope,
791
794
DelayParentScope (getmetadata (value (sym), SymScope, LocalScope ()), N))
@@ -800,7 +803,8 @@ function GlobalScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
800
803
if istree (sym) && operation (sym) == getindex
801
804
args = arguments (sym)
802
805
a1 = setmetadata (args[1 ], SymScope, GlobalScope ())
803
- similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ])
806
+ similarterm (sym, operation (sym), [a1, args[2 : end ]. .. ];
807
+ metadata = metadata (sym))
804
808
else
805
809
setmetadata (sym, SymScope, GlobalScope ())
806
810
end
0 commit comments