File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,17 @@ makesym(t::Num; kwargs...) = makesym(value(t); kwargs...)
193
193
194
194
function lower_varname (var:: Term , idv, order)
195
195
order == 0 && return var
196
- name = Symbol (nameof (var. op), :ˍ , string (idv)^ order)
197
- return Sym {symtype(var.op)} (name)(var. args[1 ])
196
+ name = string (nameof (var. op))
197
+ underscore = ' ˍ'
198
+ idx = findlast (underscore, name)
199
+ append = string (idv)^ order
200
+ if idx === nothing
201
+ newname = Symbol (name, underscore, append)
202
+ else
203
+ nidx = nextind (name, idx)
204
+ newname = Symbol (name[1 : idx], name[nidx: end ], append)
205
+ end
206
+ return Sym {symtype(var.op)} (newname)(var. args[1 ])
198
207
end
199
208
200
209
function lower_varname (t:: Term , iv)
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ using Test
4
4
# Derivatives
5
5
@parameters t σ ρ β
6
6
@variables x y z
7
- @variables uu (t)
7
+ @variables uu (t) uuˍt (t)
8
8
@derivatives D' ~ t D2'' ~ t Dx' ~ x
9
9
10
10
@test Symbol (D (D (uu))) === Symbol (" uuˍtt⦗t⦘" )
11
+ @test Symbol (D (uuˍt)) === Symbol (D (D (uu)))
11
12
12
13
test_equal (a, b) = @test isequal (simplify (a), simplify (b))
13
14
You can’t perform that action at this time.
0 commit comments