Skip to content

Commit 06d5a6c

Browse files
committed
[Parser] Go back to "sub final" intead of "sub open"
The planned spec change to use "sub open" never came together, so the standard format remains "sub final".
1 parent 328bd7a commit 06d5a6c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/parser/parsers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ template<typename Ctx> MaybeResult<> subtype(Ctx& ctx) {
20942094
}
20952095

20962096
if (ctx.in.takeSExprStart("sub"sv)) {
2097-
if (ctx.in.takeKeyword("open"sv)) {
2097+
if (!ctx.in.takeKeyword("final"sv)) {
20982098
ctx.setOpen();
20992099
}
21002100
if (auto super = maybeTypeidx(ctx)) {

test/lit/wat-kitchen-sink.wast

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
;; CHECK: (rec
3131
;; CHECK-NEXT: (type $s0 (struct ))
32-
(type $s0 (sub (struct)))
32+
(type $s0 (struct))
3333
;; CHECK: (type $s1 (struct ))
3434
(type $s1 (struct (field)))
3535
)
@@ -198,17 +198,17 @@
198198
(type $any-array (array (mut anyref)))
199199

200200
(rec
201-
(type $void (sub open (func)))
201+
(type $void (sub (func)))
202202
)
203203

204204
;; CHECK: (type $subvoid (sub final $void (func)))
205-
(type $subvoid (sub $void (func)))
205+
(type $subvoid (sub final $void (func)))
206206

207-
(type $many (sub open (func (param $x i32) (param i64 f32) (param) (param $y f64)
207+
(type $many (sub (func (param $x i32) (param i64 f32) (param) (param $y f64)
208208
(result anyref (ref func)))))
209209

210210
;; CHECK: (type $submany (sub final $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
211-
(type $submany (sub $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
211+
(type $submany (sub final $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
212212

213213
;; imported memories
214214
(memory (export "mem") (export "mem2") (import "" "mem") 0)

0 commit comments

Comments
 (0)