Skip to content

Commit

Permalink
refactor: Use collect_breaking_versions from v2 directly in PG (Nomic…
Browse files Browse the repository at this point in the history
…Foundation#1002)

Part of NomicFoundation#638

Follow-up to NomicFoundation#991

Pretty straightforward: instead of visiting the previously built v1
definition structure, we defer to `Language::collect_breaking_changes`
as the definitions overlap - the breaking changes are defined as
versions in which the syntax items may be evaluated differently, which
means that these are exactly the versions that will be referenced for
the conditional syntax item evaluation in the parser/lexer.

Refactor `BuiltInLabel` to avoid duplication (NomicFoundation#992)

Spin off of NomicFoundation#976

Moves the `BuiltInLabel` enum from the parser generator into the
language definition and remove duplication in the `kinds` template.

add wit

generating wit and glue

stub adaptors, wit feature flag

glue macros

remove wit_bindgen

fix wit gen paths

add wit-bindgen

export the kinds

pub export macro for wit

improve export macro

world => slang

fully implement glue

convert query matches

refactor ffi glue macros

refactor wit

variant rather than enum

back to enum
  • Loading branch information
Xanewok authored and OmarTawfik committed Aug 4, 2024
1 parent 3dc076f commit 76743c7
Show file tree
Hide file tree
Showing 55 changed files with 18,419 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"editor.rulers": [120],
"files.associations": {
"**/documentation/overrides/**/*.html": "jinja-html",
"*.ts.jinja2": "jinja-js" // until this is merged: https://github.com/samuelcolvin/jinjahtml-vscode/pull/148
"*.ts.jinja2": "jinja-js", // until this is merged: https://github.com/samuelcolvin/jinjahtml-vscode/pull/148
"*.wit.jinja2": "jinja" // until this is merged: https://github.com/samuelcolvin/jinjahtml-vscode/pull/148
},
"editor.unicodeHighlight.allowedCharacters": {
"꞉": true // used in CST snapshot tests
Expand Down
173 changes: 173 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ napi-derive = { version = "2.16.10" }
nom = { version = "7.1.3" }
num-format = { version = "0.4.4" }
once_cell = { version = "1.19.0" }
paste = { version = "1.0.15" }
proc-macro2 = { version = "1.0.86" }
quote = { version = "1.0.36" }
rayon = { version = "1.10.0" }
Expand Down Expand Up @@ -148,6 +149,8 @@ thiserror = { version = "1.0.63" }
toml = { version = "0.8.19" }
trybuild = { version = "1.0.99" }
url = { version = "2.4.1", features = ["serde"] }
wit-bindgen = { version = "0.26.0" }
wit-bindgen-cli = { version = "0.26.0" }

[workspace.lints.rust]
unused_crate_dependencies = "warn"
Expand Down
4 changes: 4 additions & 0 deletions crates/codegen/runtime/cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@ description = "Cargo runtime copied over by codegen"
# __RUST_PRODUCT_CRATE_FEATURES__ (keep in sync)
[features]
default = ["cli"]
wit = ["dep:paste", "dep:wit-bindgen"]
cli = ["dep:ariadne", "dep:clap", "dep:serde_json"]
__experimental_bindings_api = ["dep:metaslang_bindings"]
__private_testing_utils = ["dep:ariadne"]

[build-dependencies]
anyhow = { workspace = true }
codegen_runtime_generator = { workspace = true }
infra_utils = { workspace = true }

[dependencies]
ariadne = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
metaslang_bindings = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
paste = { workspace = true, optional = true }
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
strum = { workspace = true }
strum_macros = { workspace = true }
thiserror = { workspace = true }
wit-bindgen = { workspace = true, optional = true }

[lints]
workspace = true
7 changes: 6 additions & 1 deletion crates/codegen/runtime/cargo/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use anyhow::Result;
use codegen_runtime_generator::OutputLanguage;
use infra_utils::cargo::CargoWorkspace;

fn main() -> Result<()> {
OutputLanguage::Cargo.generate_stubs()
OutputLanguage::Cargo.generate_stubs()?;
let output_dir =
CargoWorkspace::locate_source_crate("codegen_runtime_cargo")?.join("src/runtime");
OutputLanguage::Cargo.wit_bindgen(&output_dir)?;
Ok(())
}

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

Loading

0 comments on commit 76743c7

Please sign in to comment.