File: contrib-transform-wast-identifier-to-index.md

package info (click to toggle)
node-webassemblyjs 1.11.0%2Bdfsg%2B~cs10.10.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,040 kB
  • sloc: javascript: 28,630; makefile: 84; sh: 42; ansic: 16
file content (48 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: wast-identifer-to-index transformation
id: contrib-transform-wast-identifier-to-index
---

Transforms some WAST semantics into WAT or WASM (actually specs semantics).

WAST allows you some handy shortcuts, like providing the identifier of a local instead of its index.

## Example (refering to a param)

### In

```wast
(func (param $name i32)
 (get_local $name)
)
```

### Out

```wast
(func (param i32)
 (get_local 0)
)
```

## Example (refering to a func)

### In

```wast
(func $name)
(func
 (call $name)
)
```

### Out

```wast
;; first function in moduleinst.funcaddrs (index 0)
(func $name)

(func
 (call 0)
)
```