Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 9f82084

Browse files
committed
add exception fixes
1 parent 8e8527e commit 9f82084

File tree

23 files changed

+35
-656
lines changed

23 files changed

+35
-656
lines changed

src/main/kotlin/org/objectionary/ddr/graph/CondAttributesSetter.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ class CondAttributesSetter(
6060
}
6161
val igCond = IgNodeCondition(cond)
6262
traverseParents(node.parentNode, igCond.freeVars)
63-
if (name(node) != "@") {
64-
graph.igNodes.add(IGraphCondNode(node, packageName(node), igCond, fstOption, sndOption))
65-
val parent = graph.igNodes.find { it.body == node.parentNode }
66-
parent?.attributes?.add(IGraphCondAttr(name(node)!!, 0, node, igCond, fstOption, sndOption))
67-
} else {
68-
val parent = graph.igNodes.find { it.body == node.parentNode }
69-
parent?.attributes?.add(IGraphCondAttr(name(node)!!, 0, node, igCond, fstOption, sndOption))
63+
name(node)?.let {name ->
64+
if (name != "@") {
65+
graph.igNodes.add(IGraphCondNode(node, packageName(node), igCond, fstOption, sndOption))
66+
val parent = graph.igNodes.find { it.body == node.parentNode }
67+
parent?.attributes?.add(IGraphCondAttr(name, 0, node, igCond, fstOption, sndOption))
68+
} else {
69+
val parent = graph.igNodes.find { it.body == node.parentNode }
70+
parent?.attributes?.add(IGraphCondAttr(name, 0, node, igCond, fstOption, sndOption))
71+
}
7072
}
7173
}
7274
}

src/main/kotlin/org/objectionary/ddr/graph/InnerPropagator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class InnerPropagator(
6464
@Suppress("MAGIC_NUMBER")
6565
private fun processDecorators() {
6666
val repetitions = 5
67-
6867
// @todo #44:30min this solution is naive, optimize it (see commented out lines)
6968
// while (decorators.containsValue(false)) {
7069
for (i in 0..repetitions) {

src/main/kotlin/org/objectionary/ddr/transform/Resolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ abstract class Resolver(
145145
}
146146
}
147147
if (base(node) == "^") {
148-
return node.parentNode.parentNode
148+
return node.parentNode?.parentNode
149149
}
150150
if (base(node) == "$") {
151151
return node.parentNode

src/test/resources/integration/in/basic_cycle_ddr/basic_cycle.xmir

Lines changed: 0 additions & 110 deletions
This file was deleted.

src/test/resources/resolver/xmirs/alias_chain/app.xmir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<program ms="1"
2+
<program ms="2"
33
name="transformer"
4-
time="2022-11-03T11:34:11.279528900Z"
4+
time="2022-11-05T13:49:55.333288200Z"
55
version="0.28.10">
66
<listing>+alias util.utils
77

src/test/resources/resolver/xmirs/alias_chain/util/utils.xmir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<program ms="2"
2+
<program ms="3"
33
name="transformer"
4-
time="2022-11-03T11:34:11.297481300Z"
4+
time="2022-11-05T13:49:55.350243Z"
55
version="0.28.10">
66
<listing>+package util
77

src/test/resources/resolver/xmirs/basic/app.xmir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<program ms="5"
2+
<program ms="2"
33
name="transformer"
4-
time="2022-11-03T11:34:12.116281200Z"
4+
time="2022-11-05T13:49:56.102232600Z"
55
version="0.28.10">
66
<listing>+alias org.ut.util
77

src/test/resources/resolver/xmirs/basic/util_dir/util.xmir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<program ms="0"
2+
<program ms="1"
33
name="transformer"
4-
time="2022-11-03T11:34:12.129246600Z"
4+
time="2022-11-05T13:49:56.115199400Z"
55
version="0.28.10">
66
<listing>+package org.ut
77

src/test/resources/resolver/xmirs/condition/condition.xmir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<program ms="7"
33
name="transformer"
4-
time="2022-11-03T11:34:09.583734400Z"
4+
time="2022-11-05T13:49:53.912090400Z"
55
version="0.28.10">
66
<listing>+alias stdout org.eolang.io.stdout
77

src/test/resources/resolver/xmirs/condition_chain/cond_chain.xmir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<program ms="2"
2+
<program ms="5"
33
name="transformer"
4-
time="2022-11-03T11:34:11.679459400Z"
4+
time="2022-11-05T13:49:55.711278600Z"
55
version="0.28.10">
66
<listing>+alias stdout org.eolang.io.stdout
77

0 commit comments

Comments
 (0)