Skip to content

Commit 36e0a93

Browse files
Update Docs.md
1 parent 96bb064 commit 36e0a93

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/WAT/Docs.docc/Docs.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,20 @@ WAST is an superset of WAT that includes additional directives for testing. You
3333
```swift
3434
import WAT
3535

36-
let wat = try parseWAST("""
36+
var wast = try parseWAST("""
3737
(module
3838
(func $add (param i32 i32) (result i32)
3939
local.get 0
4040
local.get 1
4141
i32.add)
4242
(export "add" (func $add))
4343
)
44-
4544
(assert_return (invoke "add" (i32.const 1) (i32.const 2)) (i32.const 3))
4645
""")
46+
47+
while let (directive, location) = try wast.nextDirective() {
48+
print("\(location): \(directive)")
49+
}
4750
```
4851

4952

0 commit comments

Comments
 (0)