Skip to content

Commit 9c53279

Browse files
committed
Do not use part of list except when debugging
1 parent 22db459 commit 9c53279

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Compiler/FrontEnd/ElementSource.mo

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -456,27 +456,27 @@ function addElementSourcePartOf
456456
input output DAE.ElementSource source;
457457
input Absyn.Within withinPath;
458458
algorithm
459+
if not Flags.isSet(Flags.INFO_XML_OPERATIONS) then
460+
return;
461+
end if;
459462
source.partOfLst := withinPath::source.partOfLst;
460463
end addElementSourcePartOf;
461464

462465
function addElementSourcePartOfOpt
463-
input DAE.ElementSource inSource;
466+
input output DAE.ElementSource source;
464467
input Option<Absyn.Path> classPathOpt;
465-
output DAE.ElementSource outSource;
466468
algorithm
467-
outSource := match(inSource, classPathOpt)
469+
if not Flags.isSet(Flags.INFO_XML_OPERATIONS) then
470+
return;
471+
end if;
472+
source := match(source, classPathOpt)
468473
local
469474
Absyn.Path classPath;
470-
DAE.ElementSource src;
471475
// a top level
472476
case (_, NONE())
473-
equation
474-
_ = addElementSourcePartOf(inSource, Absyn.TOP());
475-
then inSource;
477+
then source;
476478
case (_, SOME(classPath))
477-
equation
478-
src = addElementSourcePartOf(inSource, Absyn.WITHIN(classPath));
479-
then src;
479+
then addElementSourcePartOf(source, Absyn.WITHIN(classPath));
480480
end match;
481481
end addElementSourcePartOfOpt;
482482

0 commit comments

Comments
 (0)