You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
( input <name>? <string> ) ;; read script or module from file
488
-
( output <name>? <string>? ) ;; output module to stout or file
488
+
( output <name>? <string>? ) ;; output module to stdout or file
489
489
```
490
490
Commands are executed in sequence. Commands taking an optional module name refer to the most recently defined module if no name is given. They are only possible after a module has been defined.
491
491
@@ -501,10 +501,10 @@ A module of the form `(module quote <string>*)` is given in textual form and wil
501
501
Usually, a module declaration implicitly instantiates the module,
502
502
that is, it defines both a module and an instance (of the same name).
503
503
Instantiation can be suppressed by adding the keyword `definition`.
504
-
A module declared as a definition only can then be instantiated explicitly, and multiple times, using the separate form `(module instance <inst_var> <module_name>)`.
504
+
A module declared as a definition only can then be instantiated explicitly, and multiple times, using the separate form `(module instance <instance_name> <module_name>)` (if only one name is given, it is the module name).
505
505
506
506
There are also a number of meta commands.
507
-
The `script` command is a simple mechanism to name sub-scripts themselves. This is mainly useful for converting scripts with the `output` command. Commands inside a `script` will be executed normally, but nested meta are expanded in place (`input`, recursively) or elided (`output`) in the named script.
507
+
The `script` command is a simple mechanism to name sub-scripts themselves. This is mainly useful for converting scripts with the `output` command. Commands inside a `script` will be executed normally, but nested meta commands are expanded in place (`input`, recursively) or elided (`output`) in the named script.
508
508
509
509
The `input` and `output` meta commands determine the requested file format from the file name extension. They can handle both `.wasm`, `.wat`, and `.wast` files. In the case of input, a `.wast` script will be recursively executed. Output additionally handles `.js` as a target, which will convert the referenced script to an equivalent, self-contained JavaScript runner. It also recognises `.bin.wast` specially, which creates a _binary script_ where module definitions are in binary, as defined below.
510
510
@@ -550,6 +550,7 @@ binscript: <cmd>*
550
550
551
551
cmd:
552
552
<module> ;; define, validate, and initialize module
553
+
<instance> ;; instantiate module
553
554
( register <string> <name>? ) ;; register module for imports
0 commit comments