Skip to content

Commit b71eaa9

Browse files
authored
Move runtime cargo (#1422)
Builds on top of #1420 and in turn of #1411 It finishes moving `crates/codegen/runtime/cargo/crate` to the `solidity_crate`. Notes on changes: * The former `src/generated` folder that contained the cst, parser, etc is renamed to `src/slang`. * The generation of IR languages posed a challenge: their generation can't be inlined, as from the same set of templates we generate various IR languages. This PR replaces the logic to keep the same naming convention that with the inlined templates: instead of `<ir>/generated/<template_name>.rs` it generates `<ir>/<template_name>.generated.rs`. * There are no more stubs, therefore, a check is added in each IR template to ensure that it's being generated with the proper model. Otherwise, an empty string is generated, which isn't written into a file. ~Note: It can be easily adapted to be independent of #1420 (but not of #1411). It can also be split in two, with the last commit being in a different PR. But It's probably OK as is.~
1 parent a8cde52 commit b71eaa9

File tree

179 files changed

+971
-4474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+971
-4474
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ Currently, the repository has the following projects:
1414
- `infra/`: contains the CLI used for development, and utilities to build/test/run/debug all other projects.
1515
- `codegen/`: language analysis APIs that convert input crates to output crates below.
1616
- `ebnf/`: EBNF snippet serializer for language definitions
17+
- `generator/`: Generates Rust source code from language definitions
18+
- `language/definition`: Building blocks for how languages can be defined
1719
- `spec/`: Language specification generator
18-
- `runtime/`:
19-
- `generator/`: Generates Rust source code from language definitions
20-
- `cargo/crate`: Rust crate runtime code which gets copied over into generated language code.
21-
- `cargo/wasm`: WASM bindings and runtime.
22-
- `language/definition`: Building blocks for how languages can be defined
2320
- `metaslang/`:
2421
- `cst/`: A generic library for building, navigating and querying concrete syntax trees
2522
- `bindings/`: Computes semantic language bindings from parsed source code
2623
- `graph_builder/`: Construct binding graphs from parsed source code
2724
- `solidity/`:
2825
- `inputs/`: Solidity language definition.
2926
- `outputs/`: different packages and artifacts produced from it.
27+
- `cargo/crate`: Rust runtime and API.
28+
- `cargo/wasm`: WASM bindings and runtime.
29+
- `npm/package`: NodeJS bindings and runtime.
3030
- `documentation/`: mkdocs site to render project documentation.
3131

3232
## Dev Containers

Cargo.lock

Lines changed: 19 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ publish = false
88
resolver = "2"
99
members = [
1010
"crates/codegen/ebnf",
11+
"crates/codegen/generator",
1112
"crates/codegen/language/definition",
1213
"crates/codegen/language/internal_macros",
1314
"crates/codegen/language/macros",
1415
"crates/codegen/language/tests",
1516
"crates/codegen/runner",
16-
"crates/codegen/runtime/cargo/crate",
17-
"crates/codegen/runtime/generator",
1817
"crates/codegen/spec",
1918
"crates/codegen/testing",
2019

@@ -45,13 +44,12 @@ members = [
4544
# Internal
4645
#
4746
codegen_ebnf = { path = "crates/codegen/ebnf", version = "1.2.1" }
47+
codegen_generator = { path = "crates/codegen/generator", version = "1.2.1" }
4848
codegen_language_definition = { path = "crates/codegen/language/definition", version = "1.2.1" }
4949
codegen_language_internal_macros = { path = "crates/codegen/language/internal_macros", version = "1.2.1" }
5050
codegen_language_macros = { path = "crates/codegen/language/macros", version = "1.2.1" }
5151
codegen_language_tests = { path = "crates/codegen/language/tests", version = "1.2.1" }
5252
codegen_runner = { path = "crates/codegen/runner", version = "1.2.1" }
53-
codegen_runtime_cargo_crate = { path = "crates/codegen/runtime/cargo/crate", version = "1.2.1" }
54-
codegen_runtime_generator = { path = "crates/codegen/runtime/generator", version = "1.2.1" }
5553
codegen_spec = { path = "crates/codegen/spec", version = "1.2.1" }
5654
codegen_testing = { path = "crates/codegen/testing", version = "1.2.1" }
5755

crates/codegen/runtime/generator/Cargo.toml renamed to crates/codegen/generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "codegen_runtime_generator"
2+
name = "codegen_generator"
33
version.workspace = true
44
rust-version.workspace = true
55
edition.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)