From a58281ca114359cd6e65f5daaf086636aa18b0b0 Mon Sep 17 00:00:00 2001
From: Thomas Lively <tlively@google.com>
Date: Thu, 4 Jan 2024 14:25:18 -0800
Subject: Require `then` and `else` with `if` (#6201)

We previously supported (and primarily used) a non-standard text format for
conditionals in which the condition, if-true expression, and if-false expression
were all simply s-expression children of the `if` expression. The standard text
format, however, requires the use of `then` and `else` forms to introduce the
if-true and if-false arms of the conditional. Update the legacy text parser to
require the standard format and update all tests to match. Update the printer to
print the standard format as well.

The .wast and .wat test inputs were mechanically updated with this script:
https://gist.github.com/tlively/85ae7f01f92f772241ec994c840ccbb1
---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'CHANGELOG.md')

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fc9847e1..a505a9509 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ Current Trunk
 -------------
  - The `tuple.make` pseudoinstruction now requires an immediate giving its
    arity. For example, to make a tuple of two elements, use `tuple.make 2`.
+ - The text format for `if` expressions now requires `then` and `else` to
+   introduce the two branch arms, matching the spec.
 
 v116
 ----
-- 
cgit v1.2.3