Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 715fb85

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Do not remove added lines that don't match label
Belonging to [master]: - #2099 - OpenModelica/OpenModelica-testsuite#815
1 parent 708e996 commit 715fb85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Compiler/Parsers/SimpleModelicaParser.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,9 +2127,7 @@ algorithm
21272127
acc := {};
21282128
for t in lst loop
21292129
// Assuming adjacent to the delete node
2130-
if found then
2131-
res := (Diff.Add, {t})::res;
2132-
elseif compare(nodeLabel(t), labelOfDiffedNodes) then
2130+
if (not found) and compare(nodeLabel(t), labelOfDiffedNodes) then
21332131
if not listEmpty(acc) then
21342132
res := (Diff.Add, listReverse(acc))::res;
21352133
acc := {};
@@ -2138,6 +2136,8 @@ algorithm
21382136
filtered := listReverse(i for i guard match i case (Diff.Delete,_) then false; else true; end match in diffedNodes);
21392137
res := listAppend(filtered, res);
21402138
found := true;
2139+
else
2140+
res := (Diff.Add, {t})::res;
21412141
end if;
21422142
end for;
21432143
if not listEmpty(acc) then

0 commit comments

Comments
 (0)