Skip to content

Commit

Permalink
Remove obsolete build-graph command from slang_solidity binary
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiraldez committed Jul 5, 2024
1 parent 6ac3411 commit a4e2127
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 330 deletions.
4 changes: 1 addition & 3 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions crates/codegen/runtime/cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ariadne = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
metaslang_bindings = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true, optional = true }
napi = { workspace = true, optional = true }
napi-derive = { workspace = true, optional = true }
semver = { workspace = true }
Expand All @@ -35,7 +34,7 @@ cli = ["dep:clap", "dep:serde_json", "__private_ariadne"]
# Only used by the `slang_solidity` CLI
__private_ariadne = ["dep:ariadne"]
# For internal development only
__experimental_bindings_api = ["dep:metaslang_bindings", "dep:metaslang_graph_builder"]
__experimental_bindings_api = ["dep:metaslang_bindings"]

[lints]
workspace = true
12 changes: 0 additions & 12 deletions crates/codegen/runtime/cargo/src/runtime/bindings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#[path = "generated/binding_rules.rs"]
mod binding_rules;

pub mod graph_builder {
use metaslang_graph_builder::{ast, functions, graph};

use crate::cst::KindTypes;

pub type File = ast::File<KindTypes>;
pub type Functions = functions::Functions<KindTypes>;
pub type Graph = graph::Graph<KindTypes>;

pub use metaslang_graph_builder::{ExecutionConfig, NoCancellation, Variables};
}

use metaslang_bindings;
pub use metaslang_bindings::BindingsError;
use semver::Version;
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions crates/codegen/runtime/cargo/src/runtime/cli/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use thiserror::Error;

#[cfg(feature = "__experimental_bindings_api")]
pub mod bindings;
#[cfg(feature = "__experimental_bindings_api")]
pub mod build_graph;
pub mod parse;

#[derive(Debug, Error)]
Expand All @@ -20,10 +18,6 @@ pub enum CommandError {
#[error("Parsing failed: {0}")]
ParseFailed(String),

#[cfg(feature = "__experimental_bindings_api")]
#[error(transparent)]
ExecutionFailed(#[from] metaslang_graph_builder::ExecutionError),

#[cfg(feature = "__experimental_bindings_api")]
#[error(transparent)]
BuildError(#[from] metaslang_bindings::builder::BuildError),
Expand Down
31 changes: 0 additions & 31 deletions crates/codegen/runtime/cargo/src/runtime/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,6 @@ pub enum Commands {
json: bool,
},

// This is only intended for internal development
#[cfg(feature = "__experimental_bindings_api")]
/// Parses a source file and builds a graph executing the instructions from the builder file (*.msgb)
BuildGraph {
/// File path to the source file to parse
file_path: String,

/// The language version to use for parsing
#[arg(short, long)]
version: Version,

/// The graph buider (.msgb) file to use
msgb_path: String,

/// Print the graph as JSON
#[clap(long)]
json: bool,

/// Include debug info (location, variable and match) in the built graph
#[clap(long)]
debug: bool,
},

/// This is only intended for internal development
#[cfg(feature = "__experimental_bindings_api")]
Bindings {
Expand All @@ -65,14 +42,6 @@ impl Commands {
json,
} => commands::parse::execute(&file_path, version, json),
#[cfg(feature = "__experimental_bindings_api")]
Commands::BuildGraph {
file_path,
version,
msgb_path,
json,
debug,
} => commands::build_graph::execute(&file_path, version, &msgb_path, json, debug),
#[cfg(feature = "__experimental_bindings_api")]
Commands::Bindings { file_path, version } => {
commands::bindings::execute(&file_path, version)
}
Expand Down
3 changes: 1 addition & 2 deletions crates/solidity/outputs/cargo/slang_solidity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cli = ["dep:clap", "dep:serde_json", "__private_ariadne"]
# This is meant to be used by the CLI or internally only.
__private_ariadne = ["dep:ariadne"]
# For internal development only
__experimental_bindings_api = ["dep:metaslang_bindings", "dep:metaslang_graph_builder"]
__experimental_bindings_api = ["dep:metaslang_bindings"]

[build-dependencies] # __REMOVE_THIS_LINE_DURING_CARGO_PUBLISH__
anyhow = { workspace = true } # __REMOVE_THIS_LINE_DURING_CARGO_PUBLISH__
Expand All @@ -50,7 +50,6 @@ ariadne = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
metaslang_bindings = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true, optional = true }
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
Expand Down

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

This file was deleted.

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

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

4 changes: 2 additions & 2 deletions crates/solidity/outputs/cargo/slang_solidity/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use slang_solidity::cli::Commands;
// This is a known issue, and we should remove this hack once there is a better solution from Cargo.
// https://github.com/rust-lang/cargo/issues/1982
mod supress_api_dependencies {
#[cfg(feature = "__experimental_bindings_api")]
use metaslang_bindings as _;
use {
ariadne as _, metaslang_cst as _, semver as _, serde as _, serde_json as _, strum as _,
strum_macros as _, thiserror as _,
};
#[cfg(feature = "__experimental_bindings_api")]
use {metaslang_bindings as _, metaslang_graph_builder as _};
}

#[derive(ClapParser, Debug)]
Expand Down
3 changes: 1 addition & 2 deletions crates/testlang/outputs/cargo/slang_testlang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ testlang_language = { workspace = true }
[dependencies]
metaslang_bindings = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true, optional = true }
semver = { workspace = true }
serde = { workspace = true }
strum = { workspace = true }
Expand All @@ -26,4 +25,4 @@ thiserror = { workspace = true }
workspace = true

[features]
__experimental_bindings_api = ["dep:metaslang_bindings", "dep:metaslang_graph_builder"]
__experimental_bindings_api = ["dep:metaslang_bindings"]

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

Loading

0 comments on commit a4e2127

Please sign in to comment.