Skip to content

Commit a37a32e

Browse files
authored
Merge pull request #32 from peterhuene/README
Update the READMEs.
2 parents 69a41d3 + 8ab163e commit a37a32e

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

LANGUAGE.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ statements, let statements, and export statements.
1414

1515
### Import Statements
1616

17-
A composition may explicitly import an item in the resulting composition;
18-
this is done with the `import` statement.
17+
A composition may explicitly import an item with the `import` statement.
1918

2019
Assume a `greeter` interface definition published to a registry:
2120

@@ -44,7 +43,7 @@ The `as` keyword can be used to rename the imported item:
4443
import greeter as my-greeter: example:greeter/greeter;
4544
```
4645

47-
Here the name of the import becomes `my-greeter`; the name may be any valid
46+
Here the name of the import becomes `my-greeter`; the name may be any valid
4847
import name in the component model.
4948

5049
The local name `greeter` can then be used to refer to the imported item from
@@ -282,7 +281,7 @@ The above behavior differs from JavaScript's spread argument syntax, which is
282281
the inspiration for this syntax, because component instantiation arguments are
283282
_named_ and not _positional_.
284283

285-
Additionally, it is an evaluation error if a spread argument has no matching
284+
Additionally, it is an evaluation error if a spread argument has no matching
286285
exports.
287286

288287
#### Access Expressions
@@ -297,7 +296,7 @@ let i = new a:b { ... };
297296
let s = i.outgoing-stream;
298297
``````
299298
300-
Taking the above example into consideration, access expressions use the
299+
Taking the above example into consideration, access expressions use the
301300
following rules to determine the name of the export:
302301
303302
* If component `a:b` has exactly one export with `outgoing-stream` as the final
@@ -347,7 +346,7 @@ In the above example, component `a:b` is instantiated and the local name
347346
in this example to be a function of type `func()`.
348347

349348
The `export` statement is then used to export the `my-run` function from the
350-
composition using the export name `run` as that is the name that was accessed
349+
composition using the export name `run` as that is the name that was accessed
351350
from the instance.
352351

353352
The `as` keyword can be used to rename the export:
@@ -357,7 +356,7 @@ let my-run = new a:b { ... }.run;
357356
export my-run as "my-run";
358357
```
359358

360-
Like spread arguments in `new` expressions, exports of an instance may be
359+
Like spread arguments in `new` expressions, exports of an instance may be
361360
_spread_ as exports of the composition:
362361

363362
```wac
@@ -396,7 +395,7 @@ export run;
396395
export my-instance...;
397396
```
398397

399-
Then the `run` function exported by the composition will be from the instance
398+
Then the `run` function exported by the composition will be from the instance
400399
named `b:c` and not the instance named `a:b`.
401400

402401
### WAC Grammar

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ deps/
9797
The `--deps-dir` CLI option may be used to specify a different directory to
9898
search for dependencies.
9999
100+
Dependencies may also be specified with the `--dep` CLI option:
101+
102+
```
103+
wac encode --dep foo:bar=./baz.wasm -o output.wasm input.wac
104+
```
105+
106+
By default, dependencies must be binary-encoded WebAssembly components; to
107+
enable support for WAT files, use the `wat` build-time feature.
108+
100109
If the `registry` build-time feature is enabled, then dependencies may be
101110
automatically resolved from a Warg registry and do not need to exist in the
102-
`deps` subdirectory.
111+
`deps` subdirectory or specified via the `--dep` CLI option.

0 commit comments

Comments
 (0)