diff --git a/WIT.md b/WIT.md index fed12046b..0eaca7f5a 100644 --- a/WIT.md +++ b/WIT.md @@ -89,7 +89,7 @@ keywords is still in flux at this time but the current set is: keyword ::= 'use' | 'type' | 'resource' - | 'function' + | 'func' | 'u8' | 'u16' | 'u32' | 'u64' | 's8' | 's16' | 's32' | 's64' | 'float32' | 'float64' @@ -375,9 +375,9 @@ parameters, and results. Functions can optionally also be declared as `async` functions. ```wit -thunk: function() -fibonacci: function(n: u32) -> u32 -sleep: async function(ms: u64) +thunk: func() +fibonacci: func(n: u32) -> u32 +sleep: async func(ms: u64) ``` Specifically functions have the structure: @@ -410,10 +410,10 @@ of the including resource, unless the function is flagged as `static`. resource file-descriptor resource request { - static new: function() -> request + static new: func() -> request - body: async function() -> list - headers: function() -> list + body: async func() -> list + headers: func() -> list } ``` @@ -506,9 +506,9 @@ by '-'s starts with a `XID_Start` scalar value with a zero Canonical Combining Class: ```wit -foo: function(bar: u32) +foo: func(bar: u32) -red-green-blue: function(r: u32, g: u32, b: u32) +red-green-blue: func(r: u32, g: u32, b: u32) ``` This form can't name identifiers which have the same name as wit keywords, so @@ -516,12 +516,12 @@ the second form is the same syntax with the same restrictions as the first, but prefixed with '%': ```wit -%foo: function(%bar: u32) +%foo: func(%bar: u32) -%red-green-blue: function(%r: u32, %g: u32, %b: u32) +%red-green-blue: func(%r: u32, %g: u32, %b: u32) // This form also supports identifiers that would otherwise be keywords. -%variant: function(%enum: s32) +%variant: func(%enum: s32) ``` [kebab-case]: https://en.wikipedia.org/wiki/Letter_case#Kebab_case diff --git a/crates/gen-wasmtime/tests/codegen.rs b/crates/gen-wasmtime/tests/codegen.rs index 54d05c57d..573be4b8f 100644 --- a/crates/gen-wasmtime/tests/codegen.rs +++ b/crates/gen-wasmtime/tests/codegen.rs @@ -41,7 +41,7 @@ mod imports { mod async_tests { mod not_async { wit_bindgen_wasmtime::export!({ - src["x"]: "foo: function()", + src["x"]: "foo: func()", async: ["bar"], }); @@ -54,8 +54,8 @@ mod async_tests { mod one_async { wit_bindgen_wasmtime::export!({ src["x"]: " - foo: function() -> list - bar: function() + foo: func() -> list + bar: func() ", async: ["bar"], }); @@ -74,8 +74,8 @@ mod async_tests { mod one_async_export { wit_bindgen_wasmtime::import!({ src["x"]: " - foo: function(x: list) - bar: function() + foo: func(x: list) + bar: func() ", async: ["bar"], }); @@ -84,7 +84,7 @@ mod async_tests { wit_bindgen_wasmtime::export!({ src["x"]: " resource y { - z: function() -> string + z: func() -> string } ", async: [], @@ -95,13 +95,13 @@ mod async_tests { mod custom_errors { wit_bindgen_wasmtime::export!({ src["x"]: " - foo: function() - bar: function() -> expected + foo: func() + bar: func() -> expected enum errno { bad1, bad2, } - baz: function() -> expected + baz: func() -> expected ", custom_error: true, }); diff --git a/crates/parser/src/ast.rs b/crates/parser/src/ast.rs index a688160df..dfd5b7b38 100644 --- a/crates/parser/src/ast.rs +++ b/crates/parser/src/ast.rs @@ -390,10 +390,10 @@ impl<'a> Value<'a> { let name = parse_id(tokens)?; tokens.expect(Token::Colon)?; - let kind = if tokens.eat(Token::Function)? { + let kind = if tokens.eat(Token::Func)? { parse_func(tokens, false)? } else if tokens.eat(Token::Async)? { - tokens.expect(Token::Function)?; + tokens.expect(Token::Func)?; parse_func(tokens, true)? } else { ValueKind::Global(Type::parse(tokens)?) diff --git a/crates/parser/src/ast/lex.rs b/crates/parser/src/ast/lex.rs index 55927f96e..f77587fdc 100644 --- a/crates/parser/src/ast/lex.rs +++ b/crates/parser/src/ast/lex.rs @@ -49,7 +49,7 @@ pub enum Token { Use, Type, Resource, - Function, + Func, U8, U16, U32, @@ -237,7 +237,7 @@ impl<'a> Tokenizer<'a> { "use" => Use, "type" => Type, "resource" => Resource, - "function" => Function, + "func" => Func, "u8" => U8, "u16" => U16, "u32" => U32, @@ -499,7 +499,7 @@ impl Token { Use => "keyword `use`", Type => "keyword `type`", Resource => "keyword `resource`", - Function => "keyword `function`", + Func => "keyword `func`", U8 => "keyword `u8`", U16 => "keyword `u16`", U32 => "keyword `u32`", @@ -675,6 +675,18 @@ fn test_tokenizer() { assert_eq!(collect("%bool").unwrap(), vec![Token::ExplicitId]); assert_eq!(collect("%").unwrap(), vec![Token::ExplicitId]); + assert_eq!(collect("func").unwrap(), vec![Token::Func]); + assert_eq!( + collect("a: func()").unwrap(), + vec![ + Token::Id, + Token::Colon, + Token::Func, + Token::LeftParen, + Token::RightParen + ] + ); + assert!(collect("\u{149}").is_err(), "strongly discouraged"); assert!(collect("\u{673}").is_err(), "strongly discouraged"); assert!(collect("\u{17a3}").is_err(), "strongly discouraged"); diff --git a/crates/parser/tests/ui/async.wit b/crates/parser/tests/ui/async.wit index 9b729e48a..70ec80d03 100644 --- a/crates/parser/tests/ui/async.wit +++ b/crates/parser/tests/ui/async.wit @@ -1,9 +1,9 @@ -a: async function() -b: async function(x: s32) -c: async function() -> u32 +a: async func() +b: async func(x: s32) +c: async func() -> u32 resource y { - a: async function() - b: async function(x: s32) - c: async function() -> u32 + a: async func() + b: async func(x: s32) + c: async func() -> u32 } diff --git a/crates/parser/tests/ui/embedded.wit.md b/crates/parser/tests/ui/embedded.wit.md index 56dc0366d..77342a95d 100644 --- a/crates/parser/tests/ui/embedded.wit.md +++ b/crates/parser/tests/ui/embedded.wit.md @@ -3,7 +3,7 @@ containing stuff, and also some code blocks, wit and other. ```wit -x: function() +x: func() ``` Intervening content, including a non-wit codeblock: @@ -12,7 +12,7 @@ function func() {} ``` ```wit -y: function() +y: func() ``` ## A new section @@ -20,5 +20,5 @@ y: function() In which, another wit code block! ```wit -z: function() +z: func() ``` diff --git a/crates/parser/tests/ui/functions.wit b/crates/parser/tests/ui/functions.wit index 185ffcfc8..44cbe832e 100644 --- a/crates/parser/tests/ui/functions.wit +++ b/crates/parser/tests/ui/functions.wit @@ -1,7 +1,7 @@ -f1: function() -f2: function(a: u32) -f3: function(a: u32,) -f4: function() -> u32 -f6: function() -> tuple -f7: function(a: float32, b: float32) -> tuple -f8: function(a: option) -> expected +f1: func() +f2: func(a: u32) +f3: func(a: u32,) +f4: func() -> u32 +f6: func() -> tuple +f7: func(a: float32, b: float32) -> tuple +f8: func(a: option) -> expected diff --git a/crates/parser/tests/ui/parse-fail/async.wit.result b/crates/parser/tests/ui/parse-fail/async.wit.result index 4ff54f565..c20607287 100644 --- a/crates/parser/tests/ui/parse-fail/async.wit.result +++ b/crates/parser/tests/ui/parse-fail/async.wit.result @@ -1,4 +1,4 @@ -expected keyword `function`, found eof +expected keyword `func`, found eof --> tests/ui/parse-fail/async.wit:3:1 | 3 | diff --git a/crates/parser/tests/ui/parse-fail/async1.wit.result b/crates/parser/tests/ui/parse-fail/async1.wit.result index 9907902ac..caab40476 100644 --- a/crates/parser/tests/ui/parse-fail/async1.wit.result +++ b/crates/parser/tests/ui/parse-fail/async1.wit.result @@ -1,4 +1,4 @@ -expected keyword `function`, found '(' +expected keyword `func`, found '(' --> tests/ui/parse-fail/async1.wit:2:9 | 2 | a: async() diff --git a/crates/parser/tests/ui/parse-fail/bad-resource2.wit b/crates/parser/tests/ui/parse-fail/bad-resource2.wit index 847feab5e..585045a38 100644 --- a/crates/parser/tests/ui/parse-fail/bad-resource2.wit +++ b/crates/parser/tests/ui/parse-fail/bad-resource2.wit @@ -1,6 +1,6 @@ // parse-fail resource x { - x: function() - x: function() + x: func() + x: func() } diff --git a/crates/parser/tests/ui/parse-fail/bad-resource2.wit.result b/crates/parser/tests/ui/parse-fail/bad-resource2.wit.result index b1a69c9d0..661e879fe 100644 --- a/crates/parser/tests/ui/parse-fail/bad-resource2.wit.result +++ b/crates/parser/tests/ui/parse-fail/bad-resource2.wit.result @@ -1,5 +1,5 @@ "x" defined twice in this resource --> tests/ui/parse-fail/bad-resource2.wit:5:3 | - 5 | x: function() + 5 | x: func() | ^ \ No newline at end of file diff --git a/crates/parser/tests/ui/parse-fail/duplicate-functions.wit b/crates/parser/tests/ui/parse-fail/duplicate-functions.wit index 5ed60b83d..0d8ebe9ac 100644 --- a/crates/parser/tests/ui/parse-fail/duplicate-functions.wit +++ b/crates/parser/tests/ui/parse-fail/duplicate-functions.wit @@ -1,4 +1,4 @@ // parse-fail -foo: function() -foo: function() +foo: func() +foo: func() diff --git a/crates/parser/tests/ui/parse-fail/duplicate-functions.wit.result b/crates/parser/tests/ui/parse-fail/duplicate-functions.wit.result index 6bb3ccc58..1d6aeb05c 100644 --- a/crates/parser/tests/ui/parse-fail/duplicate-functions.wit.result +++ b/crates/parser/tests/ui/parse-fail/duplicate-functions.wit.result @@ -1,5 +1,5 @@ "foo" defined twice --> tests/ui/parse-fail/duplicate-functions.wit:4:1 | - 4 | foo: function() + 4 | foo: func() | ^-- \ No newline at end of file diff --git a/crates/parser/tests/ui/resource.wit b/crates/parser/tests/ui/resource.wit index 72fb4e1af..376c2d9ec 100644 --- a/crates/parser/tests/ui/resource.wit +++ b/crates/parser/tests/ui/resource.wit @@ -3,9 +3,9 @@ resource b resource c resource d {} resource e { - x: function() + x: func() } resource f { - x: function() - y: function() + x: func() + y: func() } diff --git a/crates/parser/tests/ui/type-then-eof.wit b/crates/parser/tests/ui/type-then-eof.wit index 6965d5218..e5f657351 100644 --- a/crates/parser/tests/ui/type-then-eof.wit +++ b/crates/parser/tests/ui/type-then-eof.wit @@ -1 +1 @@ -foo: function() -> string \ No newline at end of file +foo: func() -> string \ No newline at end of file diff --git a/crates/parser/tests/ui/wasi-clock.wit b/crates/parser/tests/ui/wasi-clock.wit index b5e4f7ae4..7f360b925 100644 --- a/crates/parser/tests/ui/wasi-clock.wit +++ b/crates/parser/tests/ui/wasi-clock.wit @@ -8,8 +8,8 @@ use { clockid, timestamp, errno } from wasi // Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, // return `errno::inval`. // Note: This is similar to `clock-getres` in POSIX. -res-get: function(id: clockid) -> expected +res-get: func(id: clockid) -> expected // Return the time value of a clock. // Note: This is similar to `clock-gettime` in POSIX. -time-get: function(id: clockid, precision: timestamp) -> expected +time-get: func(id: clockid, precision: timestamp) -> expected diff --git a/crates/parser/tests/ui/wasi-http.wit b/crates/parser/tests/ui/wasi-http.wit index 243d62422..67e006180 100644 --- a/crates/parser/tests/ui/wasi-http.wit +++ b/crates/parser/tests/ui/wasi-http.wit @@ -31,14 +31,14 @@ // // Note: the `blocking` attribute means that different lowering can be generated for this // function, either based on synchronous, blocking calls, or on a callback-style interface. -fetch: /*blocking*/ function(req: handle request) -> handle response +fetch: /*blocking*/ func(req: handle request) -> handle response /// A request resource, with lots of things missing for now. // Note: `resource` blocks serve two purposes: // 1. namespacing the definition of a Handle type with functions for operating on that handle // 2. providing a way to define said functions such that they implicitly take the handle itself as // the first argument. E.g., `method` in `request` is roughly equivalent to -// `request::method: function(self: handle request) -> (string)` +// `request::method: func(self: handle request) -> (string)` // ("Roughly" because the `resource` semantics allow us to generate better bindings for languages // that have a concept of implicit receivers, such as `this` in JS.) resource request { @@ -47,26 +47,26 @@ resource request { /// @return req - returns a new `request` // Note: `static` here simply means that no implicit receiver argument will be passed. // I.e., this is ~roughly~ analogous to a top-level definition of - // `request::request: function() -> (req: handle request)` + // `request::request: func() -> (req: handle request)` // whereas without `static`, it'd be analogous to - // `request::request: function(self: handle) -> (req: handle)` - static request: function() -> handle request + // `request::request: func(self: handle) -> (req: handle)` + static request: func() -> handle request - method: function() -> string + method: func() -> string // Note: We could consider allowing the parens to be omitted for single return values, like so: - headers: function() -> handle headers + headers: func() -> handle headers // Note: Or we could even allow leaving off the return value identifier, making it use the // function name, like so: - body: function() -> handle body // This return type would be shorthand for `(body: body)` + body: func() -> handle body // This return type would be shorthand for `(body: body)` } /// A response resource, with lots of things missing for now. resource response { - status: function() -> u16 - headers: function() -> handle headers - body: function() -> handle body + status: func() -> u16 + headers: func() -> handle headers + body: func() -> handle body } /// A headers resource, with lots of things missing for now. @@ -75,7 +75,7 @@ resource headers { /// @param name - the header's name. /// @return values - the values for this header, seperated by ", " // Note: in reality, it might make sense for the values to be a sequence of some kind. - get: function(name: string) -> option + get: func(name: string) -> option } /// A body resource. @@ -86,13 +86,13 @@ resource body { /// @return result - a result containing the number of bytes written on success // TODO: check if `out-buffer` is the right way to express this // NOTE: s/expected/result/ - read: function(dest: list) -> expected + read: func(dest: list) -> expected /// Write to a body. /// @param source - source buffer to read from /// @return result - a result containing the number of bytes read on success // TODO: check if `in-buffer` is the right way to express this - write: function(source: list) -> expected + write: func(source: list) -> expected } /* @@ -102,13 +102,13 @@ interface nested-interface1 { resource better-request { // TODO: do we need to have a ctor with special semantics? E.g. to generate actual // constructors for languages that have them, such as JS? - new: function(request: handle) -> handle + new: func(request: handle) -> handle // Note: sadly, the sauce better-request uses must remain secret, so it doesn't actually // expose any of its functionality, and hence doesn't need any other methods. } /// Maps a request to an even better request. // Note: the containing scope's members are in scope in a nested interface - fun: function(request: handle) -> handle + fun: func(request: handle) -> handle } /// Another nested interface, doing something even more neat and elaborate. @@ -128,7 +128,7 @@ interface nested-interface2 { /// @return response - a boring, normal response /// @return added-shiny - the shiny! // Note: this just exists to demonstrate multiple return values, including their documentation - fun: function(request: better-request) -> tuple, handle> + fun: func(request: better-request) -> tuple, handle> } */ @@ -144,7 +144,7 @@ enum error { /// A function returning a Result, with the enum above as one of the options /// @return result - a `Result` containing either the desired number, or an `error` -maybe-number: function() -> expected +maybe-number: func() -> expected /// A simple struct record timestamp { diff --git a/crates/test-modules/modules/crates/flags/flags.wit b/crates/test-modules/modules/crates/flags/flags.wit index 1896057a1..343cc9013 100644 --- a/crates/test-modules/modules/crates/flags/flags.wit +++ b/crates/test-modules/modules/crates/flags/flags.wit @@ -37,10 +37,10 @@ flags flag64 { b56, b57, b58, b59, b60, b61, b62, b63, } -roundtrip-flag1: function(x: flag1) -> flag1 -roundtrip-flag2: function(x: flag2) -> flag2 -roundtrip-flag4: function(x: flag4) -> flag4 -roundtrip-flag8: function(x: flag8) -> flag8 -roundtrip-flag16: function(x: flag16) -> flag16 -roundtrip-flag32: function(x: flag32) -> flag32 -roundtrip-flag64: function(x: flag64) -> flag64 +roundtrip-flag1: func(x: flag1) -> flag1 +roundtrip-flag2: func(x: flag2) -> flag2 +roundtrip-flag4: func(x: flag4) -> flag4 +roundtrip-flag8: func(x: flag8) -> flag8 +roundtrip-flag16: func(x: flag16) -> flag16 +roundtrip-flag32: func(x: flag32) -> flag32 +roundtrip-flag64: func(x: flag64) -> flag64 diff --git a/crates/test-modules/modules/crates/lists/lists.wit b/crates/test-modules/modules/crates/lists/lists.wit index 546667cf1..7c2331044 100644 --- a/crates/test-modules/modules/crates/lists/lists.wit +++ b/crates/test-modules/modules/crates/lists/lists.wit @@ -1,28 +1,28 @@ -list-u8-param: function(x: list) -list-u16-param: function(x: list) -list-u32-param: function(x: list) -list-u64-param: function(x: list) -list-s8-param: function(x: list) -list-s16-param: function(x: list) -list-s32-param: function(x: list) -list-s64-param: function(x: list) -list-float32-param: function(x: list) -list-float64-param: function(x: list) +list-u8-param: func(x: list) +list-u16-param: func(x: list) +list-u32-param: func(x: list) +list-u64-param: func(x: list) +list-s8-param: func(x: list) +list-s16-param: func(x: list) +list-s32-param: func(x: list) +list-s64-param: func(x: list) +list-float32-param: func(x: list) +list-float64-param: func(x: list) -list-u8-ret: function() -> list -list-u16-ret: function() -> list -list-u32-ret: function() -> list -list-u64-ret: function() -> list -list-s8-ret: function() -> list -list-s16-ret: function() -> list -list-s32-ret: function() -> list -list-s64-ret: function() -> list -list-float32-ret: function() -> list -list-float64-ret: function() -> list +list-u8-ret: func() -> list +list-u16-ret: func() -> list +list-u32-ret: func() -> list +list-u64-ret: func() -> list +list-s8-ret: func() -> list +list-s16-ret: func() -> list +list-s32-ret: func() -> list +list-s64-ret: func() -> list +list-float32-ret: func() -> list +list-float64-ret: func() -> list -tuple-list: function(x: list>) -> list> -tuple-string-list: function(x: list>) -> list> -string-list: function(x: list) -> list +tuple-list: func(x: list>) -> list> +tuple-string-list: func(x: list>) -> list> +string-list: func(x: list) -> list record some-record { x: string, @@ -40,7 +40,7 @@ record other-record { b: string, c: list, } -record-list: function(x: list) -> list +record-list: func(x: list) -> list variant some-variant { a(string), @@ -53,7 +53,7 @@ variant other-variant { b(u32), c(string), } -variant-list: function(x: list) -> list +variant-list: func(x: list) -> list type load-store-all-sizes = list> -load-store-everything: function(a: load-store-all-sizes) -> load-store-all-sizes +load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes diff --git a/crates/test-modules/modules/crates/nested_a/nested_a.wit b/crates/test-modules/modules/crates/nested_a/nested_a.wit index cba2a10fc..1d02993d3 100644 --- a/crates/test-modules/modules/crates/nested_a/nested_a.wit +++ b/crates/test-modules/modules/crates/nested_a/nested_a.wit @@ -1 +1 @@ -inner: function(x: string) -> string +inner: func(x: string) -> string diff --git a/crates/test-modules/modules/crates/nested_b/nested_b.wit b/crates/test-modules/modules/crates/nested_b/nested_b.wit index 555bfe474..cc1743568 100644 --- a/crates/test-modules/modules/crates/nested_b/nested_b.wit +++ b/crates/test-modules/modules/crates/nested_b/nested_b.wit @@ -1 +1 @@ -outer: function(x: string) -> string +outer: func(x: string) -> string diff --git a/crates/test-modules/modules/crates/records/records.wit b/crates/test-modules/modules/crates/records/records.wit index 92afac641..298ec65ba 100644 --- a/crates/test-modules/modules/crates/records/records.wit +++ b/crates/test-modules/modules/crates/records/records.wit @@ -1,18 +1,18 @@ -tuple-arg: function(x: tuple) -tuple-result: function() -> tuple +tuple-arg: func(x: tuple) +tuple-result: func() -> tuple record empty {} -empty-arg: function(x: empty) -empty-result: function() -> empty +empty-arg: func(x: empty) +empty-result: func() -> empty record scalars { a: u32, b: u32, } -scalar-arg: function(x: scalars) -scalar-result: function() -> scalars +scalar-arg: func(x: scalars) +scalar-result: func() -> scalars flags really-flags { a, @@ -26,8 +26,8 @@ flags really-flags { i, } -flags-arg: function(x: really-flags) -flags-result: function() -> really-flags +flags-arg: func(x: really-flags) +flags-result: func() -> really-flags record aggregates { a: scalars, @@ -37,5 +37,5 @@ record aggregates { e: really-flags, } -aggregate-arg: function(x: aggregates) -aggregate-result: function() -> aggregates +aggregate-arg: func(x: aggregates) +aggregate-result: func() -> aggregates diff --git a/crates/test-modules/modules/crates/resources/resources.wit b/crates/test-modules/modules/crates/resources/resources.wit index b71c877ed..b1a8953f0 100644 --- a/crates/test-modules/modules/crates/resources/resources.wit +++ b/crates/test-modules/modules/crates/resources/resources.wit @@ -1,9 +1,9 @@ resource x -acquire-an-x: function(s: string) -> x -acquire-lots-of-x: function(s: list) -> list +acquire-an-x: func(s: string) -> x +acquire-lots-of-x: func(s: list) -> list -receive-an-x: function(val: x) -> string -receive-lots-of-x: function(vals: list) -> list +receive-an-x: func(val: x) -> string +receive-lots-of-x: func(vals: list) -> list -all-dropped: function() -> bool +all-dropped: func() -> bool diff --git a/crates/test-modules/modules/crates/types/types.wit b/crates/test-modules/modules/crates/types/types.wit index a5500dffb..53462e6ab 100644 --- a/crates/test-modules/modules/crates/types/types.wit +++ b/crates/test-modules/modules/crates/types/types.wit @@ -1,7 +1,7 @@ -a: function() -b: function(p0: u8, p1: s8, p2: u16, p3: s16, p4: u32, p5: s32, p6: u64, p7: s64) -> tuple -c: function(p0: float32, p1: float64) -> tuple -d: function(p0: string) -> string -e: function() -> string -f: function() -> tuple -g: function(p0: u32) -> u32 +a: func() +b: func(p0: u8, p1: s8, p2: u16, p3: s16, p4: u32, p5: s32, p6: u64, p7: s64) -> tuple +c: func(p0: float32, p1: float64) -> tuple +d: func(p0: string) -> string +e: func() -> string +f: func() -> tuple +g: func(p0: u32) -> u32 diff --git a/crates/test-modules/modules/crates/variants/variants.wit b/crates/test-modules/modules/crates/variants/variants.wit index 525bc1a4c..7a825ddc0 100644 --- a/crates/test-modules/modules/crates/variants/variants.wit +++ b/crates/test-modules/modules/crates/variants/variants.wit @@ -2,16 +2,16 @@ enum e1 { a, } -e1-arg: function(x: e1) -e1-result: function() -> e1 +e1-arg: func(x: e1) +e1-result: func() -> e1 union u1 { u32, float32, } -u1-arg: function(x: u1) -u1-result: function() -> u1 +u1-arg: func(x: u1) +u1-result: func() -> u1 record empty {} @@ -25,13 +25,13 @@ variant v1 { g(u32), } -v1-arg: function(x: v1) -v1-result: function() -> v1 +v1-arg: func(x: v1) +v1-result: func() -> v1 -bool-arg: function(x: bool) -bool-result: function() -> bool +bool-arg: func(x: bool) +bool-result: func() -> bool -option-arg: function( +option-arg: func( a: option, b: option>, c: option, @@ -40,7 +40,7 @@ option-arg: function( f: option, g: option>, ) -option-result: function() -> tuple< +option-result: func() -> tuple< option, option>, option, @@ -80,7 +80,7 @@ variant casts6 { b(tuple), } -casts: function( +casts: func( a: casts1, b: casts2, c: casts3, @@ -96,7 +96,7 @@ casts: function( casts6, > -expected-arg: function( +expected-arg: func( a: expected, b: expected, c: expected, @@ -104,7 +104,7 @@ expected-arg: function( e: expected, f: expected>, ) -expected-result: function() -> tuple< +expected-result: func() -> tuple< expected, expected, expected, diff --git a/crates/wasmlink/demo/markdown/markdown.wit b/crates/wasmlink/demo/markdown/markdown.wit index 5c1c388df..4db520bb4 100644 --- a/crates/wasmlink/demo/markdown/markdown.wit +++ b/crates/wasmlink/demo/markdown/markdown.wit @@ -1 +1 @@ -render: function(markdown: string) -> string +render: func(markdown: string) -> string diff --git a/crates/wasmlink/src/linker.rs b/crates/wasmlink/src/linker.rs index d16376c60..2e7443306 100644 --- a/crates/wasmlink/src/linker.rs +++ b/crates/wasmlink/src/linker.rs @@ -673,7 +673,7 @@ mod test { let a = Module::new( "a", &a, - [wit_parser::Interface::parse("a", "a: function(p: string)")?], + [wit_parser::Interface::parse("a", "a: func(p: string)")?], )?; let mut imports = HashMap::new(); @@ -702,7 +702,7 @@ mod test { let a = Module::new( "a", &a, - [wit_parser::Interface::parse("a", "a: function(p: string)")?], + [wit_parser::Interface::parse("a", "a: func(p: string)")?], )?; let mut imports = HashMap::new(); @@ -731,7 +731,7 @@ mod test { let a = Module::new( "a", &a, - [wit_parser::Interface::parse("a", "a: function(p: string)")?], + [wit_parser::Interface::parse("a", "a: func(p: string)")?], )?; let mut imports = HashMap::new(); diff --git a/crates/wasmlink/tests/flags.wit b/crates/wasmlink/tests/flags.wit index 1896057a1..343cc9013 100644 --- a/crates/wasmlink/tests/flags.wit +++ b/crates/wasmlink/tests/flags.wit @@ -37,10 +37,10 @@ flags flag64 { b56, b57, b58, b59, b60, b61, b62, b63, } -roundtrip-flag1: function(x: flag1) -> flag1 -roundtrip-flag2: function(x: flag2) -> flag2 -roundtrip-flag4: function(x: flag4) -> flag4 -roundtrip-flag8: function(x: flag8) -> flag8 -roundtrip-flag16: function(x: flag16) -> flag16 -roundtrip-flag32: function(x: flag32) -> flag32 -roundtrip-flag64: function(x: flag64) -> flag64 +roundtrip-flag1: func(x: flag1) -> flag1 +roundtrip-flag2: func(x: flag2) -> flag2 +roundtrip-flag4: func(x: flag4) -> flag4 +roundtrip-flag8: func(x: flag8) -> flag8 +roundtrip-flag16: func(x: flag16) -> flag16 +roundtrip-flag32: func(x: flag32) -> flag32 +roundtrip-flag64: func(x: flag64) -> flag64 diff --git a/crates/wasmlink/tests/incorrect-export.wit b/crates/wasmlink/tests/incorrect-export.wit index b7c3bb46e..123a6d78b 100644 --- a/crates/wasmlink/tests/incorrect-export.wit +++ b/crates/wasmlink/tests/incorrect-export.wit @@ -1 +1 @@ -f1: function() -> tuple +f1: func() -> tuple diff --git a/crates/wasmlink/tests/incorrect-free.wit b/crates/wasmlink/tests/incorrect-free.wit index 2a48607df..53ca08bc9 100644 --- a/crates/wasmlink/tests/incorrect-free.wit +++ b/crates/wasmlink/tests/incorrect-free.wit @@ -1 +1 @@ -f1: function(a: string) +f1: func(a: string) diff --git a/crates/wasmlink/tests/incorrect-realloc.wit b/crates/wasmlink/tests/incorrect-realloc.wit index 2a48607df..53ca08bc9 100644 --- a/crates/wasmlink/tests/incorrect-realloc.wit +++ b/crates/wasmlink/tests/incorrect-realloc.wit @@ -1 +1 @@ -f1: function(a: string) +f1: func(a: string) diff --git a/crates/wasmlink/tests/lists.wit b/crates/wasmlink/tests/lists.wit index 546667cf1..7c2331044 100644 --- a/crates/wasmlink/tests/lists.wit +++ b/crates/wasmlink/tests/lists.wit @@ -1,28 +1,28 @@ -list-u8-param: function(x: list) -list-u16-param: function(x: list) -list-u32-param: function(x: list) -list-u64-param: function(x: list) -list-s8-param: function(x: list) -list-s16-param: function(x: list) -list-s32-param: function(x: list) -list-s64-param: function(x: list) -list-float32-param: function(x: list) -list-float64-param: function(x: list) +list-u8-param: func(x: list) +list-u16-param: func(x: list) +list-u32-param: func(x: list) +list-u64-param: func(x: list) +list-s8-param: func(x: list) +list-s16-param: func(x: list) +list-s32-param: func(x: list) +list-s64-param: func(x: list) +list-float32-param: func(x: list) +list-float64-param: func(x: list) -list-u8-ret: function() -> list -list-u16-ret: function() -> list -list-u32-ret: function() -> list -list-u64-ret: function() -> list -list-s8-ret: function() -> list -list-s16-ret: function() -> list -list-s32-ret: function() -> list -list-s64-ret: function() -> list -list-float32-ret: function() -> list -list-float64-ret: function() -> list +list-u8-ret: func() -> list +list-u16-ret: func() -> list +list-u32-ret: func() -> list +list-u64-ret: func() -> list +list-s8-ret: func() -> list +list-s16-ret: func() -> list +list-s32-ret: func() -> list +list-s64-ret: func() -> list +list-float32-ret: func() -> list +list-float64-ret: func() -> list -tuple-list: function(x: list>) -> list> -tuple-string-list: function(x: list>) -> list> -string-list: function(x: list) -> list +tuple-list: func(x: list>) -> list> +tuple-string-list: func(x: list>) -> list> +string-list: func(x: list) -> list record some-record { x: string, @@ -40,7 +40,7 @@ record other-record { b: string, c: list, } -record-list: function(x: list) -> list +record-list: func(x: list) -> list variant some-variant { a(string), @@ -53,7 +53,7 @@ variant other-variant { b(u32), c(string), } -variant-list: function(x: list) -> list +variant-list: func(x: list) -> list type load-store-all-sizes = list> -load-store-everything: function(a: load-store-all-sizes) -> load-store-all-sizes +load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes diff --git a/crates/wasmlink/tests/missing-export.wit b/crates/wasmlink/tests/missing-export.wit index 53b206512..4ef8dce25 100644 --- a/crates/wasmlink/tests/missing-export.wit +++ b/crates/wasmlink/tests/missing-export.wit @@ -1 +1 @@ -f1: function() +f1: func() diff --git a/crates/wasmlink/tests/missing-free.wit b/crates/wasmlink/tests/missing-free.wit index 2a48607df..53ca08bc9 100644 --- a/crates/wasmlink/tests/missing-free.wit +++ b/crates/wasmlink/tests/missing-free.wit @@ -1 +1 @@ -f1: function(a: string) +f1: func(a: string) diff --git a/crates/wasmlink/tests/missing-memory.wit b/crates/wasmlink/tests/missing-memory.wit index 2a48607df..53ca08bc9 100644 --- a/crates/wasmlink/tests/missing-memory.wit +++ b/crates/wasmlink/tests/missing-memory.wit @@ -1 +1 @@ -f1: function(a: string) +f1: func(a: string) diff --git a/crates/wasmlink/tests/missing-realloc.wit b/crates/wasmlink/tests/missing-realloc.wit index 2a48607df..53ca08bc9 100644 --- a/crates/wasmlink/tests/missing-realloc.wit +++ b/crates/wasmlink/tests/missing-realloc.wit @@ -1 +1 @@ -f1: function(a: string) +f1: func(a: string) diff --git a/crates/wasmlink/tests/not-adapted.wit b/crates/wasmlink/tests/not-adapted.wit index c34f434a4..b20a12c8a 100644 --- a/crates/wasmlink/tests/not-adapted.wit +++ b/crates/wasmlink/tests/not-adapted.wit @@ -1 +1 @@ -f1: function(a: s32, b: s64, c: float32, d: float64) -> u32 +f1: func(a: s32, b: s64, c: float32, d: float64) -> u32 diff --git a/crates/wasmlink/tests/records.wit b/crates/wasmlink/tests/records.wit index 92afac641..298ec65ba 100644 --- a/crates/wasmlink/tests/records.wit +++ b/crates/wasmlink/tests/records.wit @@ -1,18 +1,18 @@ -tuple-arg: function(x: tuple) -tuple-result: function() -> tuple +tuple-arg: func(x: tuple) +tuple-result: func() -> tuple record empty {} -empty-arg: function(x: empty) -empty-result: function() -> empty +empty-arg: func(x: empty) +empty-result: func() -> empty record scalars { a: u32, b: u32, } -scalar-arg: function(x: scalars) -scalar-result: function() -> scalars +scalar-arg: func(x: scalars) +scalar-result: func() -> scalars flags really-flags { a, @@ -26,8 +26,8 @@ flags really-flags { i, } -flags-arg: function(x: really-flags) -flags-result: function() -> really-flags +flags-arg: func(x: really-flags) +flags-result: func() -> really-flags record aggregates { a: scalars, @@ -37,5 +37,5 @@ record aggregates { e: really-flags, } -aggregate-arg: function(x: aggregates) -aggregate-result: function() -> aggregates +aggregate-arg: func(x: aggregates) +aggregate-result: func() -> aggregates diff --git a/crates/wasmlink/tests/resource-incorrect-drop.wit b/crates/wasmlink/tests/resource-incorrect-drop.wit index 561c51d91..df0f737fd 100644 --- a/crates/wasmlink/tests/resource-incorrect-drop.wit +++ b/crates/wasmlink/tests/resource-incorrect-drop.wit @@ -1,3 +1,3 @@ resource x -acquire-an-x: function() -> x +acquire-an-x: func() -> x diff --git a/crates/wasmlink/tests/resources-missing-drop.wit b/crates/wasmlink/tests/resources-missing-drop.wit index 561c51d91..df0f737fd 100644 --- a/crates/wasmlink/tests/resources-missing-drop.wit +++ b/crates/wasmlink/tests/resources-missing-drop.wit @@ -1,3 +1,3 @@ resource x -acquire-an-x: function() -> x +acquire-an-x: func() -> x diff --git a/crates/wasmlink/tests/resources.wit b/crates/wasmlink/tests/resources.wit index b71c877ed..b1a8953f0 100644 --- a/crates/wasmlink/tests/resources.wit +++ b/crates/wasmlink/tests/resources.wit @@ -1,9 +1,9 @@ resource x -acquire-an-x: function(s: string) -> x -acquire-lots-of-x: function(s: list) -> list +acquire-an-x: func(s: string) -> x +acquire-lots-of-x: func(s: list) -> list -receive-an-x: function(val: x) -> string -receive-lots-of-x: function(vals: list) -> list +receive-an-x: func(val: x) -> string +receive-lots-of-x: func(vals: list) -> list -all-dropped: function() -> bool +all-dropped: func() -> bool diff --git a/crates/wasmlink/tests/retptr.wit b/crates/wasmlink/tests/retptr.wit index 07a905b66..af490a281 100644 --- a/crates/wasmlink/tests/retptr.wit +++ b/crates/wasmlink/tests/retptr.wit @@ -1 +1 @@ -f1: function(a: s32, b: u32) -> tuple +f1: func(a: s32, b: u32) -> tuple diff --git a/crates/wasmlink/tests/string.wit b/crates/wasmlink/tests/string.wit index a8a2fc317..40aa9f49e 100644 --- a/crates/wasmlink/tests/string.wit +++ b/crates/wasmlink/tests/string.wit @@ -1 +1 @@ -f1: function(a: string) -> string +f1: func(a: string) -> string diff --git a/crates/wasmlink/tests/variants.wit b/crates/wasmlink/tests/variants.wit index 525bc1a4c..7a825ddc0 100644 --- a/crates/wasmlink/tests/variants.wit +++ b/crates/wasmlink/tests/variants.wit @@ -2,16 +2,16 @@ enum e1 { a, } -e1-arg: function(x: e1) -e1-result: function() -> e1 +e1-arg: func(x: e1) +e1-result: func() -> e1 union u1 { u32, float32, } -u1-arg: function(x: u1) -u1-result: function() -> u1 +u1-arg: func(x: u1) +u1-result: func() -> u1 record empty {} @@ -25,13 +25,13 @@ variant v1 { g(u32), } -v1-arg: function(x: v1) -v1-result: function() -> v1 +v1-arg: func(x: v1) +v1-result: func() -> v1 -bool-arg: function(x: bool) -bool-result: function() -> bool +bool-arg: func(x: bool) +bool-result: func() -> bool -option-arg: function( +option-arg: func( a: option, b: option>, c: option, @@ -40,7 +40,7 @@ option-arg: function( f: option, g: option>, ) -option-result: function() -> tuple< +option-result: func() -> tuple< option, option>, option, @@ -80,7 +80,7 @@ variant casts6 { b(tuple), } -casts: function( +casts: func( a: casts1, b: casts2, c: casts3, @@ -96,7 +96,7 @@ casts: function( casts6, > -expected-arg: function( +expected-arg: func( a: expected, b: expected, c: expected, @@ -104,7 +104,7 @@ expected-arg: function( e: expected, f: expected>, ) -expected-result: function() -> tuple< +expected-result: func() -> tuple< expected, expected, expected, diff --git a/crates/wit-bindgen-demo/browser.wit b/crates/wit-bindgen-demo/browser.wit index 679a77993..0383c15e5 100644 --- a/crates/wit-bindgen-demo/browser.wit +++ b/crates/wit-bindgen-demo/browser.wit @@ -1,2 +1,2 @@ -log: function(msg: string) -error: function(msg: string) +log: func(msg: string) +error: func(msg: string) diff --git a/crates/wit-bindgen-demo/demo.wit b/crates/wit-bindgen-demo/demo.wit index 94e08e164..e26991488 100644 --- a/crates/wit-bindgen-demo/demo.wit +++ b/crates/wit-bindgen-demo/demo.wit @@ -18,12 +18,12 @@ enum lang { resource config { - static new: function() -> config + static new: func() -> config - render: function(lang: lang, wit: string, import: bool) -> expected + render: func(lang: lang, wit: string, import: bool) -> expected - set-rust-unchecked: function(unchecked: bool) - set-wasmtime-tracing: function(unchecked: bool) - set-wasmtime-async: function(val: wasmtime-async) - set-wasmtime-custom-error: function(custom: bool) + set-rust-unchecked: func(unchecked: bool) + set-wasmtime-tracing: func(unchecked: bool) + set-wasmtime-async: func(val: wasmtime-async) + set-wasmtime-custom-error: func(custom: bool) } diff --git a/crates/wit-component/src/printing.rs b/crates/wit-component/src/printing.rs index 9eed3b863..a49ce72b5 100644 --- a/crates/wit-component/src/printing.rs +++ b/crates/wit-component/src/printing.rs @@ -22,7 +22,7 @@ impl InterfacePrinter { } for func in &interface.functions { - write!(&mut self.output, "{}: function(", func.name)?; + write!(&mut self.output, "{}: func(", func.name)?; for (i, (name, ty)) in func.params.iter().enumerate() { if i > 0 { self.output.push_str(", "); diff --git a/crates/wit-component/tests/components/default-export-sig-mismatch/default.wit b/crates/wit-component/tests/components/default-export-sig-mismatch/default.wit index a52ebd73c..acfdb10b6 100644 --- a/crates/wit-component/tests/components/default-export-sig-mismatch/default.wit +++ b/crates/wit-component/tests/components/default-export-sig-mismatch/default.wit @@ -1 +1 @@ -a: function(x: string) -> string \ No newline at end of file +a: func(x: string) -> string \ No newline at end of file diff --git a/crates/wit-component/tests/components/export-sig-mismatch/export-foo.wit b/crates/wit-component/tests/components/export-sig-mismatch/export-foo.wit index a52ebd73c..acfdb10b6 100644 --- a/crates/wit-component/tests/components/export-sig-mismatch/export-foo.wit +++ b/crates/wit-component/tests/components/export-sig-mismatch/export-foo.wit @@ -1 +1 @@ -a: function(x: string) -> string \ No newline at end of file +a: func(x: string) -> string \ No newline at end of file diff --git a/crates/wit-component/tests/components/exports/default.wit b/crates/wit-component/tests/components/exports/default.wit index 7599a4acf..2a121df56 100644 --- a/crates/wit-component/tests/components/exports/default.wit +++ b/crates/wit-component/tests/components/exports/default.wit @@ -1,3 +1,3 @@ -a: function() -b: function(a: s8, b: s16, c: s32, d: s64) -> string -c: function() -> tuple +a: func() +b: func(a: s8, b: s16, c: s32, d: s64) -> string +c: func() -> tuple diff --git a/crates/wit-component/tests/components/exports/export-bar.wit b/crates/wit-component/tests/components/exports/export-bar.wit index 7abe96011..c8c694db8 100644 --- a/crates/wit-component/tests/components/exports/export-bar.wit +++ b/crates/wit-component/tests/components/exports/export-bar.wit @@ -4,4 +4,4 @@ flags x { c } -a: function(x: x) +a: func(x: x) diff --git a/crates/wit-component/tests/components/exports/export-foo.wit b/crates/wit-component/tests/components/exports/export-foo.wit index 70b681df2..d84336d18 100644 --- a/crates/wit-component/tests/components/exports/export-foo.wit +++ b/crates/wit-component/tests/components/exports/export-foo.wit @@ -4,6 +4,6 @@ variant x { c(s64) } -a: function() -b: function(x: string) -> x -c: function(x: x) -> string +a: func() +b: func(x: string) -> x +c: func(x: x) -> string diff --git a/crates/wit-component/tests/components/import-conflict/import-bar.wit b/crates/wit-component/tests/components/import-conflict/import-bar.wit index 8248fa178..574a30276 100644 --- a/crates/wit-component/tests/components/import-conflict/import-bar.wit +++ b/crates/wit-component/tests/components/import-conflict/import-bar.wit @@ -1 +1 @@ -a: function(x: u64, y: string) +a: func(x: u64, y: string) diff --git a/crates/wit-component/tests/components/import-conflict/import-baz.wit b/crates/wit-component/tests/components/import-conflict/import-baz.wit index ae29cc89f..985d1764f 100644 --- a/crates/wit-component/tests/components/import-conflict/import-baz.wit +++ b/crates/wit-component/tests/components/import-conflict/import-baz.wit @@ -1 +1 @@ -baz: function(x: list) -> list +baz: func(x: list) -> list diff --git a/crates/wit-component/tests/components/import-conflict/import-foo.wit b/crates/wit-component/tests/components/import-conflict/import-foo.wit index dedb4b58d..b7a21e130 100644 --- a/crates/wit-component/tests/components/import-conflict/import-foo.wit +++ b/crates/wit-component/tests/components/import-conflict/import-foo.wit @@ -1 +1 @@ -a: function() \ No newline at end of file +a: func() \ No newline at end of file diff --git a/crates/wit-component/tests/components/import-export/default.wit b/crates/wit-component/tests/components/import-export/default.wit index f710b52be..b23937838 100644 --- a/crates/wit-component/tests/components/import-export/default.wit +++ b/crates/wit-component/tests/components/import-export/default.wit @@ -1 +1 @@ -a: function(x: string) -> tuple +a: func(x: string) -> tuple diff --git a/crates/wit-component/tests/components/import-export/export-bar.wit b/crates/wit-component/tests/components/import-export/export-bar.wit index d40ff3116..cb31994da 100644 --- a/crates/wit-component/tests/components/import-export/export-bar.wit +++ b/crates/wit-component/tests/components/import-export/export-bar.wit @@ -1,2 +1,2 @@ -a: function() -b: function() -> string +a: func() +b: func() -> string diff --git a/crates/wit-component/tests/components/import-export/import-foo.wit b/crates/wit-component/tests/components/import-export/import-foo.wit index 7e8b71183..f159259de 100644 --- a/crates/wit-component/tests/components/import-export/import-foo.wit +++ b/crates/wit-component/tests/components/import-export/import-foo.wit @@ -1 +1 @@ -a: function() -> string +a: func() -> string diff --git a/crates/wit-component/tests/components/import-sig-mismatch/import-foo.wit b/crates/wit-component/tests/components/import-sig-mismatch/import-foo.wit index 3eb8e740f..ca78f93fb 100644 --- a/crates/wit-component/tests/components/import-sig-mismatch/import-foo.wit +++ b/crates/wit-component/tests/components/import-sig-mismatch/import-foo.wit @@ -1 +1 @@ -bar: function(s: string) \ No newline at end of file +bar: func(s: string) \ No newline at end of file diff --git a/crates/wit-component/tests/components/imports/import-bar.wit b/crates/wit-component/tests/components/imports/import-bar.wit index 584c236d3..10c19d561 100644 --- a/crates/wit-component/tests/components/imports/import-bar.wit +++ b/crates/wit-component/tests/components/imports/import-bar.wit @@ -2,5 +2,5 @@ record x { a: u8 } -bar1: function(x: string) -bar2: function(x: x) +bar1: func(x: string) +bar2: func(x: x) diff --git a/crates/wit-component/tests/components/imports/import-baz.wit b/crates/wit-component/tests/components/imports/import-baz.wit index cbef0c9f8..72fee139c 100644 --- a/crates/wit-component/tests/components/imports/import-baz.wit +++ b/crates/wit-component/tests/components/imports/import-baz.wit @@ -1,5 +1,5 @@ type x = s8 -baz1: function(x: list) -baz2: function() -baz3: function(x: x) +baz1: func(x: list) +baz2: func() +baz3: func(x: x) diff --git a/crates/wit-component/tests/components/imports/import-foo.wit b/crates/wit-component/tests/components/imports/import-foo.wit index 7e8d19c27..e6104b879 100644 --- a/crates/wit-component/tests/components/imports/import-foo.wit +++ b/crates/wit-component/tests/components/imports/import-foo.wit @@ -1,3 +1,3 @@ -foo1: function() -foo2: function(x: u8) -foo3: function(x: float32) +foo1: func() +foo2: func(x: u8) +foo3: func(x: float32) diff --git a/crates/wit-component/tests/components/lift-options/default.wit b/crates/wit-component/tests/components/lift-options/default.wit index bfdbfb297..496bf1e2c 100644 --- a/crates/wit-component/tests/components/lift-options/default.wit +++ b/crates/wit-component/tests/components/lift-options/default.wit @@ -14,19 +14,19 @@ variant v-no-string { s(u32) } -a: function() -b: function(x: list) -c: function(x: r) -d: function(x: v) -e: function(x: r-no-string) -f: function(x: v-no-string) -g: function(x: list) -h: function(x: list) -i: function(x: list) -j: function(x: u32) -k: function() -> tuple -l: function() -> string -m: function() -> list -n: function() -> u32 -o: function() -> v -p: function() -> list +a: func() +b: func(x: list) +c: func(x: r) +d: func(x: v) +e: func(x: r-no-string) +f: func(x: v-no-string) +g: func(x: list) +h: func(x: list) +i: func(x: list) +j: func(x: u32) +k: func() -> tuple +l: func() -> string +m: func() -> list +n: func() -> u32 +o: func() -> v +p: func() -> list diff --git a/crates/wit-component/tests/components/lower-options/import-foo.wit b/crates/wit-component/tests/components/lower-options/import-foo.wit index bfdbfb297..496bf1e2c 100644 --- a/crates/wit-component/tests/components/lower-options/import-foo.wit +++ b/crates/wit-component/tests/components/lower-options/import-foo.wit @@ -14,19 +14,19 @@ variant v-no-string { s(u32) } -a: function() -b: function(x: list) -c: function(x: r) -d: function(x: v) -e: function(x: r-no-string) -f: function(x: v-no-string) -g: function(x: list) -h: function(x: list) -i: function(x: list) -j: function(x: u32) -k: function() -> tuple -l: function() -> string -m: function() -> list -n: function() -> u32 -o: function() -> v -p: function() -> list +a: func() +b: func(x: list) +c: func(x: r) +d: func(x: v) +e: func(x: r-no-string) +f: func(x: v-no-string) +g: func(x: list) +h: func(x: list) +i: func(x: list) +j: func(x: u32) +k: func() -> tuple +l: func() -> string +m: func() -> list +n: func() -> u32 +o: func() -> v +p: func() -> list diff --git a/crates/wit-component/tests/components/missing-default-export/default.wit b/crates/wit-component/tests/components/missing-default-export/default.wit index dedb4b58d..b7a21e130 100644 --- a/crates/wit-component/tests/components/missing-default-export/default.wit +++ b/crates/wit-component/tests/components/missing-default-export/default.wit @@ -1 +1 @@ -a: function() \ No newline at end of file +a: func() \ No newline at end of file diff --git a/crates/wit-component/tests/components/missing-export/export-foo.wit b/crates/wit-component/tests/components/missing-export/export-foo.wit index dedb4b58d..b7a21e130 100644 --- a/crates/wit-component/tests/components/missing-export/export-foo.wit +++ b/crates/wit-component/tests/components/missing-export/export-foo.wit @@ -1 +1 @@ -a: function() \ No newline at end of file +a: func() \ No newline at end of file diff --git a/crates/wit-component/tests/components/missing-import-func/import-foo.wit b/crates/wit-component/tests/components/missing-import-func/import-foo.wit index dedb4b58d..b7a21e130 100644 --- a/crates/wit-component/tests/components/missing-import-func/import-foo.wit +++ b/crates/wit-component/tests/components/missing-import-func/import-foo.wit @@ -1 +1 @@ -a: function() \ No newline at end of file +a: func() \ No newline at end of file diff --git a/crates/wit-component/tests/components/simple/default.wit b/crates/wit-component/tests/components/simple/default.wit index 22464e537..c85db884b 100644 --- a/crates/wit-component/tests/components/simple/default.wit +++ b/crates/wit-component/tests/components/simple/default.wit @@ -1,6 +1,6 @@ type x = list -a: function() -b: function() -> string -c: function(x: string) -> string -d: function(x: x) +a: func() +b: func() -> string +c: func(x: string) -> string +d: func(x: x) diff --git a/crates/wit-component/tests/interfaces/flags/flags.wit b/crates/wit-component/tests/interfaces/flags/flags.wit index ea9af918d..ea6b8d8e8 100644 --- a/crates/wit-component/tests/interfaces/flags/flags.wit +++ b/crates/wit-component/tests/interfaces/flags/flags.wit @@ -146,17 +146,17 @@ flags flag64 { b63, } -roundtrip-flag1: function(x: flag1) -> flag1 +roundtrip-flag1: func(x: flag1) -> flag1 -roundtrip-flag2: function(x: flag2) -> flag2 +roundtrip-flag2: func(x: flag2) -> flag2 -roundtrip-flag4: function(x: flag4) -> flag4 +roundtrip-flag4: func(x: flag4) -> flag4 -roundtrip-flag8: function(x: flag8) -> flag8 +roundtrip-flag8: func(x: flag8) -> flag8 -roundtrip-flag16: function(x: flag16) -> flag16 +roundtrip-flag16: func(x: flag16) -> flag16 -roundtrip-flag32: function(x: flag32) -> flag32 +roundtrip-flag32: func(x: flag32) -> flag32 -roundtrip-flag64: function(x: flag64) -> flag64 +roundtrip-flag64: func(x: flag64) -> flag64 diff --git a/crates/wit-component/tests/interfaces/floats/floats.wit b/crates/wit-component/tests/interfaces/floats/floats.wit index 342dc447d..5d20651ca 100644 --- a/crates/wit-component/tests/interfaces/floats/floats.wit +++ b/crates/wit-component/tests/interfaces/floats/floats.wit @@ -1,8 +1,8 @@ -float32-param: function(x: float32) +float32-param: func(x: float32) -float64-param: function(x: float64) +float64-param: func(x: float64) -float32-result: function() -> float32 +float32-result: func() -> float32 -float64-result: function() -> float64 +float64-result: func() -> float64 diff --git a/crates/wit-component/tests/interfaces/integers/integers.wit b/crates/wit-component/tests/interfaces/integers/integers.wit index a0a98d9d9..dedd40e77 100644 --- a/crates/wit-component/tests/interfaces/integers/integers.wit +++ b/crates/wit-component/tests/interfaces/integers/integers.wit @@ -1,38 +1,38 @@ -a1: function(x: u8) +a1: func(x: u8) -a2: function(x: s8) +a2: func(x: s8) -a3: function(x: u16) +a3: func(x: u16) -a4: function(x: s16) +a4: func(x: s16) -a5: function(x: u32) +a5: func(x: u32) -a6: function(x: s32) +a6: func(x: s32) -a7: function(x: u64) +a7: func(x: u64) -a8: function(x: s64) +a8: func(x: s64) -a9: function(p1: u8, p2: s8, p3: u16, p4: s16, p5: u32, p6: s32, p7: u64, p8: s64) +a9: func(p1: u8, p2: s8, p3: u16, p4: s16, p5: u32, p6: s32, p7: u64, p8: s64) -r1: function() -> u8 +r1: func() -> u8 -r2: function() -> s8 +r2: func() -> s8 -r3: function() -> u16 +r3: func() -> u16 -r4: function() -> s16 +r4: func() -> s16 -r5: function() -> u32 +r5: func() -> u32 -r6: function() -> s32 +r6: func() -> s32 -r7: function() -> u64 +r7: func() -> u64 -r8: function() -> s64 +r8: func() -> s64 -pair-ret: function() -> tuple +pair-ret: func() -> tuple -multi-ret: function() -> tuple +multi-ret: func() -> tuple diff --git a/crates/wit-component/tests/interfaces/lists/lists.wit b/crates/wit-component/tests/interfaces/lists/lists.wit index ddd05cab9..1f31804ab 100644 --- a/crates/wit-component/tests/interfaces/lists/lists.wit +++ b/crates/wit-component/tests/interfaces/lists/lists.wit @@ -31,59 +31,59 @@ variant some-variant { type load-store-all-sizes = list> -list-u8-param: function(x: list) +list-u8-param: func(x: list) -list-u16-param: function(x: list) +list-u16-param: func(x: list) -list-u32-param: function(x: list) +list-u32-param: func(x: list) -list-u64-param: function(x: list) +list-u64-param: func(x: list) -list-s8-param: function(x: list) +list-s8-param: func(x: list) -list-s16-param: function(x: list) +list-s16-param: func(x: list) -list-s32-param: function(x: list) +list-s32-param: func(x: list) -list-s64-param: function(x: list) +list-s64-param: func(x: list) -list-float32-param: function(x: list) +list-float32-param: func(x: list) -list-float64-param: function(x: list) +list-float64-param: func(x: list) -list-u8-ret: function() -> list +list-u8-ret: func() -> list -list-u16-ret: function() -> list +list-u16-ret: func() -> list -list-u32-ret: function() -> list +list-u32-ret: func() -> list -list-u64-ret: function() -> list +list-u64-ret: func() -> list -list-s8-ret: function() -> list +list-s8-ret: func() -> list -list-s16-ret: function() -> list +list-s16-ret: func() -> list -list-s32-ret: function() -> list +list-s32-ret: func() -> list -list-s64-ret: function() -> list +list-s64-ret: func() -> list -list-float32-ret: function() -> list +list-float32-ret: func() -> list -list-float64-ret: function() -> list +list-float64-ret: func() -> list -tuple-list: function(x: list>) -> list> +tuple-list: func(x: list>) -> list> -string-list-arg: function(a: list) +string-list-arg: func(a: list) -string-list-ret: function() -> list +string-list-ret: func() -> list -tuple-string-list: function(x: list>) -> list> +tuple-string-list: func(x: list>) -> list> -string-list: function(x: list) -> list +string-list: func(x: list) -> list -record-list: function(x: list) -> list +record-list: func(x: list) -> list -variant-list: function(x: list) -> list +variant-list: func(x: list) -> list -load-store-everything: function(a: load-store-all-sizes) -> load-store-all-sizes +load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes diff --git a/crates/wit-component/tests/interfaces/records/records.wit b/crates/wit-component/tests/interfaces/records/records.wit index 4bb1b5d47..87302bf73 100644 --- a/crates/wit-component/tests/interfaces/records/records.wit +++ b/crates/wit-component/tests/interfaces/records/records.wit @@ -30,25 +30,25 @@ type int-typedef = s32 type tuple-typedef2 = tuple -tuple-arg: function(x: tuple) +tuple-arg: func(x: tuple) -tuple-result: function() -> tuple +tuple-result: func() -> tuple -empty-arg: function(x: empty) +empty-arg: func(x: empty) -empty-result: function() -> empty +empty-result: func() -> empty -scalar-arg: function(x: scalars) +scalar-arg: func(x: scalars) -scalar-result: function() -> scalars +scalar-result: func() -> scalars -flags-arg: function(x: really-flags) +flags-arg: func(x: really-flags) -flags-result: function() -> really-flags +flags-result: func() -> really-flags -aggregate-arg: function(x: aggregates) +aggregate-arg: func(x: aggregates) -aggregate-result: function() -> aggregates +aggregate-result: func() -> aggregates -typedef-inout: function(e: tuple-typedef2) -> s32 +typedef-inout: func(e: tuple-typedef2) -> s32 diff --git a/crates/wit-component/tests/interfaces/variants/variants.wit b/crates/wit-component/tests/interfaces/variants/variants.wit index eeaa8cc59..4bace14a3 100644 --- a/crates/wit-component/tests/interfaces/variants/variants.wit +++ b/crates/wit-component/tests/interfaces/variants/variants.wit @@ -55,43 +55,43 @@ enum my-errno { bad2, } -e1-arg: function(x: e1) +e1-arg: func(x: e1) -e1-result: function() -> e1 +e1-result: func() -> e1 -u1-arg: function(x: u1) +u1-arg: func(x: u1) -u1-result: function() -> u1 +u1-result: func() -> u1 -v1-arg: function(x: v1) +v1-arg: func(x: v1) -v1-result: function() -> v1 +v1-result: func() -> v1 -bool-arg: function(x: bool) +bool-arg: func(x: bool) -bool-result: function() -> bool +bool-result: func() -> bool -option-arg: function(a: option, b: option>, c: option, d: option, e: option, f: option, g: option>) +option-arg: func(a: option, b: option>, c: option, d: option, e: option, f: option, g: option>) -option-result: function() -> tuple, option>, option, option, option, option, option>> +option-result: func() -> tuple, option>, option, option, option, option, option>> -casts: function(a: casts1, b: casts2, c: casts3, d: casts4, e: casts5, f: casts6) -> tuple +casts: func(a: casts1, b: casts2, c: casts3, d: casts4, e: casts5, f: casts6) -> tuple -expected-arg: function(a: expected, b: expected, c: expected, d: expected, tuple<>>, e: expected, f: expected>) +expected-arg: func(a: expected, b: expected, c: expected, d: expected, tuple<>>, e: expected, f: expected>) -expected-result: function() -> tuple, expected, expected, expected, tuple<>>, expected, expected>> +expected-result: func() -> tuple, expected, expected, expected, tuple<>>, expected, expected>> -return-expected-sugar: function() -> expected +return-expected-sugar: func() -> expected -return-expected-sugar2: function() -> expected +return-expected-sugar2: func() -> expected -return-expected-sugar3: function() -> expected +return-expected-sugar3: func() -> expected -return-expected-sugar4: function() -> expected, my-errno> +return-expected-sugar4: func() -> expected, my-errno> -return-option-sugar: function() -> option +return-option-sugar: func() -> option -return-option-sugar2: function() -> option +return-option-sugar2: func() -> option -expected-simple: function() -> expected +expected-simple: func() -> expected diff --git a/tests/codegen/async-functions.wit b/tests/codegen/async-functions.wit index 40ea88302..81d02f62f 100644 --- a/tests/codegen/async-functions.wit +++ b/tests/codegen/async-functions.wit @@ -1,7 +1,7 @@ -async-no-args: async function() -async-args: async function(a: u32, b: string, c: list) -async-results: async function() -> tuple> +async-no-args: async func() +async-args: async func(a: u32, b: string, c: list) +async-results: async func() -> tuple> resource async-resource { - frob: async function() + frob: async func() } diff --git a/tests/codegen/char.wit b/tests/codegen/char.wit index 1a43fee64..981f9bcf5 100644 --- a/tests/codegen/char.wit +++ b/tests/codegen/char.wit @@ -1,2 +1,2 @@ -take-char: function(x: char) -return-char: function() -> char +take-char: func(x: char) +return-char: func() -> char diff --git a/tests/codegen/conventions.wit b/tests/codegen/conventions.wit index 3042487e2..014b712a5 100644 --- a/tests/codegen/conventions.wit +++ b/tests/codegen/conventions.wit @@ -1,28 +1,28 @@ // hello 🐱 world -kebab-case: function() +kebab-case: func() record ludicrous-speed { how-fast-are-you-going: u32, i-am-going-extremely-slow: u64, } -foo: function(x: ludicrous-speed) -%function-with-dashes: function() -%function-with-no-weird-characters: function() +foo: func(x: ludicrous-speed) +%function-with-dashes: func() +%function-with-no-weird-characters: func() -apple: function() -apple-pear: function() -apple-pear-grape: function() -garçon: function() -hühnervögel: function() -москва: function() -東-京: function() -garçon-hühnervögel-москва-東-京: function() -a0: function() +apple: func() +apple-pear: func() +apple-pear-grape: func() +garçon: func() +hühnervögel: func() +москва: func() +東-京: func() +garçon-hühnervögel-москва-東-京: func() +a0: func() -%explicit: function() -%explicit-kebab: function() +%explicit: func() +%explicit-kebab: func() // Identifiers with the same name as keywords are quoted. -%bool: function() +%bool: func() diff --git a/tests/codegen/flags.wit b/tests/codegen/flags.wit index 1896057a1..343cc9013 100644 --- a/tests/codegen/flags.wit +++ b/tests/codegen/flags.wit @@ -37,10 +37,10 @@ flags flag64 { b56, b57, b58, b59, b60, b61, b62, b63, } -roundtrip-flag1: function(x: flag1) -> flag1 -roundtrip-flag2: function(x: flag2) -> flag2 -roundtrip-flag4: function(x: flag4) -> flag4 -roundtrip-flag8: function(x: flag8) -> flag8 -roundtrip-flag16: function(x: flag16) -> flag16 -roundtrip-flag32: function(x: flag32) -> flag32 -roundtrip-flag64: function(x: flag64) -> flag64 +roundtrip-flag1: func(x: flag1) -> flag1 +roundtrip-flag2: func(x: flag2) -> flag2 +roundtrip-flag4: func(x: flag4) -> flag4 +roundtrip-flag8: func(x: flag8) -> flag8 +roundtrip-flag16: func(x: flag16) -> flag16 +roundtrip-flag32: func(x: flag32) -> flag32 +roundtrip-flag64: func(x: flag64) -> flag64 diff --git a/tests/codegen/floats.wit b/tests/codegen/floats.wit index 0d8e34e22..c3866d931 100644 --- a/tests/codegen/floats.wit +++ b/tests/codegen/floats.wit @@ -1,4 +1,4 @@ -float32-param: function(x: float32) -float64-param: function(x: float64) -float32-result: function() -> float32 -float64-result: function() -> float64 +float32-param: func(x: float32) +float64-param: func(x: float64) +float32-result: func() -> float32 +float64-result: func() -> float64 diff --git a/tests/codegen/integers.wit b/tests/codegen/integers.wit index 1aefeb316..07fcf0244 100644 --- a/tests/codegen/integers.wit +++ b/tests/codegen/integers.wit @@ -1,13 +1,13 @@ -a1: function(x: u8) -a2: function(x: s8) -a3: function(x: u16) -a4: function(x: s16) -a5: function(x: u32) -a6: function(x: s32) -a7: function(x: u64) -a8: function(x: s64) +a1: func(x: u8) +a2: func(x: s8) +a3: func(x: u16) +a4: func(x: s16) +a5: func(x: u32) +a6: func(x: s32) +a7: func(x: u64) +a8: func(x: s64) -a9: function( +a9: func( p1: u8, p2: s8, p3: u16, @@ -19,13 +19,13 @@ a9: function( ) -r1: function() -> u8 -r2: function() -> s8 -r3: function() -> u16 -r4: function() -> s16 -r5: function() -> u32 -r6: function() -> s32 -r7: function() -> u64 -r8: function() -> s64 +r1: func() -> u8 +r2: func() -> s8 +r3: func() -> u16 +r4: func() -> s16 +r5: func() -> u32 +r6: func() -> s32 +r7: func() -> u64 +r8: func() -> s64 -pair-ret: function() -> tuple +pair-ret: func() -> tuple diff --git a/tests/codegen/lists.wit b/tests/codegen/lists.wit index 478173986..2c6b526ad 100644 --- a/tests/codegen/lists.wit +++ b/tests/codegen/lists.wit @@ -1,30 +1,30 @@ -list-u8-param: function(x: list) -list-u16-param: function(x: list) -list-u32-param: function(x: list) -list-u64-param: function(x: list) -list-s8-param: function(x: list) -list-s16-param: function(x: list) -list-s32-param: function(x: list) -list-s64-param: function(x: list) -list-float32-param: function(x: list) -list-float64-param: function(x: list) +list-u8-param: func(x: list) +list-u16-param: func(x: list) +list-u32-param: func(x: list) +list-u64-param: func(x: list) +list-s8-param: func(x: list) +list-s16-param: func(x: list) +list-s32-param: func(x: list) +list-s64-param: func(x: list) +list-float32-param: func(x: list) +list-float64-param: func(x: list) -list-u8-ret: function() -> list -list-u16-ret: function() -> list -list-u32-ret: function() -> list -list-u64-ret: function() -> list -list-s8-ret: function() -> list -list-s16-ret: function() -> list -list-s32-ret: function() -> list -list-s64-ret: function() -> list -list-float32-ret: function() -> list -list-float64-ret: function() -> list +list-u8-ret: func() -> list +list-u16-ret: func() -> list +list-u32-ret: func() -> list +list-u64-ret: func() -> list +list-s8-ret: func() -> list +list-s16-ret: func() -> list +list-s32-ret: func() -> list +list-s64-ret: func() -> list +list-float32-ret: func() -> list +list-float64-ret: func() -> list -tuple-list: function(x: list>) -> list> -string-list-arg: function(a: list) -string-list-ret: function() -> list -tuple-string-list: function(x: list>) -> list> -string-list: function(x: list) -> list +tuple-list: func(x: list>) -> list> +string-list-arg: func(a: list) +string-list-ret: func() -> list +tuple-string-list: func(x: list>) -> list> +string-list: func(x: list) -> list record some-record { x: string, @@ -43,8 +43,8 @@ record other-record { b: string, c: list, } -record-list: function(x: list) -> list -record-list-reverse: function(x: list) -> list +record-list: func(x: list) -> list +record-list-reverse: func(x: list) -> list variant some-variant { a(string), @@ -57,7 +57,7 @@ variant other-variant { b(u32), c(string), } -variant-list: function(x: list) -> list +variant-list: func(x: list) -> list type load-store-all-sizes = list> -load-store-everything: function(a: load-store-all-sizes) -> load-store-all-sizes +load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes diff --git a/tests/codegen/many-arguments.wit b/tests/codegen/many-arguments.wit index 475c94525..745b7ce66 100644 --- a/tests/codegen/many-arguments.wit +++ b/tests/codegen/many-arguments.wit @@ -1,4 +1,4 @@ -many-args: function( +many-args: func( a1: u64, a2: u64, a3: u64, @@ -44,4 +44,4 @@ record big-struct { a20: string, } -big-argument: function(x: big-struct) +big-argument: func(x: big-struct) diff --git a/tests/codegen/records.wit b/tests/codegen/records.wit index e45e6e3e5..c1aa41d20 100644 --- a/tests/codegen/records.wit +++ b/tests/codegen/records.wit @@ -1,18 +1,18 @@ -tuple-arg: function(x: tuple) -tuple-result: function() -> tuple +tuple-arg: func(x: tuple) +tuple-result: func() -> tuple record empty {} -empty-arg: function(x: empty) -empty-result: function() -> empty +empty-arg: func(x: empty) +empty-result: func() -> empty record scalars { a: u32, b: u32, } -scalar-arg: function(x: scalars) -scalar-result: function() -> scalars +scalar-arg: func(x: scalars) +scalar-result: func() -> scalars record really-flags { a: bool, @@ -26,8 +26,8 @@ record really-flags { i: bool, } -flags-arg: function(x: really-flags) -flags-result: function() -> really-flags +flags-arg: func(x: really-flags) +flags-result: func() -> really-flags record aggregates { a: scalars, @@ -37,10 +37,10 @@ record aggregates { e: really-flags, } -aggregate-arg: function(x: aggregates) -aggregate-result: function() -> aggregates +aggregate-arg: func(x: aggregates) +aggregate-result: func() -> aggregates type tuple-typedef = tuple type int-typedef = s32 type tuple-typedef2 = tuple -typedef-inout: function(e: tuple-typedef2) -> s32 +typedef-inout: func(e: tuple-typedef2) -> s32 diff --git a/tests/codegen/resource.wit b/tests/codegen/resource.wit index 51bf54383..3c87154f5 100644 --- a/tests/codegen/resource.wit +++ b/tests/codegen/resource.wit @@ -1,11 +1,11 @@ resource x -acquire-an-x: function() -> x -receive-an-x: function(val: x) +acquire-an-x: func() -> x +receive-an-x: func(val: x) resource y { - static some-constructor: function() -> y - method-on-y: function() - method-with-param: function(x: u32) - method-with-result: function() -> string + static some-constructor: func() -> y + method-on-y: func() + method-with-param: func(x: u32) + method-with-result: func() -> string } diff --git a/tests/codegen/simple-functions.wit b/tests/codegen/simple-functions.wit index ecaea8ffa..196ec3abd 100644 --- a/tests/codegen/simple-functions.wit +++ b/tests/codegen/simple-functions.wit @@ -1,9 +1,9 @@ -f1: function() -f2: function(a: u32) -f3: function(a: u32, b: u32) +f1: func() +f2: func(a: u32) +f3: func(a: u32, b: u32) -f4: function() -> u32 +f4: func() -> u32 // TODO: reenable this when smw implements this -//f5: function() -> tuple +//f5: func() -> tuple // -//f6: function(a: u32, b: u32, c: u32) -> tuple +//f6: func(a: u32, b: u32, c: u32) -> tuple diff --git a/tests/codegen/simple-lists.wit b/tests/codegen/simple-lists.wit index a35b4697a..f21580603 100644 --- a/tests/codegen/simple-lists.wit +++ b/tests/codegen/simple-lists.wit @@ -1,5 +1,5 @@ -simple-list1: function(l: list) -simple-list2: function() -> list +simple-list1: func(l: list) +simple-list2: func() -> list // TODO: reenable this when smw implements this -// simple-list3: function(a: list, b: list) -> tuple, list> -simple-list4: function(l: list>) -> list> +// simple-list3: func(a: list, b: list) -> tuple, list> +simple-list4: func(l: list>) -> list> diff --git a/tests/codegen/small-anonymous.wit b/tests/codegen/small-anonymous.wit index c4d5afe2a..71f9cb4e4 100644 --- a/tests/codegen/small-anonymous.wit +++ b/tests/codegen/small-anonymous.wit @@ -3,4 +3,4 @@ enum error { failure, } -option-test: function() -> expected, error> +option-test: func() -> expected, error> diff --git a/tests/codegen/smoke.wit b/tests/codegen/smoke.wit index 456559319..aade610bd 100644 --- a/tests/codegen/smoke.wit +++ b/tests/codegen/smoke.wit @@ -1 +1 @@ -y: function() +y: func() diff --git a/tests/codegen/strings.wit b/tests/codegen/strings.wit index 4e20e6d8d..fccaae119 100644 --- a/tests/codegen/strings.wit +++ b/tests/codegen/strings.wit @@ -1,3 +1,3 @@ -a: function(x: string) -b: function() -> string -c: function(a: string, b: string) -> string +a: func(x: string) +b: func() -> string +c: func(a: string, b: string) -> string diff --git a/tests/codegen/variants.wit b/tests/codegen/variants.wit index 7857e9216..c32c2ebf2 100644 --- a/tests/codegen/variants.wit +++ b/tests/codegen/variants.wit @@ -2,16 +2,16 @@ enum e1 { a, } -e1-arg: function(x: e1) -e1-result: function() -> e1 +e1-arg: func(x: e1) +e1-result: func() -> e1 union u1 { u32, float32, } -u1-arg: function(x: u1) -u1-result: function() -> u1 +u1-arg: func(x: u1) +u1-result: func() -> u1 record empty {} @@ -25,13 +25,13 @@ variant v1 { g(u32), } -v1-arg: function(x: v1) -v1-result: function() -> v1 +v1-arg: func(x: v1) +v1-result: func() -> v1 -bool-arg: function(x: bool) -bool-result: function() -> bool +bool-arg: func(x: bool) +bool-result: func() -> bool -option-arg: function( +option-arg: func( a: option, b: option>, c: option, @@ -40,7 +40,7 @@ option-arg: function( f: option, g: option>, ) -option-result: function() -> tuple< +option-result: func() -> tuple< option, option>, option, @@ -80,7 +80,7 @@ variant casts6 { b(tuple), } -casts: function( +casts: func( a: casts1, b: casts2, c: casts3, @@ -96,7 +96,7 @@ casts: function( casts6, > -expected-arg: function( +expected-arg: func( a: expected, b: expected, c: expected, @@ -104,7 +104,7 @@ expected-arg: function( e: expected, f: expected>, ) -expected-result: function() -> tuple< +expected-result: func() -> tuple< expected, expected, expected, @@ -118,18 +118,18 @@ enum my-errno { bad2, } -return-expected-sugar: function() -> expected -return-expected-sugar2: function() -> expected -return-expected-sugar3: function() -> expected -return-expected-sugar4: function() -> expected, my-errno> -return-option-sugar: function() -> option -return-option-sugar2: function() -> option +return-expected-sugar: func() -> expected +return-expected-sugar2: func() -> expected +return-expected-sugar3: func() -> expected +return-expected-sugar4: func() -> expected, my-errno> +return-option-sugar: func() -> option +return-option-sugar2: func() -> option -expected-simple: function() -> expected +expected-simple: func() -> expected record is-clone { v1: v1, } -is-clone-arg: function(a: is-clone) -is-clone-return: function() -> is-clone +is-clone-arg: func(a: is-clone) +is-clone-return: func() -> is-clone diff --git a/tests/runtime/async_functions/exports.wit b/tests/runtime/async_functions/exports.wit index ffac68813..c1de3e350 100644 --- a/tests/runtime/async_functions/exports.wit +++ b/tests/runtime/async_functions/exports.wit @@ -1,4 +1,4 @@ -thunk: async function() -allocated-bytes: function() -> u32 +thunk: async func() +allocated-bytes: func() -> u32 -test-concurrent: async function() +test-concurrent: async func() diff --git a/tests/runtime/async_functions/imports.wit b/tests/runtime/async_functions/imports.wit index 4cf3657cb..aefd084e6 100644 --- a/tests/runtime/async_functions/imports.wit +++ b/tests/runtime/async_functions/imports.wit @@ -1,5 +1,5 @@ -thunk: async function() +thunk: async func() -concurrent1: async function(a: u32) -> u32 -concurrent2: async function(a: u32) -> u32 -concurrent3: async function(a: u32) -> u32 +concurrent1: async func(a: u32) -> u32 +concurrent2: async func(a: u32) -> u32 +concurrent3: async func(a: u32) -> u32 diff --git a/tests/runtime/flavorful/exports.wit b/tests/runtime/flavorful/exports.wit index 29ccb1fc2..bc751b961 100644 --- a/tests/runtime/flavorful/exports.wit +++ b/tests/runtime/flavorful/exports.wit @@ -1,4 +1,4 @@ -test-imports: function() +test-imports: func() record list-in-record1 { a: string } record list-in-record2 { a: string } @@ -6,26 +6,26 @@ record list-in-record3 { a: string } record list-in-record4 { a: string } type list-in-alias = list-in-record4 -list-in-record1: function(a: list-in-record1) -list-in-record2: function() -> list-in-record2 -list-in-record3: function(a: list-in-record3) -> list-in-record3 -list-in-record4: function(a: list-in-alias) -> list-in-alias +list-in-record1: func(a: list-in-record1) +list-in-record2: func() -> list-in-record2 +list-in-record3: func(a: list-in-record3) -> list-in-record3 +list-in-record4: func(a: list-in-alias) -> list-in-alias type list-in-variant1-v1 = option type list-in-variant1-v2 = expected union list-in-variant1-v3 { string, float32 } -list-in-variant1: function(a: list-in-variant1-v1, b: list-in-variant1-v2, c: list-in-variant1-v3) +list-in-variant1: func(a: list-in-variant1-v1, b: list-in-variant1-v2, c: list-in-variant1-v3) type list-in-variant2 = option -list-in-variant2: function() -> list-in-variant2 +list-in-variant2: func() -> list-in-variant2 type list-in-variant3 = option -list-in-variant3: function(a: list-in-variant3) -> list-in-variant3 +list-in-variant3: func(a: list-in-variant3) -> list-in-variant3 enum my-errno { success, a, b } -errno-result: function() -> expected +errno-result: func() -> expected type list-typedef = string type list-typedef2 = list type list-typedef3 = list -list-typedefs: function(a: list-typedef, c: list-typedef3) -> tuple +list-typedefs: func(a: list-typedef, c: list-typedef3) -> tuple diff --git a/tests/runtime/flavorful/imports.wit b/tests/runtime/flavorful/imports.wit index b517b94bf..a3deecff5 100644 --- a/tests/runtime/flavorful/imports.wit +++ b/tests/runtime/flavorful/imports.wit @@ -4,28 +4,28 @@ record list-in-record3 { a: string } record list-in-record4 { a: string } type list-in-alias = list-in-record4 -list-in-record1: function(a: list-in-record1) -list-in-record2: function() -> list-in-record2 -list-in-record3: function(a: list-in-record3) -> list-in-record3 -list-in-record4: function(a: list-in-alias) -> list-in-alias +list-in-record1: func(a: list-in-record1) +list-in-record2: func() -> list-in-record2 +list-in-record3: func(a: list-in-record3) -> list-in-record3 +list-in-record4: func(a: list-in-alias) -> list-in-alias type list-in-variant1-v1 = option type list-in-variant1-v2 = expected union list-in-variant1-v3 { string, float32 } -list-in-variant1: function(a: list-in-variant1-v1, b: list-in-variant1-v2, c: list-in-variant1-v3) +list-in-variant1: func(a: list-in-variant1-v1, b: list-in-variant1-v2, c: list-in-variant1-v3) type list-in-variant2 = option -list-in-variant2: function() -> list-in-variant2 +list-in-variant2: func() -> list-in-variant2 type list-in-variant3 = option -list-in-variant3: function(a: list-in-variant3) -> list-in-variant3 +list-in-variant3: func(a: list-in-variant3) -> list-in-variant3 enum my-errno { success, a, b } -errno-result: function() -> expected +errno-result: func() -> expected type list-typedef = string type list-typedef2 = list type list-typedef3 = list -list-typedefs: function(a: list-typedef, c: list-typedef3) -> tuple +list-typedefs: func(a: list-typedef, c: list-typedef3) -> tuple -list-of-variants: function(a: list, b: list>, c: list) -> tuple, list>, list> +list-of-variants: func(a: list, b: list>, c: list) -> tuple, list>, list> diff --git a/tests/runtime/handles/exports.wit b/tests/runtime/handles/exports.wit index c0adc461e..2a8602d0e 100644 --- a/tests/runtime/handles/exports.wit +++ b/tests/runtime/handles/exports.wit @@ -1,53 +1,53 @@ -test-imports: function() +test-imports: func() resource wasm-state resource wasm-state2 -wasm-state-create: function() -> wasm-state -wasm-state-get-val: function(a: wasm-state) -> u32 +wasm-state-create: func() -> wasm-state +wasm-state-get-val: func(a: wasm-state) -> u32 -wasm-state2-create: function() -> wasm-state2 -wasm-state2-saw-close: function() -> bool -two-wasm-states: function(a: wasm-state, b: wasm-state2) -> tuple +wasm-state2-create: func() -> wasm-state2 +wasm-state2-saw-close: func() -> bool +two-wasm-states: func(a: wasm-state, b: wasm-state2) -> tuple record wasm-state-param-record { a: wasm-state2 } -wasm-state2-param-record: function(a: wasm-state-param-record) +wasm-state2-param-record: func(a: wasm-state-param-record) type wasm-state-param-tuple = tuple -wasm-state2-param-tuple: function(a: wasm-state-param-tuple) +wasm-state2-param-tuple: func(a: wasm-state-param-tuple) type wasm-state-param-option = option -wasm-state2-param-option: function(a: wasm-state-param-option) +wasm-state2-param-option: func(a: wasm-state-param-option) type wasm-state-param-result = expected -wasm-state2-param-result: function(a: wasm-state-param-result) +wasm-state2-param-result: func(a: wasm-state-param-result) union wasm-state-param-variant { wasm-state2, u32 } -wasm-state2-param-variant: function(a: wasm-state-param-variant) +wasm-state2-param-variant: func(a: wasm-state-param-variant) -wasm-state2-param-list: function(a: list) +wasm-state2-param-list: func(a: list) record wasm-state-result-record { a: wasm-state2 } -wasm-state2-result-record: function() -> wasm-state-result-record +wasm-state2-result-record: func() -> wasm-state-result-record type wasm-state-result-tuple = tuple -wasm-state2-result-tuple: function() -> wasm-state-result-tuple +wasm-state2-result-tuple: func() -> wasm-state-result-tuple type wasm-state-result-option = option -wasm-state2-result-option: function() -> wasm-state-result-option +wasm-state2-result-option: func() -> wasm-state-result-option type wasm-state-result-result = expected -wasm-state2-result-result: function() -> wasm-state-result-result +wasm-state2-result-result: func() -> wasm-state-result-result union wasm-state-result-variant { wasm-state2, u32 } -wasm-state2-result-variant: function() -> wasm-state-result-variant +wasm-state2-result-variant: func() -> wasm-state-result-variant -wasm-state2-result-list: function() -> list +wasm-state2-result-list: func() -> list resource markdown { - static create: function() -> option - append: function(buf: string) - render: function() -> string + static create: func() -> option + append: func(buf: string) + render: func() -> string } diff --git a/tests/runtime/handles/imports.wit b/tests/runtime/handles/imports.wit index 6e2c12eaa..1c5b600de 100644 --- a/tests/runtime/handles/imports.wit +++ b/tests/runtime/handles/imports.wit @@ -1,55 +1,55 @@ resource host-state resource host-state2 -host-state-create: function() -> host-state -host-state-get: function(a: host-state) -> u32 +host-state-create: func() -> host-state +host-state-get: func(a: host-state) -> u32 -host-state2-create: function() -> host-state2 -host-state2-saw-close: function() -> bool -two-host-states: function(a: host-state, b: host-state2) -> tuple +host-state2-create: func() -> host-state2 +host-state2-saw-close: func() -> bool +two-host-states: func(a: host-state, b: host-state2) -> tuple record host-state-param-record { a: host-state2 } -host-state2-param-record: function(a: host-state-param-record) +host-state2-param-record: func(a: host-state-param-record) type host-state-param-tuple = tuple -host-state2-param-tuple: function(a: host-state-param-tuple) +host-state2-param-tuple: func(a: host-state-param-tuple) type host-state-param-option = option -host-state2-param-option: function(a: host-state-param-option) +host-state2-param-option: func(a: host-state-param-option) type host-state-param-result = expected -host-state2-param-result: function(a: host-state-param-result) +host-state2-param-result: func(a: host-state-param-result) union host-state-param-variant { host-state2, u32 } -host-state2-param-variant: function(a: host-state-param-variant) +host-state2-param-variant: func(a: host-state-param-variant) -host-state2-param-list: function(a: list) +host-state2-param-list: func(a: list) record host-state-result-record { a: host-state2 } -host-state2-result-record: function() -> host-state-result-record +host-state2-result-record: func() -> host-state-result-record type host-state-result-tuple = tuple -host-state2-result-tuple: function() -> host-state-result-tuple +host-state2-result-tuple: func() -> host-state-result-tuple type host-state-result-option = option -host-state2-result-option: function() -> host-state-result-option +host-state2-result-option: func() -> host-state-result-option type host-state-result-result = expected -host-state2-result-result: function() -> host-state-result-result +host-state2-result-result: func() -> host-state-result-result union host-state-result-variant { host-state2, u32 } -host-state2-result-variant: function() -> host-state-result-variant +host-state2-result-variant: func() -> host-state-result-variant -host-state2-result-list: function() -> list +host-state2-result-list: func() -> list resource markdown2 { - static create: function() -> markdown2 - append: function(buf: string) - render: function() -> string + static create: func() -> markdown2 + append: func(buf: string) + render: func() -> string } resource %odd-name { - static create: function() -> %odd-name - %frob-the-odd: function() + static create: func() -> %odd-name + %frob-the-odd: func() } diff --git a/tests/runtime/invalid/exports.wit b/tests/runtime/invalid/exports.wit index ca090ec3e..7272c498a 100644 --- a/tests/runtime/invalid/exports.wit +++ b/tests/runtime/invalid/exports.wit @@ -1,9 +1,9 @@ -invalid-u8: function() -invalid-s8: function() -invalid-u16: function() -invalid-s16: function() -invalid-char: function() -invalid-bool: function() -invalid-enum: function() -invalid-handle: function() -invalid-handle-close: function() +invalid-u8: func() +invalid-s8: func() +invalid-u16: func() +invalid-s16: func() +invalid-char: func() +invalid-bool: func() +invalid-enum: func() +invalid-handle: func() +invalid-handle-close: func() diff --git a/tests/runtime/invalid/imports.wit b/tests/runtime/invalid/imports.wit index 18ad56db5..420e8adef 100644 --- a/tests/runtime/invalid/imports.wit +++ b/tests/runtime/invalid/imports.wit @@ -1,13 +1,13 @@ -roundtrip-u8: function(a: u8) -> u8 -roundtrip-s8: function(a: s8) -> s8 -roundtrip-u16: function(a: u16) -> u16 -roundtrip-s16: function(a: s16) -> s16 -roundtrip-char: function(a: char) -> char +roundtrip-u8: func(a: u8) -> u8 +roundtrip-s8: func(a: s8) -> s8 +roundtrip-u16: func(a: u16) -> u16 +roundtrip-s16: func(a: s16) -> s16 +roundtrip-char: func(a: char) -> char enum e { a, b, c } -roundtrip-enum: function(a: e) -> e +roundtrip-enum: func(a: e) -> e -roundtrip-bool: function(a: bool) -> bool +roundtrip-bool: func(a: bool) -> bool resource host-state -get-internal: function(a: host-state) -> u32 +get-internal: func(a: host-state) -> u32 diff --git a/tests/runtime/js_instantiate/exports.wit b/tests/runtime/js_instantiate/exports.wit index e359bfff7..acf082171 100644 --- a/tests/runtime/js_instantiate/exports.wit +++ b/tests/runtime/js_instantiate/exports.wit @@ -1 +1 @@ -nop: function() +nop: func() diff --git a/tests/runtime/lists/exports.wit b/tests/runtime/lists/exports.wit index 0998876c3..07a9d99ef 100644 --- a/tests/runtime/lists/exports.wit +++ b/tests/runtime/lists/exports.wit @@ -1,13 +1,13 @@ -test-imports: function() -allocated-bytes: function() -> u32 +test-imports: func() +allocated-bytes: func() -> u32 -list-param: function(a: list) -list-param2: function(a: string) -list-param3: function(a: list) -list-param4: function(a: list>) -list-result: function() -> list -list-result2: function() -> string -list-result3: function() -> list +list-param: func(a: list) +list-param2: func(a: string) +list-param3: func(a: list) +list-param4: func(a: list>) +list-result: func() -> list +list-result2: func() -> string +list-result3: func() -> list -list-roundtrip: function(a: list) -> list -string-roundtrip: function(a: string) -> string +list-roundtrip: func(a: list) -> list +string-roundtrip: func(a: string) -> string diff --git a/tests/runtime/lists/imports.wit b/tests/runtime/lists/imports.wit index 6c39b84f1..67b710f96 100644 --- a/tests/runtime/lists/imports.wit +++ b/tests/runtime/lists/imports.wit @@ -16,25 +16,25 @@ flags flag64 { b56, b57, b58, b59, b60, b61, b62, b63, } -list-param: function(a: list) -list-param2: function(a: string) -list-param3: function(a: list) -list-param4: function(a: list>) -list-result: function() -> list -list-result2: function() -> string -list-result3: function() -> list +list-param: func(a: list) +list-param2: func(a: string) +list-param3: func(a: list) +list-param4: func(a: list>) +list-result: func() -> list +list-result2: func() -> string +list-result3: func() -> list -list-minmax8: function(a: list, b: list) -> tuple, list> -list-minmax16: function(a: list, b: list) -> tuple, list> -list-minmax32: function(a: list, b: list) -> tuple, list> -list-minmax64: function(a: list, b: list) -> tuple, list> -list-minmax-float: function(a: list, b: list) -> tuple, list> +list-minmax8: func(a: list, b: list) -> tuple, list> +list-minmax16: func(a: list, b: list) -> tuple, list> +list-minmax32: func(a: list, b: list) -> tuple, list> +list-minmax64: func(a: list, b: list) -> tuple, list> +list-minmax-float: func(a: list, b: list) -> tuple, list> -list-roundtrip: function(a: list) -> list +list-roundtrip: func(a: list) -> list -string-roundtrip: function(a: string) -> string +string-roundtrip: func(a: string) -> string -unaligned-roundtrip1: function(a: list, b: list, c: list, d: list, e: list) +unaligned-roundtrip1: func(a: list, b: list, c: list, d: list, e: list) record unaligned-record { a: u32, b: u64 } -unaligned-roundtrip2: function(a: list, b: list, c: list, d: list, e: list>) +unaligned-roundtrip2: func(a: list, b: list, c: list, d: list, e: list>) diff --git a/tests/runtime/many_arguments/exports.wit b/tests/runtime/many_arguments/exports.wit index be1b18287..391bf2612 100644 --- a/tests/runtime/many_arguments/exports.wit +++ b/tests/runtime/many_arguments/exports.wit @@ -1,4 +1,4 @@ -many-arguments: function( +many-arguments: func( a1: u64, a2: u64, a3: u64, diff --git a/tests/runtime/many_arguments/imports.wit b/tests/runtime/many_arguments/imports.wit index be1b18287..391bf2612 100644 --- a/tests/runtime/many_arguments/imports.wit +++ b/tests/runtime/many_arguments/imports.wit @@ -1,4 +1,4 @@ -many-arguments: function( +many-arguments: func( a1: u64, a2: u64, a3: u64, diff --git a/tests/runtime/numbers/exports.wit b/tests/runtime/numbers/exports.wit index 08e4979f5..cd91febd4 100644 --- a/tests/runtime/numbers/exports.wit +++ b/tests/runtime/numbers/exports.wit @@ -1,16 +1,16 @@ -test-imports: function() +test-imports: func() -roundtrip-u8: function(a: u8) -> u8 -roundtrip-s8: function(a: s8) -> s8 -roundtrip-u16: function(a: u16) -> u16 -roundtrip-s16: function(a: s16) -> s16 -roundtrip-u32: function(a: u32) -> u32 -roundtrip-s32: function(a: s32) -> s32 -roundtrip-u64: function(a: u64) -> u64 -roundtrip-s64: function(a: s64) -> s64 -roundtrip-float32: function(a: float32) -> float32 -roundtrip-float64: function(a: float64) -> float64 -roundtrip-char: function(a: char) -> char +roundtrip-u8: func(a: u8) -> u8 +roundtrip-s8: func(a: s8) -> s8 +roundtrip-u16: func(a: u16) -> u16 +roundtrip-s16: func(a: s16) -> s16 +roundtrip-u32: func(a: u32) -> u32 +roundtrip-s32: func(a: s32) -> s32 +roundtrip-u64: func(a: u64) -> u64 +roundtrip-s64: func(a: s64) -> s64 +roundtrip-float32: func(a: float32) -> float32 +roundtrip-float64: func(a: float64) -> float64 +roundtrip-char: func(a: char) -> char -set-scalar: function(a: u32) -get-scalar: function() -> u32 +set-scalar: func(a: u32) +get-scalar: func() -> u32 diff --git a/tests/runtime/numbers/imports.wit b/tests/runtime/numbers/imports.wit index 66590714d..ef13f9a07 100644 --- a/tests/runtime/numbers/imports.wit +++ b/tests/runtime/numbers/imports.wit @@ -1,14 +1,14 @@ -roundtrip-u8: function(a: u8) -> u8 -roundtrip-s8: function(a: s8) -> s8 -roundtrip-u16: function(a: u16) -> u16 -roundtrip-s16: function(a: s16) -> s16 -roundtrip-u32: function(a: u32) -> u32 -roundtrip-s32: function(a: s32) -> s32 -roundtrip-u64: function(a: u64) -> u64 -roundtrip-s64: function(a: s64) -> s64 -roundtrip-float32: function(a: float32) -> float32 -roundtrip-float64: function(a: float64) -> float64 -roundtrip-char: function(a: char) -> char +roundtrip-u8: func(a: u8) -> u8 +roundtrip-s8: func(a: s8) -> s8 +roundtrip-u16: func(a: u16) -> u16 +roundtrip-s16: func(a: s16) -> s16 +roundtrip-u32: func(a: u32) -> u32 +roundtrip-s32: func(a: s32) -> s32 +roundtrip-u64: func(a: u64) -> u64 +roundtrip-s64: func(a: s64) -> s64 +roundtrip-float32: func(a: float32) -> float32 +roundtrip-float64: func(a: float64) -> float64 +roundtrip-char: func(a: char) -> char -set-scalar: function(a: u32) -get-scalar: function() -> u32 +set-scalar: func(a: u32) +get-scalar: func() -> u32 diff --git a/tests/runtime/records/exports.wit b/tests/runtime/records/exports.wit index 2dc9d8813..45dcdbf15 100644 --- a/tests/runtime/records/exports.wit +++ b/tests/runtime/records/exports.wit @@ -1,14 +1,14 @@ -test-imports: function() +test-imports: func() -multiple-results: function() -> tuple +multiple-results: func() -> tuple -swap-tuple: function(a: tuple) -> tuple +swap-tuple: func(a: tuple) -> tuple flags f1 { a, b } -roundtrip-flags1: function(a: f1) -> f1 +roundtrip-flags1: func(a: f1) -> f1 flags f2 { c, d, e } -roundtrip-flags2: function(a: f2) -> f2 +roundtrip-flags2: func(a: f2) -> f2 flags f8 { b0, b1, b2, b3, b4, b5, b6, b7, @@ -37,10 +37,10 @@ flags f64 { b56, b57, b58, b59, b60, b61, b62, b63, } -roundtrip-flags3: function(a: f8, b: f16, c: f32, d: f64) -> tuple +roundtrip-flags3: func(a: f8, b: f16, c: f32, d: f64) -> tuple record r1 { a: u8, b: f1 } -roundtrip-record1: function(a: r1) -> r1 +roundtrip-record1: func(a: r1) -> r1 -tuple0: function(a: tuple<>) -> tuple<> -tuple1: function(a: tuple) -> tuple +tuple0: func(a: tuple<>) -> tuple<> +tuple1: func(a: tuple) -> tuple diff --git a/tests/runtime/records/imports.wit b/tests/runtime/records/imports.wit index 05c5c02a2..304fa31ad 100644 --- a/tests/runtime/records/imports.wit +++ b/tests/runtime/records/imports.wit @@ -1,12 +1,12 @@ -multiple-results: function() -> tuple +multiple-results: func() -> tuple -swap-tuple: function(a: tuple) -> tuple +swap-tuple: func(a: tuple) -> tuple flags f1 { a, b } -roundtrip-flags1: function(a: f1) -> f1 +roundtrip-flags1: func(a: f1) -> f1 flags f2 { c, d, e } -roundtrip-flags2: function(a: f2) -> f2 +roundtrip-flags2: func(a: f2) -> f2 flags flag8 { b0, b1, b2, b3, b4, b5, b6, b7, @@ -35,10 +35,10 @@ flags flag64 { b56, b57, b58, b59, b60, b61, b62, b63, } -roundtrip-flags3: function(a: flag8, b: flag16, c: flag32, d: flag64) -> tuple +roundtrip-flags3: func(a: flag8, b: flag16, c: flag32, d: flag64) -> tuple record r1 { a: u8, b: f1 } -roundtrip-record1: function(a: r1) -> r1 +roundtrip-record1: func(a: r1) -> r1 -tuple0: function(a: tuple<>) -> tuple<> -tuple1: function(a: tuple) -> tuple +tuple0: func(a: tuple<>) -> tuple<> +tuple1: func(a: tuple) -> tuple diff --git a/tests/runtime/smoke/exports.wit b/tests/runtime/smoke/exports.wit index 81be126d0..ac15d82c0 100644 --- a/tests/runtime/smoke/exports.wit +++ b/tests/runtime/smoke/exports.wit @@ -1 +1 @@ -thunk: function() +thunk: func() diff --git a/tests/runtime/smoke/imports.wit b/tests/runtime/smoke/imports.wit index 81be126d0..ac15d82c0 100644 --- a/tests/runtime/smoke/imports.wit +++ b/tests/runtime/smoke/imports.wit @@ -1 +1 @@ -thunk: function() +thunk: func() diff --git a/tests/runtime/smw_functions/exports.wit b/tests/runtime/smw_functions/exports.wit index 1cd2e2e42..802fcdb2f 100644 --- a/tests/runtime/smw_functions/exports.wit +++ b/tests/runtime/smw_functions/exports.wit @@ -1,12 +1,12 @@ -test-imports: function() +test-imports: func() -f1: function() -f2: function(a: u32) -f3: function(a: u32, b: u32) +f1: func() +f2: func(a: u32) +f3: func(a: u32, b: u32) -f4: function() -> u32 +f4: func() -> u32 // TODO: shoudl re-enable when re-implemented -//f5: function() -> tuple +//f5: func() -> tuple // -//f6: function(a: u32, b: u32, c: u32) -> tuple +//f6: func(a: u32, b: u32, c: u32) -> tuple diff --git a/tests/runtime/smw_functions/imports.wit b/tests/runtime/smw_functions/imports.wit index fab034840..e3fe649c5 100644 --- a/tests/runtime/smw_functions/imports.wit +++ b/tests/runtime/smw_functions/imports.wit @@ -1,9 +1,9 @@ -f1: function() -f2: function(a: u32) -f3: function(a: u32, b: u32) +f1: func() +f2: func(a: u32) +f3: func(a: u32, b: u32) -f4: function() -> u32 +f4: func() -> u32 // TODO: should re-enable when re-implemented -//f5: function() -> tuple +//f5: func() -> tuple // -//f6: function(a: u32, b: u32, c: u32) -> tuple +//f6: func(a: u32, b: u32, c: u32) -> tuple diff --git a/tests/runtime/smw_lists/exports.wit b/tests/runtime/smw_lists/exports.wit index 91fb43cf5..f87a89b65 100644 --- a/tests/runtime/smw_lists/exports.wit +++ b/tests/runtime/smw_lists/exports.wit @@ -1,7 +1,7 @@ -test-imports: function() +test-imports: func() -f1: function(l: list) -f2: function() -> list +f1: func(l: list) +f2: func() -> list // TODO: should re-enable when re-implemented -// f3: function(a: list, b: list) -> tuple, list> -f4: function(l: list>) -> list> +// f3: func(a: list, b: list) -> tuple, list> +f4: func(l: list>) -> list> diff --git a/tests/runtime/smw_lists/imports.wit b/tests/runtime/smw_lists/imports.wit index 5a00320cc..19bf5db0d 100644 --- a/tests/runtime/smw_lists/imports.wit +++ b/tests/runtime/smw_lists/imports.wit @@ -1,5 +1,5 @@ -f1: function(l: list) -f2: function() -> list +f1: func(l: list) +f2: func() -> list // TODO: should re-enable when re-implemented -// f3: function(a: list, b: list) -> tuple, list> -f4: function(l: list>) -> list> +// f3: func(a: list, b: list) -> tuple, list> +f4: func(l: list>) -> list> diff --git a/tests/runtime/smw_strings/exports.wit b/tests/runtime/smw_strings/exports.wit index 3b999f0f4..9c1292ee2 100644 --- a/tests/runtime/smw_strings/exports.wit +++ b/tests/runtime/smw_strings/exports.wit @@ -1,7 +1,7 @@ -test-imports: function() +test-imports: func() -f1: function(s: string) -f2: function() -> string +f1: func(s: string) +f2: func() -> string // TODO: should re-enable when fixed -//f3: function(a: string, b:string, c: string) -> tuple +//f3: func(a: string, b:string, c: string) -> tuple diff --git a/tests/runtime/smw_strings/imports.wit b/tests/runtime/smw_strings/imports.wit index ee1146629..56c81b106 100644 --- a/tests/runtime/smw_strings/imports.wit +++ b/tests/runtime/smw_strings/imports.wit @@ -1,4 +1,4 @@ -f1: function(s: string) -f2: function() -> string +f1: func(s: string) +f2: func() -> string // TODO: should re-enable when fixed -//f3: function(a: string, b:string, c: string) -> tuple +//f3: func(a: string, b:string, c: string) -> tuple diff --git a/tests/runtime/variants/exports.wit b/tests/runtime/variants/exports.wit index 019db9ca2..de0f94302 100644 --- a/tests/runtime/variants/exports.wit +++ b/tests/runtime/variants/exports.wit @@ -1,12 +1,12 @@ -test-imports: function() +test-imports: func() -roundtrip-option: function(a: option) -> option -roundtrip-result: function(a: expected) -> expected +roundtrip-option: func(a: option) -> option +roundtrip-result: func(a: expected) -> expected enum e1 { a, b } -roundtrip-enum: function(a: e1) -> e1 +roundtrip-enum: func(a: e1) -> e1 -invert-bool: function(a: bool) -> bool +invert-bool: func(a: bool) -> bool variant c1 { a(s32), b(s64) } variant c2 { a(s32), b(float32) } @@ -15,16 +15,16 @@ variant c4 { a(s64), b(float32) } variant c5 { a(s64), b(float64) } variant c6 { a(float32), b(float64) } type casts = tuple -variant-casts: function(a: casts) -> casts +variant-casts: func(a: casts) -> casts variant z1 { a(s32), b } variant z2 { a(s64), b } variant z3 { a(float32), b } variant z4 { a(float64), b } type zeros = tuple -variant-zeros: function(a: zeros) -> zeros +variant-zeros: func(a: zeros) -> zeros type option-typedef = option type bool-typedef = bool type result-typedef = expected -variant-typedefs: function(a: option-typedef, b: bool-typedef, c: result-typedef) +variant-typedefs: func(a: option-typedef, b: bool-typedef, c: result-typedef) diff --git a/tests/runtime/variants/imports.wit b/tests/runtime/variants/imports.wit index 7ddab93b3..5223d4d7c 100644 --- a/tests/runtime/variants/imports.wit +++ b/tests/runtime/variants/imports.wit @@ -1,10 +1,10 @@ -roundtrip-option: function(a: option) -> option -roundtrip-result: function(a: expected) -> expected +roundtrip-option: func(a: option) -> option +roundtrip-result: func(a: expected) -> expected enum e1 { a, b } -roundtrip-enum: function(a: e1) -> e1 +roundtrip-enum: func(a: e1) -> e1 -invert-bool: function(a: bool) -> bool +invert-bool: func(a: bool) -> bool variant c1 { a(s32), b(s64) } variant c2 { a(s32), b(float32) } @@ -13,19 +13,19 @@ variant c4 { a(s64), b(float32) } variant c5 { a(s64), b(float64) } variant c6 { a(float32), b(float64) } type casts = tuple -variant-casts: function(a: casts) -> casts +variant-casts: func(a: casts) -> casts variant z1 { a(s32), b } variant z2 { a(s64), b } variant z3 { a(float32), b } variant z4 { a(float64), b } type zeros = tuple -variant-zeros: function(a: zeros) -> zeros +variant-zeros: func(a: zeros) -> zeros type option-typedef = option type bool-typedef = bool type result-typedef = expected -variant-typedefs: function(a: option-typedef, b: bool-typedef, c: result-typedef) +variant-typedefs: func(a: option-typedef, b: bool-typedef, c: result-typedef) enum my-errno { success, a, b } -variant-enums: function(a: bool, b: expected, c: my-errno) -> tuple, my-errno> +variant-enums: func(a: bool, b: expected, c: my-errno) -> tuple, my-errno>