Skip to content

Commit ec6ae34

Browse files
authored
Parse assert as a regular function (#6180)
1 parent 95fdb37 commit ec6ae34

File tree

91 files changed

+1010
-1022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1010
-1022
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
1313
# 11.0.0-alpha.5 (Unreleased)
1414

15+
#### :boom: Breaking Change
16+
17+
- Parse `assert` as a regular function. `assert` is no longer a unary expression. Example: before `assert 1 == 2` is parsed as `(assert 1) == 2`, now it is parsed as `assert(1 == 2)`. https://github.com/rescript-lang/rescript-compiler/pull/6180
18+
1519
# 11.0.0-alpha.4
1620

1721
#### :rocket: Main New Feature

jscomp/test/adt_optimize_test.res

1 Byte
Binary file not shown.

jscomp/test/bb.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ let ff = x =>
1010
| "a" => #a
1111
| "b" => #b
1212
| "c" => #c
13-
| _ => assert false
13+
| _ => assert(false)
1414
}
1515

1616
let test = x =>
1717
switch switch x {
1818
| "a" => #a
1919
| "b" => #b
2020
| "c" => #c
21-
| _ => assert false
21+
| _ => assert(false)
2222
} {
2323
| #a => "a"
2424
| #b => "b"

jscomp/test/bdd.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ let resize = newSize => {
5757

5858
newArr[ind] = list{n, ...newArr[ind]}
5959
copyBucket(ns)
60-
| _ => assert false
60+
| _ => assert(false)
6161
}
6262
}
6363

@@ -118,7 +118,7 @@ let mkNode = (low, v, high) => {
118118
} else {
119119
lookup(ns)
120120
}
121-
| _ => assert false
121+
| _ => assert(false)
122122
}
123123
}
124124

@@ -298,7 +298,7 @@ let main = () => {
298298
for i in 1 to ntests {
299299
succeeded := succeeded.contents && test_hwb(bdd, random_vars(n))
300300
}
301-
assert succeeded.contents
301+
assert(succeeded.contents)
302302
}
303303

304304
let _ = main()

0 commit comments

Comments
 (0)