Skip to content

Commit

Permalink
Parse assert as a regular function (#6180)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Apr 20, 2023
1 parent 95fdb37 commit ec6ae34
Show file tree
Hide file tree
Showing 91 changed files with 1,010 additions and 1,022 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# 11.0.0-alpha.5 (Unreleased)

#### :boom: Breaking Change

- 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

# 11.0.0-alpha.4

#### :rocket: Main New Feature
Expand Down
Binary file modified jscomp/test/adt_optimize_test.res
Binary file not shown.
4 changes: 2 additions & 2 deletions jscomp/test/bb.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ let ff = x =>
| "a" => #a
| "b" => #b
| "c" => #c
| _ => assert false
| _ => assert(false)
}

let test = x =>
switch switch x {
| "a" => #a
| "b" => #b
| "c" => #c
| _ => assert false
| _ => assert(false)
} {
| #a => "a"
| #b => "b"
Expand Down
6 changes: 3 additions & 3 deletions jscomp/test/bdd.res
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let resize = newSize => {

newArr[ind] = list{n, ...newArr[ind]}
copyBucket(ns)
| _ => assert false
| _ => assert(false)
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ let mkNode = (low, v, high) => {
} else {
lookup(ns)
}
| _ => assert false
| _ => assert(false)
}
}

Expand Down Expand Up @@ -298,7 +298,7 @@ let main = () => {
for i in 1 to ntests {
succeeded := succeeded.contents && test_hwb(bdd, random_vars(n))
}
assert succeeded.contents
assert(succeeded.contents)
}

let _ = main()
Expand Down

0 comments on commit ec6ae34

Please sign in to comment.