Skip to content

Commit 2309a5a

Browse files
committed
Termination analysis: add support for array creation
1 parent 8ebb2e2 commit 2309a5a

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

Changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Exception analysis: also report on exceptions in toplevel expressions, not just variable bindings.
33
- Exception analysis: add support for Belt modules.
44
- Termination analysis: add support for try blocks.
5+
- Termination analysis: add support for array creation.
56

67
# 2.14.0
78
- Fix issue where type dependencies could get lost if the last file processed is an interface file.

examples/termination/src/TestCyberTruck.bs.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/termination/src/TestCyberTruck.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ let rec testTry = () => {
443443
progress()
444444
testTry()
445445
| _ =>
446-
progress()
446+
let _ = [(), progress(), ()]
447447
testTry()
448448
}
449449
}

examples/termination/src/termination.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@
598598
Termination Analysis for testTry
599599

600600
Termination Analysis
601-
File "./TestCyberTruck.res", line 440, characters 18-146
601+
File "./TestCyberTruck.res", line 440, characters 18-164
602602
testTry returns Progress with trace [progress:Progress; testTry:Progress || progress:Progress; testTry:Progress]
603603

604604
Termination Analysis Stats

src/Arnold.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,8 @@ module Compile = {
11441144
| Texp_setfield(e1, _loc, _desc, e2) =>
11451145
[e1, e2] |> List.map(expression(~ctx)) |> Command.unorderedSequence
11461146

1147-
| Texp_tuple(expressions) =>
1147+
| Texp_tuple(expressions)
1148+
| Texp_array(expressions) =>
11481149
expressions |> List.map(expression(~ctx)) |> Command.unorderedSequence
11491150

11501151
| Texp_assert(_) => Command.nothing
@@ -1154,7 +1155,6 @@ module Compile = {
11541155
let cCases = cases |> List.map(case(~ctx)) |> Command.nondet;
11551156
Command.(cE +++ cCases);
11561157
| Texp_variant(_) => assert(false)
1157-
| Texp_array(_) => assert(false)
11581158
| Texp_while(_) => assert(false)
11591159
| Texp_for(_) => assert(false)
11601160
| Texp_send(_) => assert(false)

0 commit comments

Comments
 (0)