Skip to content

Commit

Permalink
WIT: Parse and print a semicolon after package statements (#1221)
Browse files Browse the repository at this point in the history
* WIT: Parse and print a semicolon after `package` statements

* Update wit-parser tests

* Update other `package` statements with semicolons

* Bump wit-parser version and other deps
  • Loading branch information
alexcrichton authored Sep 27, 2023
1 parent df170e6 commit 22b06c1
Show file tree
Hide file tree
Showing 367 changed files with 382 additions and 380 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-tools"
version = "1.0.43"
version = "1.0.44"
authors = ["The Wasmtime Project Developers"]
edition.workspace = true
description = "CLI tools for interoperating with WebAssembly files"
Expand Down Expand Up @@ -45,7 +45,7 @@ pretty_assertions = "1.3.0"
semver = "1.0.0"

wasm-encoder = { version = "0.33.2", path = "crates/wasm-encoder" }
wasm-compose = { version = "0.4.5", path = "crates/wasm-compose" }
wasm-compose = { version = "0.4.6", path = "crates/wasm-compose" }
wasm-metadata = { version = "0.10.6", path = "crates/wasm-metadata" }
wasm-mutate = { version = "0.2.35", path = "crates/wasm-mutate" }
wasm-shrink = { version = "0.1.36", path = "crates/wasm-shrink" }
Expand All @@ -54,9 +54,9 @@ wasmparser = { version = "0.113.2", path = "crates/wasmparser" }
wasmprinter = { version = "0.2.67", path = "crates/wasmprinter" }
wast = { version = "65.0.2", path = "crates/wast" }
wat = { version = "1.0.74", path = "crates/wat" }
wit-component = { version = "0.14.3", path = "crates/wit-component" }
wit-parser = { version = "0.11.2", path = "crates/wit-parser" }
wit-smith = { version = "0.1.13", path = "crates/wit-smith" }
wit-component = { version = "0.14.4", path = "crates/wit-component" }
wit-parser = { version = "0.11.3", path = "crates/wit-parser" }
wit-smith = { version = "0.1.14", path = "crates/wit-smith" }

[dependencies]
anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm-compose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-compose"
version = "0.4.5"
version = "0.4.6"
edition.workspace = true
authors = ["Peter Huene <[email protected]>"]
license = "Apache-2.0 WITH LLVM-exception"
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-component/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wit-component"
authors = ["Peter Huene <[email protected]>"]
version = "0.14.3"
version = "0.14.4"
edition.workspace = true
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions crates/wit-component/src/printing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl WitPrinter {
if let Some(version) = &pkg.name.version {
self.output.push_str(&format!("@{version}"));
}
self.print_semicolon();
self.output.push_str("\n\n");
for (name, id) in pkg.interfaces.iter() {
self.print_docs(&resolve.interfaces[*id].docs);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
import foo: func(x: string);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package foo:foo
package foo:foo;

world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
import foo: interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;
world module {
import foo: func();
import bar: func() -> string;
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-component/tests/components/empty/module.wit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
type foo = u8;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
export a: func(x: string) -> string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
export foo: interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:bar
package foo:bar;

world module {
resource a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:bar
package foo:bar;

world module {
resource a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
import foo: interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package test:test
package test:test;

world lib-bar { }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:test
package test:test;

interface test {
foo: func(v: s32) -> s32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:test
package test:test;

interface test {
foo: func(v: s32) -> s32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:test
package test:test;

interface test {
foo: func(v: s32) -> s32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;
world module {
export a: func();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
export foo: interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
a: func();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world module {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
record f {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface name {
record foo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:bar
package foo:bar;

world module {
export foo: interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
record foo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
type a = u8;
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-component/tests/components/exports/module.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
export a: func();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:bar
package foo:bar;

interface foo {
resource a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface foo {
a: func();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
import foo: interface {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:dep
package foo:dep;

interface the-name {
a: func();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface the-name {
a: func();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

world module {
import foo: interface {
Expand Down
Loading

0 comments on commit 22b06c1

Please sign in to comment.