-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thorsten Hans <[email protected]>
- Loading branch information
1 parent
1a25eaa
commit e76b2d3
Showing
9 changed files
with
107 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package example:component | ||
package example:component; | ||
|
||
world example { | ||
export add: func(x: s32, y: s32) -> s32 | ||
export add: func(x: s32, y: s32) -> s32; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,26 +6,26 @@ add an `op` enum that delineates each operator. The following example interface | |
has an `add` operation: | ||
|
||
```wit | ||
package docs:[email protected] | ||
package docs:[email protected]; | ||
interface calculate { | ||
enum op { | ||
add, | ||
} | ||
eval-expression: func(op: op, x: u32, y: u32) -> u32 | ||
eval-expression: func(op: op, x: u32, y: u32) -> u32; | ||
} | ||
interface add { | ||
add: func(a: u32, b: u32) -> u32 | ||
add: func(a: u32, b: u32) -> u32; | ||
} | ||
world adder { | ||
export add | ||
export add; | ||
} | ||
world calculator { | ||
export calculate | ||
import add | ||
export calculate; | ||
import add; | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package docs:calculator@0.1.0 | ||
package docs:calculator@0.1.0; | ||
|
||
interface calculate { | ||
enum op { | ||
add, | ||
} | ||
eval-expression: func(op: op, x: u32, y: u32) -> u32 | ||
eval-expression: func(op: op, x: u32, y: u32) -> u32; | ||
} | ||
|
||
interface add { | ||
add: func(a: u32, b: u32) -> u32 | ||
add: func(a: u32, b: u32) -> u32; | ||
} | ||
|
||
world adder { | ||
export add | ||
export add; | ||
} | ||
|
||
world calculator { | ||
export calculate | ||
import add | ||
export calculate; | ||
import add; | ||
} | ||
|
||
world app { | ||
import calculate | ||
} | ||
import calculate; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,28 +16,28 @@ When you compose components, you wire up the imports of one "primary" component | |
|
||
For example, consider two components with the following worlds: | ||
|
||
``` | ||
```wit | ||
// component `validator` | ||
package docs:[email protected] | ||
package docs:[email protected]; | ||
interface validator { | ||
validate-text: func(text: string) -> string | ||
validate-text: func(text: string) -> string; | ||
} | ||
world { | ||
export validator | ||
import docs:regex/[email protected] | ||
export validator; | ||
import docs:regex/[email protected]; | ||
} | ||
// component 'regex' | ||
package docs:[email protected] | ||
package docs:[email protected]; | ||
interface match { | ||
first-match: func(regex: string, text: string) -> string | ||
first-match: func(regex: string, text: string) -> string; | ||
} | ||
world { | ||
export match | ||
export match; | ||
} | ||
``` | ||
|
||
|
Oops, something went wrong.