Skip to content

Commit 6a5073f

Browse files
fixup! fix: fix and document wrap_mtkparameters
1 parent 565e1a9 commit 6a5073f

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/systems/abstractsystem.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,40 +419,46 @@ function wrap_mtkparameters(sys::AbstractSystem, isscalar::Bool, p_start = 2)
419419

420420
if isscalar
421421
function (expr)
422-
destructured_args = [x for x in expr.args[p_start:end-offset] if x isa DestructuredArgs]
422+
destructured_args = [x
423+
for x in expr.args[p_start:(end - offset)]
424+
if x isa DestructuredArgs]
423425
Func(
424426
[
425-
expr.args[begin:p_start-1]...,
427+
expr.args[begin:(p_start - 1)]...,
426428
DestructuredArgs(
427429
[arg.name for arg in expr.args[p_start:(end - offset)]], MTKPARAMETERS_ARG),
428-
expr.args[end-offset+1:end]...
430+
expr.args[(end - offset + 1):end]...
429431
],
430432
[],
431433
Let(destructured_args, expr.body, false)
432434
)
433435
end
434436
else
435437
function (expr)
436-
destructured_args = [x for x in expr.args[p_start:end-offset] if x isa DestructuredArgs]
438+
destructured_args = [x
439+
for x in expr.args[p_start:(end - offset)]
440+
if x isa DestructuredArgs]
437441
Func(
438442
[
439-
expr.args[begin:p_start-1]...,
443+
expr.args[begin:(p_start - 1)]...,
440444
DestructuredArgs(
441445
[arg.name for arg in expr.args[p_start:(end - offset)]], MTKPARAMETERS_ARG),
442-
expr.args[end-offset+1:end]...
446+
expr.args[(end - offset + 1):end]...
443447
],
444448
[],
445449
Let(destructured_args, expr.body, false)
446450
)
447451
end,
448452
function (expr)
449-
destructured_args = [x for x in expr.args[p_start:end-offset] if x isa DestructuredArgs]
453+
destructured_args = [x
454+
for x in expr.args[p_start:(end - offset)]
455+
if x isa DestructuredArgs]
450456
Func(
451457
[
452458
expr.args[begin:p_start]...,
453459
DestructuredArgs(
454-
[arg.name for arg in expr.args[p_start+1:(end - offset)]], MTKPARAMETERS_ARG),
455-
expr.args[end-offset+1:end]...
460+
[arg.name for arg in expr.args[(p_start + 1):(end - offset)]], MTKPARAMETERS_ARG),
461+
expr.args[(end - offset + 1):end]...
456462
],
457463
[],
458464
Let(destructured_args, expr.body, false)

0 commit comments

Comments
 (0)