Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse assert as a regular function #6180

Merged
merged 27 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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