Skip to content

Commit d462f0a

Browse files
authored
[interpreter] A few tweaks to README
1 parent 55741de commit d462f0a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

interpreter/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,14 @@ script: <cmd>*
431431
432432
cmd:
433433
<module> ;; define, validate, and possibly instantiate module
434-
<instance>
434+
<instance> ;; instantiate module
435435
( register <string> <name>? ) ;; register module instance for imports
436436
<action> ;; perform action and print results
437437
<assertion> ;; assert result of an action
438438
<meta> ;; meta command
439439
440440
module:
441-
...
441+
... ;; ordinary module syntax (see above)
442442
( module <name>? binary <string>* ) ;; module in binary format (may be malformed)
443443
( module <name>? quote <string>* ) ;; module quoted in text (may be malformed)
444444
( module definition <name>? binary ... ) ;; uninstantiated module
@@ -485,7 +485,7 @@ num_pat:
485485
meta:
486486
( script <name>? <script> ) ;; name a subscript
487487
( 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
489489
```
490490
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.
491491

@@ -501,10 +501,10 @@ A module of the form `(module quote <string>*)` is given in textual form and wil
501501
Usually, a module declaration implicitly instantiates the module,
502502
that is, it defines both a module and an instance (of the same name).
503503
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).
505505

506506
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.
508508

509509
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.
510510

@@ -550,6 +550,7 @@ binscript: <cmd>*
550550
551551
cmd:
552552
<module> ;; define, validate, and initialize module
553+
<instance> ;; instantiate module
553554
( register <string> <name>? ) ;; register module for imports
554555
<action> ;; perform action and print results
555556
<assertion> ;; assert result of an action

0 commit comments

Comments
 (0)