diff --git a/Cargo.lock b/Cargo.lock index 4c50516204..10f69761a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1229,13 +1229,27 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "leo-ast" +version = "1.0.3" +dependencies = [ + "criterion", + "leo-grammar", + "leo-input", + "pest", + "serde", + "serde_json", + "snarkos-errors", + "snarkos-models", +] + [[package]] name = "leo-compiler" version = "1.0.3" dependencies = [ "bincode", "hex", - "leo-core-ast", + "leo-ast", "leo-core-packages", "leo-gadgets", "leo-grammar", @@ -1264,25 +1278,11 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "leo-core-ast" -version = "1.0.3" -dependencies = [ - "criterion", - "leo-grammar", - "leo-input", - "pest", - "serde", - "serde_json", - "snarkos-errors", - "snarkos-models", -] - [[package]] name = "leo-core-packages" version = "1.0.3" dependencies = [ - "leo-core-ast", + "leo-ast", "leo-gadgets", "rand", "rand_xorshift", @@ -1327,7 +1327,7 @@ dependencies = [ name = "leo-imports" version = "1.0.3" dependencies = [ - "leo-core-ast", + "leo-ast", "leo-grammar", "thiserror", "tracing", @@ -1362,8 +1362,8 @@ dependencies = [ "env_logger 0.8.1", "from-pest", "lazy_static", + "leo-ast", "leo-compiler", - "leo-core-ast", "leo-gadgets", "leo-imports", "leo-input", @@ -1414,7 +1414,7 @@ dependencies = [ name = "leo-state" version = "1.0.3" dependencies = [ - "leo-core-ast", + "leo-ast", "leo-input", "rand", "rand_xorshift", @@ -1433,7 +1433,7 @@ dependencies = [ name = "leo-symbol-table" version = "1.0.3" dependencies = [ - "leo-core-ast", + "leo-ast", "leo-core-packages", "leo-grammar", "leo-imports", @@ -1445,7 +1445,7 @@ dependencies = [ name = "leo-type-inference" version = "1.0.3" dependencies = [ - "leo-core-ast", + "leo-ast", "leo-grammar", "leo-imports", "leo-symbol-table", diff --git a/Cargo.toml b/Cargo.toml index e79ed39390..52d6881e08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,8 @@ path = "leo/main.rs" [workspace] members = [ + "ast", "compiler", - "core-ast", "core-packages", "gadgets", "grammar", @@ -40,12 +40,12 @@ members = [ "type-inference", ] -[dependencies.leo-compiler] -path = "./compiler" +[dependencies.leo-ast] +path = "./ast" version = "1.0.3" -[dependencies.leo-core-ast] -path = "./core-ast" +[dependencies.leo-compiler] +path = "./compiler" version = "1.0.3" [dependencies.leo-gadgets] diff --git a/core-ast/Cargo.toml b/ast/Cargo.toml similarity index 91% rename from core-ast/Cargo.toml rename to ast/Cargo.toml index 282c7cd4a5..47cf163d38 100644 --- a/core-ast/Cargo.toml +++ b/ast/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "leo-core-ast" +name = "leo-ast" version = "1.0.3" authors = [ "The Aleo Team " ] description = "Core AST of the Leo programming language" @@ -18,12 +18,12 @@ license = "GPL-3.0" edition = "2018" [[bin]] -name = "leo_core_ast" +name = "leo_ast" path = "src/main.rs" [[bench]] -name = "core_ast" -path = "benches/core_ast.rs" +name = "leo_ast" +path = "benches/leo_ast.rs" harness = false [dependencies.leo-grammar] diff --git a/core-ast/benches/big_circuit.leo b/ast/benches/big_circuit.leo similarity index 100% rename from core-ast/benches/big_circuit.leo rename to ast/benches/big_circuit.leo diff --git a/core-ast/benches/big_if_else.leo b/ast/benches/big_if_else.leo similarity index 100% rename from core-ast/benches/big_if_else.leo rename to ast/benches/big_if_else.leo diff --git a/core-ast/benches/big_ternary.leo b/ast/benches/big_ternary.leo similarity index 100% rename from core-ast/benches/big_ternary.leo rename to ast/benches/big_ternary.leo diff --git a/core-ast/benches/core_ast.rs b/ast/benches/leo_ast.rs similarity index 79% rename from core-ast/benches/core_ast.rs rename to ast/benches/leo_ast.rs index d95ee191d3..e510b4d7c8 100644 --- a/core-ast/benches/core_ast.rs +++ b/ast/benches/leo_ast.rs @@ -14,14 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::LeoCoreAst; +use leo_ast::LeoAst; use leo_grammar::Grammar; use criterion::{criterion_group, criterion_main, Criterion}; use std::{path::Path, time::Duration}; -fn leo_core_ast<'ast>(ast: &Grammar<'ast>) -> LeoCoreAst { - LeoCoreAst::new("leo_core_tree", &ast) +fn leo_ast<'ast>(ast: &Grammar<'ast>) -> LeoAst { + LeoAst::new("leo_core_tree", &ast) } fn bench_big_if_else(c: &mut Criterion) { @@ -29,7 +29,7 @@ fn bench_big_if_else(c: &mut Criterion) { let program_string = include_str!("./big_if_else.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::big_if_else", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::big_if_else", |b| b.iter(|| leo_ast(&ast))); } fn bench_big_ternary(c: &mut Criterion) { @@ -37,7 +37,7 @@ fn bench_big_ternary(c: &mut Criterion) { let program_string = include_str!("./big_ternary.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::big_ternary", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::big_ternary", |b| b.iter(|| leo_ast(&ast))); } fn bench_big_circuit(c: &mut Criterion) { @@ -45,7 +45,7 @@ fn bench_big_circuit(c: &mut Criterion) { let program_string = include_str!("./big_circuit.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::big_circuit", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::big_circuit", |b| b.iter(|| leo_ast(&ast))); } fn bench_long_expr(c: &mut Criterion) { @@ -53,7 +53,7 @@ fn bench_long_expr(c: &mut Criterion) { let program_string = include_str!("./long_expr.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::long_expr", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::long_expr", |b| b.iter(|| leo_ast(&ast))); } fn bench_long_array(c: &mut Criterion) { @@ -61,7 +61,7 @@ fn bench_long_array(c: &mut Criterion) { let program_string = include_str!("./long_array.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::long_array", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::long_array", |b| b.iter(|| leo_ast(&ast))); } fn bench_many_foos(c: &mut Criterion) { @@ -69,7 +69,7 @@ fn bench_many_foos(c: &mut Criterion) { let program_string = include_str!("./many_foos.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::many_foos", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::many_foos", |b| b.iter(|| leo_ast(&ast))); } fn bench_many_assigns(c: &mut Criterion) { @@ -77,7 +77,7 @@ fn bench_many_assigns(c: &mut Criterion) { let program_string = include_str!("./many_assigns.leo"); let ast = Grammar::new(&filepath, program_string).unwrap(); - c.bench_function("LeoCoreAst::many_assigns", |b| b.iter(|| leo_core_ast(&ast))); + c.bench_function("LeoAst::many_assigns", |b| b.iter(|| leo_ast(&ast))); } criterion_group!( diff --git a/core-ast/benches/long_array.leo b/ast/benches/long_array.leo similarity index 100% rename from core-ast/benches/long_array.leo rename to ast/benches/long_array.leo diff --git a/core-ast/benches/long_expr.leo b/ast/benches/long_expr.leo similarity index 100% rename from core-ast/benches/long_expr.leo rename to ast/benches/long_expr.leo diff --git a/core-ast/benches/many_assigns.leo b/ast/benches/many_assigns.leo similarity index 100% rename from core-ast/benches/many_assigns.leo rename to ast/benches/many_assigns.leo diff --git a/core-ast/benches/many_foos.leo b/ast/benches/many_foos.leo similarity index 100% rename from core-ast/benches/many_foos.leo rename to ast/benches/many_foos.leo diff --git a/core-ast/src/annotation.rs b/ast/src/annotation.rs similarity index 100% rename from core-ast/src/annotation.rs rename to ast/src/annotation.rs diff --git a/core-ast/src/circuits/circuit.rs b/ast/src/circuits/circuit.rs similarity index 100% rename from core-ast/src/circuits/circuit.rs rename to ast/src/circuits/circuit.rs diff --git a/core-ast/src/circuits/circuit_member.rs b/ast/src/circuits/circuit_member.rs similarity index 100% rename from core-ast/src/circuits/circuit_member.rs rename to ast/src/circuits/circuit_member.rs diff --git a/core-ast/src/circuits/circuit_variable_definition.rs b/ast/src/circuits/circuit_variable_definition.rs similarity index 100% rename from core-ast/src/circuits/circuit_variable_definition.rs rename to ast/src/circuits/circuit_variable_definition.rs diff --git a/core-ast/src/circuits/mod.rs b/ast/src/circuits/mod.rs similarity index 100% rename from core-ast/src/circuits/mod.rs rename to ast/src/circuits/mod.rs diff --git a/core-ast/src/common/assignee.rs b/ast/src/common/assignee.rs similarity index 100% rename from core-ast/src/common/assignee.rs rename to ast/src/common/assignee.rs diff --git a/core-ast/src/common/declare.rs b/ast/src/common/declare.rs similarity index 100% rename from core-ast/src/common/declare.rs rename to ast/src/common/declare.rs diff --git a/core-ast/src/common/identifier.rs b/ast/src/common/identifier.rs similarity index 100% rename from core-ast/src/common/identifier.rs rename to ast/src/common/identifier.rs diff --git a/core-ast/src/common/mod.rs b/ast/src/common/mod.rs similarity index 100% rename from core-ast/src/common/mod.rs rename to ast/src/common/mod.rs diff --git a/core-ast/src/common/range_or_expression.rs b/ast/src/common/range_or_expression.rs similarity index 100% rename from core-ast/src/common/range_or_expression.rs rename to ast/src/common/range_or_expression.rs diff --git a/core-ast/src/common/span.rs b/ast/src/common/span.rs similarity index 100% rename from core-ast/src/common/span.rs rename to ast/src/common/span.rs diff --git a/core-ast/src/common/spread_or_expression.rs b/ast/src/common/spread_or_expression.rs similarity index 100% rename from core-ast/src/common/spread_or_expression.rs rename to ast/src/common/spread_or_expression.rs diff --git a/core-ast/src/common/variable_name.rs b/ast/src/common/variable_name.rs similarity index 100% rename from core-ast/src/common/variable_name.rs rename to ast/src/common/variable_name.rs diff --git a/core-ast/src/common/variables.rs b/ast/src/common/variables.rs similarity index 100% rename from core-ast/src/common/variables.rs rename to ast/src/common/variables.rs diff --git a/core-ast/src/console/console_function.rs b/ast/src/console/console_function.rs similarity index 100% rename from core-ast/src/console/console_function.rs rename to ast/src/console/console_function.rs diff --git a/core-ast/src/console/console_function_call.rs b/ast/src/console/console_function_call.rs similarity index 100% rename from core-ast/src/console/console_function_call.rs rename to ast/src/console/console_function_call.rs diff --git a/core-ast/src/console/formatted_container.rs b/ast/src/console/formatted_container.rs similarity index 100% rename from core-ast/src/console/formatted_container.rs rename to ast/src/console/formatted_container.rs diff --git a/core-ast/src/console/formatted_parameter.rs b/ast/src/console/formatted_parameter.rs similarity index 100% rename from core-ast/src/console/formatted_parameter.rs rename to ast/src/console/formatted_parameter.rs diff --git a/core-ast/src/console/formatted_string.rs b/ast/src/console/formatted_string.rs similarity index 100% rename from core-ast/src/console/formatted_string.rs rename to ast/src/console/formatted_string.rs diff --git a/core-ast/src/console/mod.rs b/ast/src/console/mod.rs similarity index 100% rename from core-ast/src/console/mod.rs rename to ast/src/console/mod.rs diff --git a/core-ast/src/errors/error.rs b/ast/src/errors/error.rs similarity index 100% rename from core-ast/src/errors/error.rs rename to ast/src/errors/error.rs diff --git a/core-ast/src/errors/mod.rs b/ast/src/errors/mod.rs similarity index 100% rename from core-ast/src/errors/mod.rs rename to ast/src/errors/mod.rs diff --git a/core-ast/src/expression.rs b/ast/src/expression.rs similarity index 100% rename from core-ast/src/expression.rs rename to ast/src/expression.rs diff --git a/core-ast/src/functions/function.rs b/ast/src/functions/function.rs similarity index 100% rename from core-ast/src/functions/function.rs rename to ast/src/functions/function.rs diff --git a/core-ast/src/functions/input/function_input.rs b/ast/src/functions/input/function_input.rs similarity index 100% rename from core-ast/src/functions/input/function_input.rs rename to ast/src/functions/input/function_input.rs diff --git a/core-ast/src/functions/input/input_variable.rs b/ast/src/functions/input/input_variable.rs similarity index 100% rename from core-ast/src/functions/input/input_variable.rs rename to ast/src/functions/input/input_variable.rs diff --git a/core-ast/src/functions/input/mod.rs b/ast/src/functions/input/mod.rs similarity index 100% rename from core-ast/src/functions/input/mod.rs rename to ast/src/functions/input/mod.rs diff --git a/core-ast/src/functions/mod.rs b/ast/src/functions/mod.rs similarity index 100% rename from core-ast/src/functions/mod.rs rename to ast/src/functions/mod.rs diff --git a/core-ast/src/functions/test_function.rs b/ast/src/functions/test_function.rs similarity index 100% rename from core-ast/src/functions/test_function.rs rename to ast/src/functions/test_function.rs diff --git a/core-ast/src/groups/group_coordinate.rs b/ast/src/groups/group_coordinate.rs similarity index 100% rename from core-ast/src/groups/group_coordinate.rs rename to ast/src/groups/group_coordinate.rs diff --git a/core-ast/src/groups/group_value.rs b/ast/src/groups/group_value.rs similarity index 100% rename from core-ast/src/groups/group_value.rs rename to ast/src/groups/group_value.rs diff --git a/core-ast/src/groups/mod.rs b/ast/src/groups/mod.rs similarity index 100% rename from core-ast/src/groups/mod.rs rename to ast/src/groups/mod.rs diff --git a/core-ast/src/imports/import.rs b/ast/src/imports/import.rs similarity index 100% rename from core-ast/src/imports/import.rs rename to ast/src/imports/import.rs diff --git a/core-ast/src/imports/import_symbol.rs b/ast/src/imports/import_symbol.rs similarity index 100% rename from core-ast/src/imports/import_symbol.rs rename to ast/src/imports/import_symbol.rs diff --git a/core-ast/src/imports/mod.rs b/ast/src/imports/mod.rs similarity index 100% rename from core-ast/src/imports/mod.rs rename to ast/src/imports/mod.rs diff --git a/core-ast/src/imports/package.rs b/ast/src/imports/package.rs similarity index 100% rename from core-ast/src/imports/package.rs rename to ast/src/imports/package.rs diff --git a/core-ast/src/imports/package_access.rs b/ast/src/imports/package_access.rs similarity index 100% rename from core-ast/src/imports/package_access.rs rename to ast/src/imports/package_access.rs diff --git a/core-ast/src/input/input.rs b/ast/src/input/input.rs similarity index 100% rename from core-ast/src/input/input.rs rename to ast/src/input/input.rs diff --git a/core-ast/src/input/input_value.rs b/ast/src/input/input_value.rs similarity index 100% rename from core-ast/src/input/input_value.rs rename to ast/src/input/input_value.rs diff --git a/core-ast/src/input/macros.rs b/ast/src/input/macros.rs similarity index 100% rename from core-ast/src/input/macros.rs rename to ast/src/input/macros.rs diff --git a/core-ast/src/input/mod.rs b/ast/src/input/mod.rs similarity index 100% rename from core-ast/src/input/mod.rs rename to ast/src/input/mod.rs diff --git a/core-ast/src/input/parameters/mod.rs b/ast/src/input/parameters/mod.rs similarity index 100% rename from core-ast/src/input/parameters/mod.rs rename to ast/src/input/parameters/mod.rs diff --git a/core-ast/src/input/parameters/parameter.rs b/ast/src/input/parameters/parameter.rs similarity index 100% rename from core-ast/src/input/parameters/parameter.rs rename to ast/src/input/parameters/parameter.rs diff --git a/core-ast/src/input/program_input/main_input.rs b/ast/src/input/program_input/main_input.rs similarity index 100% rename from core-ast/src/input/program_input/main_input.rs rename to ast/src/input/program_input/main_input.rs diff --git a/core-ast/src/input/program_input/mod.rs b/ast/src/input/program_input/mod.rs similarity index 100% rename from core-ast/src/input/program_input/mod.rs rename to ast/src/input/program_input/mod.rs diff --git a/core-ast/src/input/program_input/program_input.rs b/ast/src/input/program_input/program_input.rs similarity index 100% rename from core-ast/src/input/program_input/program_input.rs rename to ast/src/input/program_input/program_input.rs diff --git a/core-ast/src/input/program_input/registers.rs b/ast/src/input/program_input/registers.rs similarity index 100% rename from core-ast/src/input/program_input/registers.rs rename to ast/src/input/program_input/registers.rs diff --git a/core-ast/src/input/program_state/mod.rs b/ast/src/input/program_state/mod.rs similarity index 100% rename from core-ast/src/input/program_state/mod.rs rename to ast/src/input/program_state/mod.rs diff --git a/core-ast/src/input/program_state/private_state/mod.rs b/ast/src/input/program_state/private_state/mod.rs similarity index 100% rename from core-ast/src/input/program_state/private_state/mod.rs rename to ast/src/input/program_state/private_state/mod.rs diff --git a/core-ast/src/input/program_state/private_state/private_state.rs b/ast/src/input/program_state/private_state/private_state.rs similarity index 100% rename from core-ast/src/input/program_state/private_state/private_state.rs rename to ast/src/input/program_state/private_state/private_state.rs diff --git a/core-ast/src/input/program_state/private_state/record.rs b/ast/src/input/program_state/private_state/record.rs similarity index 100% rename from core-ast/src/input/program_state/private_state/record.rs rename to ast/src/input/program_state/private_state/record.rs diff --git a/core-ast/src/input/program_state/private_state/state_leaf.rs b/ast/src/input/program_state/private_state/state_leaf.rs similarity index 100% rename from core-ast/src/input/program_state/private_state/state_leaf.rs rename to ast/src/input/program_state/private_state/state_leaf.rs diff --git a/core-ast/src/input/program_state/program_state.rs b/ast/src/input/program_state/program_state.rs similarity index 100% rename from core-ast/src/input/program_state/program_state.rs rename to ast/src/input/program_state/program_state.rs diff --git a/core-ast/src/input/program_state/public_state/mod.rs b/ast/src/input/program_state/public_state/mod.rs similarity index 100% rename from core-ast/src/input/program_state/public_state/mod.rs rename to ast/src/input/program_state/public_state/mod.rs diff --git a/core-ast/src/input/program_state/public_state/public_state.rs b/ast/src/input/program_state/public_state/public_state.rs similarity index 100% rename from core-ast/src/input/program_state/public_state/public_state.rs rename to ast/src/input/program_state/public_state/public_state.rs diff --git a/core-ast/src/input/program_state/public_state/state.rs b/ast/src/input/program_state/public_state/state.rs similarity index 100% rename from core-ast/src/input/program_state/public_state/state.rs rename to ast/src/input/program_state/public_state/state.rs diff --git a/core-ast/src/lib.rs b/ast/src/lib.rs similarity index 77% rename from core-ast/src/lib.rs rename to ast/src/lib.rs index 59f42f94ef..4325698987 100644 --- a/core-ast/src/lib.rs +++ b/ast/src/lib.rs @@ -16,9 +16,9 @@ //! The core abstract syntax tree (ast) for a Leo program. //! -//! This module contains the [`LeoCoreAst`] type, a wrapper around the [`Program`] type. -//! The [`LeoCoreAst`] type is intended to be parsed and modified by different passes -//! of the Leo compiler. The Leo compiler can generate a set of R1CS constraints from any [`LeoCoreAst`]. +//! This module contains the [`LeoAst`] type, a wrapper around the [`Program`] type. +//! The [`LeoAst`] type is intended to be parsed and modified by different passes +//! of the Leo compiler. The Leo compiler can generate a set of R1CS constraints from any [`LeoAst`]. pub mod annotation; pub use self::annotation::*; @@ -63,36 +63,36 @@ use leo_grammar::Grammar; /// The core abstract syntax tree (ast) for a Leo program. /// -/// The [`LeoCoreAst`] type represents a Leo program as a series of recursive data types. +/// The [`LeoAst`] type represents a Leo program as a series of recursive data types. /// These data types form a tree that begins from a [`Program`] type root. /// -/// A new [`LeoCoreAst`] can be created from a [`LeoAst`] generated by the pest parser in the `ast` module. +/// A new [`LeoAst`] can be created from a [`Grammar`] generated by the pest parser in the `ast` module. #[derive(Debug, Eq, PartialEq)] -pub struct LeoCoreAst { - core_ast: Program, +pub struct LeoAst { + ast: Program, } -impl LeoCoreAst { +impl LeoAst { /// Creates a new core syntax tree from a given program name and abstract syntax tree. pub fn new<'ast>(program_name: &str, ast: &Grammar<'ast>) -> Self { Self { - core_ast: Program::from(program_name, ast.as_repr()), + ast: Program::from(program_name, ast.as_repr()), } } /// Returns a reference to the inner program syntax tree representation. pub fn into_repr(self) -> Program { - self.core_ast + self.ast } /// Serializes the core syntax tree into a JSON string. pub fn to_json_string(&self) -> Result { - Ok(serde_json::to_string_pretty(&self.core_ast)?) + Ok(serde_json::to_string_pretty(&self.ast)?) } /// Deserializes the JSON string into a core syntax tree. pub fn from_json_string(json: &str) -> Result { let typed_ast: Program = serde_json::from_str(json)?; - Ok(Self { core_ast: typed_ast }) + Ok(Self { ast: typed_ast }) } } diff --git a/core-ast/src/main.rs b/ast/src/main.rs similarity index 89% rename from core-ast/src/main.rs rename to ast/src/main.rs index 1020575d33..c231cc677b 100644 --- a/core-ast/src/main.rs +++ b/ast/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::LeoCoreAst; +use leo_ast::LeoAst; use leo_grammar::{Grammar, ParserError}; use std::{env, fs, path::Path}; @@ -27,10 +27,10 @@ fn to_leo_core_tree(filepath: &Path) -> Result { let ast = Grammar::new(&program_filepath, &program_string)?; // Parse the pest ast and constructs a core ast. - let core_ast = LeoCoreAst::new("leo_core_tree", &ast); + let core_ast = LeoAst::new("leo_core_tree", &ast); // Serializes the core tree into JSON format. - let serialized_core_ast = LeoCoreAst::to_json_string(&core_ast)?; + let serialized_core_ast = LeoAst::to_json_string(&core_ast)?; Ok(serialized_core_ast) } @@ -43,7 +43,7 @@ fn main() -> Result<(), ParserError> { if cli_arguments.len() < 2 || cli_arguments.len() > 3 { eprintln!("Warning - an invalid number of command-line arguments were provided."); println!( - "\nCommand-line usage:\n\n\tleo_core_ast {{PATH/TO/INPUT_FILENAME}}.leo {{PATH/TO/OUTPUT_DIRECTORY (optional)}}\n" + "\nCommand-line usage:\n\n\tleo_ast {{PATH/TO/INPUT_FILENAME}}.leo {{PATH/TO/OUTPUT_DIRECTORY (optional)}}\n" ); return Ok(()); // Exit innocently } diff --git a/core-ast/src/program.rs b/ast/src/program.rs similarity index 100% rename from core-ast/src/program.rs rename to ast/src/program.rs diff --git a/core-ast/src/statements/conditional_nested_or_end_statement.rs b/ast/src/statements/conditional_nested_or_end_statement.rs similarity index 100% rename from core-ast/src/statements/conditional_nested_or_end_statement.rs rename to ast/src/statements/conditional_nested_or_end_statement.rs diff --git a/core-ast/src/statements/conditional_statement.rs b/ast/src/statements/conditional_statement.rs similarity index 100% rename from core-ast/src/statements/conditional_statement.rs rename to ast/src/statements/conditional_statement.rs diff --git a/core-ast/src/statements/mod.rs b/ast/src/statements/mod.rs similarity index 100% rename from core-ast/src/statements/mod.rs rename to ast/src/statements/mod.rs diff --git a/core-ast/src/statements/statement.rs b/ast/src/statements/statement.rs similarity index 100% rename from core-ast/src/statements/statement.rs rename to ast/src/statements/statement.rs diff --git a/core-ast/src/types/integer_type.rs b/ast/src/types/integer_type.rs similarity index 100% rename from core-ast/src/types/integer_type.rs rename to ast/src/types/integer_type.rs diff --git a/core-ast/src/types/mod.rs b/ast/src/types/mod.rs similarity index 100% rename from core-ast/src/types/mod.rs rename to ast/src/types/mod.rs diff --git a/core-ast/src/types/type_.rs b/ast/src/types/type_.rs similarity index 100% rename from core-ast/src/types/type_.rs rename to ast/src/types/type_.rs diff --git a/core-ast/tests/mod.rs b/ast/tests/mod.rs similarity index 100% rename from core-ast/tests/mod.rs rename to ast/tests/mod.rs diff --git a/core-ast/tests/serialization/expected_core_ast.json b/ast/tests/serialization/expected_core_ast.json similarity index 100% rename from core-ast/tests/serialization/expected_core_ast.json rename to ast/tests/serialization/expected_core_ast.json diff --git a/core-ast/tests/serialization/json.rs b/ast/tests/serialization/json.rs similarity index 88% rename from core-ast/tests/serialization/json.rs rename to ast/tests/serialization/json.rs index c18ade9a05..8e9c2edf09 100644 --- a/core-ast/tests/serialization/json.rs +++ b/ast/tests/serialization/json.rs @@ -14,14 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::LeoCoreAst; +use leo_ast::LeoAst; #[cfg(not(feature = "ci_skip"))] -use leo_core_ast::Program; +use leo_ast::Program; use leo_grammar::Grammar; use std::path::{Path, PathBuf}; -fn to_core_ast(program_filepath: &Path) -> LeoCoreAst { +fn to_core_ast(program_filepath: &Path) -> LeoAst { // Loads the Leo code as a string from the given file path. let program_string = Grammar::load_file(program_filepath).unwrap(); @@ -29,7 +29,7 @@ fn to_core_ast(program_filepath: &Path) -> LeoCoreAst { let ast = Grammar::new(&program_filepath, &program_string).unwrap(); // Parses the pest ast and constructs a core ast. - LeoCoreAst::new("leo_core_tree", &ast) + LeoAst::new("leo_core_tree", &ast) } #[test] @@ -66,7 +66,7 @@ fn test_deserialize() { // Construct a core ast by deserializing a core ast JSON file. let serialized_typed_ast = include_str!("expected_core_ast.json"); - let core_ast = LeoCoreAst::from_json_string(serialized_typed_ast).unwrap(); + let core_ast = LeoAst::from_json_string(serialized_typed_ast).unwrap(); assert_eq!(expected_core_ast, core_ast); } @@ -84,8 +84,8 @@ fn test_serialize_deserialize_serialize() { // Serializes the core ast into JSON format. let serialized_core_ast = core_ast.to_json_string().unwrap(); - // Deserializes the serialized core ast into a LeoCoreAst. - let core_ast = LeoCoreAst::from_json_string(&serialized_core_ast).unwrap(); + // Deserializes the serialized core ast into a LeoAst. + let core_ast = LeoAst::from_json_string(&serialized_core_ast).unwrap(); // Reserializes the core ast into JSON format. let reserialized_core_ast = core_ast.to_json_string().unwrap(); diff --git a/core-ast/tests/serialization/main.leo b/ast/tests/serialization/main.leo similarity index 100% rename from core-ast/tests/serialization/main.leo rename to ast/tests/serialization/main.leo diff --git a/core-ast/tests/serialization/mod.rs b/ast/tests/serialization/mod.rs similarity index 100% rename from core-ast/tests/serialization/mod.rs rename to ast/tests/serialization/mod.rs diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index e48679a3d4..3414ca840c 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -17,8 +17,8 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "GPL-3.0" edition = "2018" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.leo-core-packages] @@ -124,4 +124,4 @@ default-features = false [features] default = [ ] -ci_skip = [ "leo-grammar/ci_skip", "leo-core-ast/ci_skip" ] +ci_skip = [ "leo-grammar/ci_skip", "leo-ast/ci_skip" ] diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index ffe6e98af8..61a36acfa2 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -23,7 +23,7 @@ use crate::{ OutputBytes, OutputFile, }; -use leo_core_ast::{Input, LeoCoreAst, MainInput, Program}; +use leo_ast::{Input, LeoAst, MainInput, Program}; use leo_grammar::Grammar; use leo_imports::ImportParser; use leo_input::LeoInputParser; @@ -184,7 +184,7 @@ impl> Compiler { })?; // Construct the core ast from the pest ast. - let core_ast = LeoCoreAst::new(&self.package_name, &pest_ast); + let core_ast = LeoAst::new(&self.package_name, &pest_ast); // Store the main program file. self.program = core_ast.into_repr(); @@ -244,7 +244,7 @@ impl> Compiler { let package_name = &self.package_name; // Construct the core ast from the pest ast. - let core_ast = LeoCoreAst::new(package_name, &ast); + let core_ast = LeoAst::new(package_name, &ast); // Store the main program file. self.program = core_ast.into_repr(); diff --git a/compiler/src/console/assert.rs b/compiler/src/console/assert.rs index 9845e51fd4..66465bd11f 100644 --- a/compiler/src/console/assert.rs +++ b/compiler/src/console/assert.rs @@ -17,7 +17,7 @@ //! Enforces an assert equals statement in a compiled Leo program. use crate::{errors::ConsoleError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/console/console.rs b/compiler/src/console/console.rs index 43023a1294..1be1d801cb 100644 --- a/compiler/src/console/console.rs +++ b/compiler/src/console/console.rs @@ -17,7 +17,7 @@ //! Evaluates a macro in a compiled Leo program. use crate::{errors::ConsoleError, program::ConstrainedProgram, GroupType}; -use leo_core_ast::{ConsoleFunction, ConsoleFunctionCall}; +use leo_ast::{ConsoleFunction, ConsoleFunctionCall}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/console/format.rs b/compiler/src/console/format.rs index 0545539607..05cabbdc15 100644 --- a/compiler/src/console/format.rs +++ b/compiler/src/console/format.rs @@ -17,7 +17,7 @@ //! Evaluates a formatted string in a compiled Leo program. use crate::{errors::ConsoleError, program::ConstrainedProgram, GroupType}; -use leo_core_ast::FormattedString; +use leo_ast::FormattedString; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/constraints/constraints.rs b/compiler/src/constraints/constraints.rs index a96339e4f9..d8b067c9bd 100644 --- a/compiler/src/constraints/constraints.rs +++ b/compiler/src/constraints/constraints.rs @@ -25,7 +25,7 @@ use crate::{ OutputBytes, OutputFile, }; -use leo_core_ast::{Input, Program}; +use leo_ast::{Input, Program}; use leo_imports::ImportParser; use leo_input::LeoInputParser; use leo_package::inputs::InputPairs; diff --git a/compiler/src/definition/definition.rs b/compiler/src/definition/definition.rs index 4ed4cbbd6f..b684eadb75 100644 --- a/compiler/src/definition/definition.rs +++ b/compiler/src/definition/definition.rs @@ -21,7 +21,7 @@ use crate::{ value::ConstrainedValue, GroupType, }; -use leo_core_ast::Identifier; +use leo_ast::Identifier; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/definition/definitions.rs b/compiler/src/definition/definitions.rs index d15ecd07c2..46bfa7ea07 100644 --- a/compiler/src/definition/definitions.rs +++ b/compiler/src/definition/definitions.rs @@ -22,7 +22,7 @@ use crate::{ value::ConstrainedValue, GroupType, }; -use leo_core_ast::Program; +use leo_ast::Program; use leo_imports::ImportParser; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/errors/console.rs b/compiler/src/errors/console.rs index 2d0b636c28..7366bf806f 100644 --- a/compiler/src/errors/console.rs +++ b/compiler/src/errors/console.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::ExpressionError; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/compiler/src/errors/expression.rs b/compiler/src/errors/expression.rs index 91a162b163..f2e2e8c97b 100644 --- a/compiler/src/errors/expression.rs +++ b/compiler/src/errors/expression.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::{AddressError, BooleanError, FieldError, FunctionError, GroupError, IntegerError, ValueError}; -use leo_core_ast::{Error as FormattedError, Identifier, Span}; +use leo_ast::{Error as FormattedError, Identifier, Span}; use leo_core_packages::LeoCorePackageError; use snarkos_errors::gadgets::SynthesisError; diff --git a/compiler/src/errors/function.rs b/compiler/src/errors/function.rs index 87919fe0ca..8f22e1fb87 100644 --- a/compiler/src/errors/function.rs +++ b/compiler/src/errors/function.rs @@ -25,7 +25,7 @@ use crate::errors::{ StatementError, ValueError, }; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/compiler/src/errors/import.rs b/compiler/src/errors/import.rs index 6bb9407c9d..241154f83b 100644 --- a/compiler/src/errors/import.rs +++ b/compiler/src/errors/import.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Identifier, ImportSymbol, Span}; +use leo_ast::{Error as FormattedError, Identifier, ImportSymbol, Span}; use leo_core_packages::LeoCorePackageError; #[derive(Debug, Error)] diff --git a/compiler/src/errors/output_bytes.rs b/compiler/src/errors/output_bytes.rs index 5cf212572e..d07af02bfa 100644 --- a/compiler/src/errors/output_bytes.rs +++ b/compiler/src/errors/output_bytes.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/compiler/src/errors/statement.rs b/compiler/src/errors/statement.rs index adc04cfc06..a70770ca53 100644 --- a/compiler/src/errors/statement.rs +++ b/compiler/src/errors/statement.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::{AddressError, BooleanError, ConsoleError, ExpressionError, IntegerError, ValueError}; -use leo_core_ast::{Error as FormattedError, Span, Type}; +use leo_ast::{Error as FormattedError, Span, Type}; use std::path::Path; diff --git a/compiler/src/errors/value/address.rs b/compiler/src/errors/value/address.rs index 1d308d90b1..c48ae4a993 100644 --- a/compiler/src/errors/value/address.rs +++ b/compiler/src/errors/value/address.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use snarkos_errors::{gadgets::SynthesisError, objects::account::AccountError}; use std::path::Path; diff --git a/compiler/src/errors/value/boolean.rs b/compiler/src/errors/value/boolean.rs index 897e461a35..1160f38d7a 100644 --- a/compiler/src/errors/value/boolean.rs +++ b/compiler/src/errors/value/boolean.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use snarkos_errors::gadgets::SynthesisError; use std::path::Path; diff --git a/compiler/src/errors/value/field.rs b/compiler/src/errors/value/field.rs index 452335bedb..5dda86a677 100644 --- a/compiler/src/errors/value/field.rs +++ b/compiler/src/errors/value/field.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use snarkos_errors::gadgets::SynthesisError; use std::path::Path; diff --git a/compiler/src/errors/value/group.rs b/compiler/src/errors/value/group.rs index 3e7b148654..d03c6b502f 100644 --- a/compiler/src/errors/value/group.rs +++ b/compiler/src/errors/value/group.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use snarkos_errors::gadgets::SynthesisError; use std::path::Path; diff --git a/compiler/src/errors/value/integer.rs b/compiler/src/errors/value/integer.rs index 4672635cd1..23d9d847d9 100644 --- a/compiler/src/errors/value/integer.rs +++ b/compiler/src/errors/value/integer.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{error::Error as FormattedError, Span}; +use leo_ast::{error::Error as FormattedError, Span}; use leo_gadgets::errors::SignedIntegerError; use snarkos_errors::gadgets::SynthesisError; diff --git a/compiler/src/errors/value/value.rs b/compiler/src/errors/value/value.rs index fa469919c5..41c4c50e0c 100644 --- a/compiler/src/errors/value/value.rs +++ b/compiler/src/errors/value/value.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::{AddressError, BooleanError, FieldError, GroupError, IntegerError}; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/compiler/src/expression/arithmetic/add.rs b/compiler/src/expression/arithmetic/add.rs index a52e33756a..504a4c99af 100644 --- a/compiler/src/expression/arithmetic/add.rs +++ b/compiler/src/expression/arithmetic/add.rs @@ -17,7 +17,7 @@ //! Enforces an arithmetic `+` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/arithmetic/div.rs b/compiler/src/expression/arithmetic/div.rs index 1564b16305..6120e1ecf3 100644 --- a/compiler/src/expression/arithmetic/div.rs +++ b/compiler/src/expression/arithmetic/div.rs @@ -17,7 +17,7 @@ //! Enforces an arithmetic `/` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/arithmetic/mul.rs b/compiler/src/expression/arithmetic/mul.rs index cf3f0bb833..71eea3a663 100644 --- a/compiler/src/expression/arithmetic/mul.rs +++ b/compiler/src/expression/arithmetic/mul.rs @@ -17,7 +17,7 @@ //! Enforces an arithmetic `*` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/arithmetic/negate.rs b/compiler/src/expression/arithmetic/negate.rs index a3318532bd..43c3483713 100644 --- a/compiler/src/expression/arithmetic/negate.rs +++ b/compiler/src/expression/arithmetic/negate.rs @@ -17,7 +17,7 @@ //! Enforces a unary negate `-` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/arithmetic/pow.rs b/compiler/src/expression/arithmetic/pow.rs index 3607d4756c..403e5f97d2 100644 --- a/compiler/src/expression/arithmetic/pow.rs +++ b/compiler/src/expression/arithmetic/pow.rs @@ -17,7 +17,7 @@ //! Enforces an arithmetic `**` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/arithmetic/sub.rs b/compiler/src/expression/arithmetic/sub.rs index 20502ca597..a21aea905b 100644 --- a/compiler/src/expression/arithmetic/sub.rs +++ b/compiler/src/expression/arithmetic/sub.rs @@ -17,7 +17,7 @@ //! Enforces an arithmetic `-` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/array/access.rs b/compiler/src/expression/array/access.rs index c7f7fa827a..71ecf71487 100644 --- a/compiler/src/expression/array/access.rs +++ b/compiler/src/expression/array/access.rs @@ -17,7 +17,7 @@ //! Enforces array access in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, RangeOrExpression, Span, Type}; +use leo_ast::{Expression, RangeOrExpression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/array/array.rs b/compiler/src/expression/array/array.rs index d5e6f762d8..7a0494fb9d 100644 --- a/compiler/src/expression/array/array.rs +++ b/compiler/src/expression/array/array.rs @@ -22,7 +22,7 @@ use crate::{ value::ConstrainedValue, GroupType, }; -use leo_core_ast::{Expression, Span, SpreadOrExpression, Type}; +use leo_ast::{Expression, Span, SpreadOrExpression, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/array/index.rs b/compiler/src/expression/array/index.rs index 54b62f169e..52d2e863c8 100644 --- a/compiler/src/expression/array/index.rs +++ b/compiler/src/expression/array/index.rs @@ -17,7 +17,7 @@ //! Enforces an array index expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, IntegerType, Span, Type}; +use leo_ast::{Expression, IntegerType, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/binary/binary.rs b/compiler/src/expression/binary/binary.rs index ee580bfbe8..fade74bb0b 100644 --- a/compiler/src/expression/binary/binary.rs +++ b/compiler/src/expression/binary/binary.rs @@ -17,7 +17,7 @@ //! Enforces a binary expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/binary/operand.rs b/compiler/src/expression/binary/operand.rs index d15156c73a..e9853b8adf 100644 --- a/compiler/src/expression/binary/operand.rs +++ b/compiler/src/expression/binary/operand.rs @@ -17,7 +17,7 @@ //! Enforces one operand in a binary expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/circuit/access.rs b/compiler/src/expression/circuit/access.rs index 53d57c51b4..0d3864c295 100644 --- a/compiler/src/expression/circuit/access.rs +++ b/compiler/src/expression/circuit/access.rs @@ -22,7 +22,7 @@ use crate::{ value::ConstrainedValue, GroupType, }; -use leo_core_ast::{Expression, Identifier, Span, Type}; +use leo_ast::{Expression, Identifier, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/circuit/circuit.rs b/compiler/src/expression/circuit/circuit.rs index b1e7b8d421..e78cd00e91 100644 --- a/compiler/src/expression/circuit/circuit.rs +++ b/compiler/src/expression/circuit/circuit.rs @@ -22,7 +22,7 @@ use crate::{ value::{ConstrainedCircuitMember, ConstrainedValue}, GroupType, }; -use leo_core_ast::{CircuitMember, CircuitVariableDefinition, Identifier, Span}; +use leo_ast::{CircuitMember, CircuitVariableDefinition, Identifier, Span}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/circuit/static_access.rs b/compiler/src/expression/circuit/static_access.rs index 7bf3d67df4..31ed5bb865 100644 --- a/compiler/src/expression/circuit/static_access.rs +++ b/compiler/src/expression/circuit/static_access.rs @@ -17,7 +17,7 @@ //! Enforces a circuit static access expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{CircuitMember, Expression, Identifier, Span, Type}; +use leo_ast::{CircuitMember, Expression, Identifier, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/conditional/conditional.rs b/compiler/src/expression/conditional/conditional.rs index c332b791ba..a0b8e5a090 100644 --- a/compiler/src/expression/conditional/conditional.rs +++ b/compiler/src/expression/conditional/conditional.rs @@ -17,7 +17,7 @@ //! Enforces a conditional expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/expression.rs b/compiler/src/expression/expression.rs index e5b90b0641..859175f8af 100644 --- a/compiler/src/expression/expression.rs +++ b/compiler/src/expression/expression.rs @@ -28,7 +28,7 @@ use crate::{ GroupType, Integer, }; -use leo_core_ast::{Expression, Type}; +use leo_ast::{Expression, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/function/core_circuit.rs b/compiler/src/expression/function/core_circuit.rs index 8a43ae8bac..e62ece9234 100644 --- a/compiler/src/expression/function/core_circuit.rs +++ b/compiler/src/expression/function/core_circuit.rs @@ -16,7 +16,7 @@ use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use crate::errors::{ExpressionError, FunctionError}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use leo_core_packages::call_core_circuit; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/function/function.rs b/compiler/src/expression/function/function.rs index 35b324218b..a7fba95c49 100644 --- a/compiler/src/expression/function/function.rs +++ b/compiler/src/expression/function/function.rs @@ -17,7 +17,7 @@ //! Enforce a function call expression in a compiled Leo program. use crate::{errors::ExpressionError, new_scope, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/identifier/identifier.rs b/compiler/src/expression/identifier/identifier.rs index 9dde05d491..58abdddb30 100644 --- a/compiler/src/expression/identifier/identifier.rs +++ b/compiler/src/expression/identifier/identifier.rs @@ -23,7 +23,7 @@ use crate::{ Address, GroupType, }; -use leo_core_ast::{Identifier, Type}; +use leo_ast::{Identifier, Type}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/expression/logical/and.rs b/compiler/src/expression/logical/and.rs index cef99fcf7c..b58cdb614f 100644 --- a/compiler/src/expression/logical/and.rs +++ b/compiler/src/expression/logical/and.rs @@ -17,7 +17,7 @@ //! Enforces a logical `&&` operator in a resolved Leo program. use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/logical/not.rs b/compiler/src/expression/logical/not.rs index cdf84c051a..f40089f982 100644 --- a/compiler/src/expression/logical/not.rs +++ b/compiler/src/expression/logical/not.rs @@ -17,7 +17,7 @@ //! Enforces a logical `!` operator in a resolved Leo program. use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/expression/logical/or.rs b/compiler/src/expression/logical/or.rs index 1f86254f48..0915d3e77b 100644 --- a/compiler/src/expression/logical/or.rs +++ b/compiler/src/expression/logical/or.rs @@ -17,7 +17,7 @@ //! Enforces a logical `||` operator in a resolved Leo program. use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/relational/eq.rs b/compiler/src/expression/relational/eq.rs index 114a66c65e..75f8de4ae9 100644 --- a/compiler/src/expression/relational/eq.rs +++ b/compiler/src/expression/relational/eq.rs @@ -17,7 +17,7 @@ //! Enforces a relational `==` operator in a resolved Leo program. use crate::{enforce_and, errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/relational/ge.rs b/compiler/src/expression/relational/ge.rs index fdd4ed723c..c7ebb817d7 100644 --- a/compiler/src/expression/relational/ge.rs +++ b/compiler/src/expression/relational/ge.rs @@ -17,7 +17,7 @@ //! Enforces a relational `>=` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_gadgets::bits::ComparatorGadget; use snarkos_models::{ diff --git a/compiler/src/expression/relational/gt.rs b/compiler/src/expression/relational/gt.rs index 3939d624c2..e7d1283b11 100644 --- a/compiler/src/expression/relational/gt.rs +++ b/compiler/src/expression/relational/gt.rs @@ -17,7 +17,7 @@ //! Enforces a relational `>` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_gadgets::bits::ComparatorGadget; use snarkos_models::{ diff --git a/compiler/src/expression/relational/le.rs b/compiler/src/expression/relational/le.rs index 4849f3d829..d5794ca9bd 100644 --- a/compiler/src/expression/relational/le.rs +++ b/compiler/src/expression/relational/le.rs @@ -17,7 +17,7 @@ //! Enforces a relational `<=` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_gadgets::bits::ComparatorGadget; use snarkos_models::{ diff --git a/compiler/src/expression/relational/lt.rs b/compiler/src/expression/relational/lt.rs index b78d40d638..17af89b832 100644 --- a/compiler/src/expression/relational/lt.rs +++ b/compiler/src/expression/relational/lt.rs @@ -17,7 +17,7 @@ //! Enforces a relational `<` operator in a resolved Leo program. use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_gadgets::bits::comparator::EvaluateLtGadget; use snarkos_models::{ diff --git a/compiler/src/expression/tuple/access.rs b/compiler/src/expression/tuple/access.rs index 6d736047ea..33cc551c98 100644 --- a/compiler/src/expression/tuple/access.rs +++ b/compiler/src/expression/tuple/access.rs @@ -17,7 +17,7 @@ //! Enforces array access in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/expression/tuple/tuple.rs b/compiler/src/expression/tuple/tuple.rs index 70f9b00dc7..b002908a46 100644 --- a/compiler/src/expression/tuple/tuple.rs +++ b/compiler/src/expression/tuple/tuple.rs @@ -17,7 +17,7 @@ //! Enforces an tuple expression in a compiled Leo program. use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/function.rs b/compiler/src/function/function.rs index 13be254322..ab944103f0 100644 --- a/compiler/src/function/function.rs +++ b/compiler/src/function/function.rs @@ -23,7 +23,7 @@ use crate::{ GroupType, }; -use leo_core_ast::{Expression, Function, FunctionInput, Span, Type}; +use leo_ast::{Expression, Function, FunctionInput, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/input/array.rs b/compiler/src/function/input/array.rs index 881bea90c7..8c3cf3a9e7 100644 --- a/compiler/src/function/input/array.rs +++ b/compiler/src/function/input/array.rs @@ -23,7 +23,7 @@ use crate::{ GroupType, }; -use leo_core_ast::{InputValue, Span, Type}; +use leo_ast::{InputValue, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/input/function_input.rs b/compiler/src/function/input/function_input.rs index 1b4e08f7b8..77624fbfc6 100644 --- a/compiler/src/function/input/function_input.rs +++ b/compiler/src/function/input/function_input.rs @@ -18,7 +18,7 @@ use crate::{errors::FunctionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Type}; +use leo_ast::{Expression, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/input/input_keyword.rs b/compiler/src/function/input/input_keyword.rs index f657ca854f..5d74e55f70 100644 --- a/compiler/src/function/input/input_keyword.rs +++ b/compiler/src/function/input/input_keyword.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::FunctionError, ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_core_ast::{Identifier, Input}; +use leo_ast::{Identifier, Input}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/input/input_section.rs b/compiler/src/function/input/input_section.rs index 2f104e682b..88b3e77da6 100644 --- a/compiler/src/function/input/input_section.rs +++ b/compiler/src/function/input/input_section.rs @@ -16,7 +16,7 @@ use crate::{errors::FunctionError, ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_core_ast::{Identifier, InputValue, Parameter}; +use leo_ast::{Identifier, InputValue, Parameter}; use snarkos_models::{ curves::{Field, PrimeField}, gadgets::r1cs::ConstraintSystem, diff --git a/compiler/src/function/input/main_function_input.rs b/compiler/src/function/input/main_function_input.rs index 9fe4675810..7bed5fc273 100644 --- a/compiler/src/function/input/main_function_input.rs +++ b/compiler/src/function/input/main_function_input.rs @@ -30,7 +30,7 @@ use crate::{ Integer, }; -use leo_core_ast::{InputValue, Span, Type}; +use leo_ast::{InputValue, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/input/tuple.rs b/compiler/src/function/input/tuple.rs index ab273b6746..8ad74507d0 100644 --- a/compiler/src/function/input/tuple.rs +++ b/compiler/src/function/input/tuple.rs @@ -23,7 +23,7 @@ use crate::{ GroupType, }; -use leo_core_ast::{InputValue, Span, Type}; +use leo_ast::{InputValue, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/main_function.rs b/compiler/src/function/main_function.rs index c6a89cd85f..7604a80b28 100644 --- a/compiler/src/function/main_function.rs +++ b/compiler/src/function/main_function.rs @@ -23,7 +23,7 @@ use crate::{ OutputBytes, }; -use leo_core_ast::{Expression, Function, FunctionInput, Input}; +use leo_ast::{Expression, Function, FunctionInput, Input}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/function/result/result.rs b/compiler/src/function/result/result.rs index 04dc3f243a..cec2a05810 100644 --- a/compiler/src/function/result/result.rs +++ b/compiler/src/function/result/result.rs @@ -18,7 +18,7 @@ use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/import/parser/import_parser.rs b/compiler/src/import/parser/import_parser.rs index b9ad13a87f..9e440436ad 100644 --- a/compiler/src/import/parser/import_parser.rs +++ b/compiler/src/import/parser/import_parser.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::ImportError; -use leo_core_ast::{Package, Program}; +use leo_ast::{Package, Program}; use std::{collections::HashMap, env::current_dir}; diff --git a/compiler/src/import/store/core_package.rs b/compiler/src/import/store/core_package.rs index 92741ffe85..99742bbcbd 100644 --- a/compiler/src/import/store/core_package.rs +++ b/compiler/src/import/store/core_package.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{new_scope, ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_core_ast::Package; +use leo_ast::Package; use leo_core_packages::{CorePackageList, LeoCorePackageError}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/import/store/import.rs b/compiler/src/import/store/import.rs index 9d0501af33..9453d2ef02 100644 --- a/compiler/src/import/store/import.rs +++ b/compiler/src/import/store/import.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::ImportError, ConstrainedProgram, GroupType}; -use leo_core_ast::ImportStatement; +use leo_ast::ImportStatement; use leo_imports::ImportParser; use leo_symbol_table::imported_symbols::ImportedSymbols; diff --git a/compiler/src/import/store/symbol.rs b/compiler/src/import/store/symbol.rs index ad63689c3c..e5ef574060 100644 --- a/compiler/src/import/store/symbol.rs +++ b/compiler/src/import/store/symbol.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::ImportError, new_scope, ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_core_ast::{ImportSymbol, Program}; +use leo_ast::{ImportSymbol, Program}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/output/output_bytes.rs b/compiler/src/output/output_bytes.rs index 4e8fab7e68..8a797dae73 100644 --- a/compiler/src/output/output_bytes.rs +++ b/compiler/src/output/output_bytes.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::OutputBytesError, ConstrainedValue, GroupType, REGISTERS_VARIABLE_NAME}; -use leo_core_ast::{Parameter, Registers, Span}; +use leo_ast::{Parameter, Registers, Span}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/statement/assign/array.rs b/compiler/src/statement/assign/array.rs index 222913893d..842cdefbfe 100644 --- a/compiler/src/statement/assign/array.rs +++ b/compiler/src/statement/assign/array.rs @@ -17,7 +17,7 @@ //! Enforces an array assignment statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{RangeOrExpression, Span}; +use leo_ast::{RangeOrExpression, Span}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/assign/assign.rs b/compiler/src/statement/assign/assign.rs index f757fefab3..2dad3ea1f8 100644 --- a/compiler/src/statement/assign/assign.rs +++ b/compiler/src/statement/assign/assign.rs @@ -24,7 +24,7 @@ use crate::{ value::ConstrainedValue, GroupType, }; -use leo_core_ast::{Assignee, AssigneeAccess, Expression, Span}; +use leo_ast::{Assignee, AssigneeAccess, Expression, Span}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/assign/assignee.rs b/compiler/src/statement/assign/assignee.rs index 217a055892..3a0fe2641c 100644 --- a/compiler/src/statement/assign/assignee.rs +++ b/compiler/src/statement/assign/assignee.rs @@ -17,7 +17,7 @@ //! Resolves assignees in a compiled Leo program. use crate::{errors::StatementError, new_scope, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Assignee, Span}; +use leo_ast::{Assignee, Span}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/statement/assign/circuit_variable.rs b/compiler/src/statement/assign/circuit_variable.rs index 1362849875..146c95f983 100644 --- a/compiler/src/statement/assign/circuit_variable.rs +++ b/compiler/src/statement/assign/circuit_variable.rs @@ -17,7 +17,7 @@ //! Enforces a circuit variable assignment statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Identifier, Span}; +use leo_ast::{Identifier, Span}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/assign/tuple.rs b/compiler/src/statement/assign/tuple.rs index 307aef4d87..6fb7885255 100644 --- a/compiler/src/statement/assign/tuple.rs +++ b/compiler/src/statement/assign/tuple.rs @@ -17,7 +17,7 @@ //! Enforces a tuple assignment statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/branch/branch.rs b/compiler/src/statement/branch/branch.rs index 96edc1aec9..9d0d208036 100644 --- a/compiler/src/statement/branch/branch.rs +++ b/compiler/src/statement/branch/branch.rs @@ -17,7 +17,7 @@ //! Enforces a branch of a conditional or iteration statement in a compiled Leo program. use crate::{program::ConstrainedProgram, GroupType, IndicatorAndConstrainedValue, StatementResult}; -use leo_core_ast::{Statement, Type}; +use leo_ast::{Statement, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/conditional/conditional.rs b/compiler/src/statement/conditional/conditional.rs index ccc86141f9..48bad283b8 100644 --- a/compiler/src/statement/conditional/conditional.rs +++ b/compiler/src/statement/conditional/conditional.rs @@ -24,7 +24,7 @@ use crate::{ IndicatorAndConstrainedValue, StatementResult, }; -use leo_core_ast::{ConditionalNestedOrEndStatement, ConditionalStatement, Span, Type}; +use leo_ast::{ConditionalNestedOrEndStatement, ConditionalStatement, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/definition/definition.rs b/compiler/src/statement/definition/definition.rs index 4de710251c..aae6d4f79a 100644 --- a/compiler/src/statement/definition/definition.rs +++ b/compiler/src/statement/definition/definition.rs @@ -17,7 +17,7 @@ //! Enforces a definition statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_core_ast::{Declare, Expression, Span, VariableName, Variables}; +use leo_ast::{Declare, Expression, Span, VariableName, Variables}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/iteration/iteration.rs b/compiler/src/statement/iteration/iteration.rs index bdf7f43f97..64104cbb45 100644 --- a/compiler/src/statement/iteration/iteration.rs +++ b/compiler/src/statement/iteration/iteration.rs @@ -25,7 +25,7 @@ use crate::{ Integer, StatementResult, }; -use leo_core_ast::{Expression, Identifier, Span, Statement, Type}; +use leo_ast::{Expression, Identifier, Span, Statement, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/return_/return_.rs b/compiler/src/statement/return_/return_.rs index 85f7e6caaf..ad8e6568c0 100644 --- a/compiler/src/statement/return_/return_.rs +++ b/compiler/src/statement/return_/return_.rs @@ -17,7 +17,7 @@ //! Enforces a return statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Expression, Span, Type}; +use leo_ast::{Expression, Span, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/statement/statement.rs b/compiler/src/statement/statement.rs index 1c23bee4dd..6b3472c9b6 100644 --- a/compiler/src/statement/statement.rs +++ b/compiler/src/statement/statement.rs @@ -17,7 +17,7 @@ //! Enforces a statement in a compiled Leo program. use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Statement, Type}; +use leo_ast::{Statement, Type}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/compiler/src/value/address/address.rs b/compiler/src/value/address/address.rs index 3bbdda41cd..95566475b0 100644 --- a/compiler/src/value/address/address.rs +++ b/compiler/src/value/address/address.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::AddressError, ConstrainedValue, GroupType}; -use leo_core_ast::{InputValue, Span}; +use leo_ast::{InputValue, Span}; use snarkos_dpc::base_dpc::instantiated::Components; use snarkos_errors::gadgets::SynthesisError; diff --git a/compiler/src/value/boolean/input.rs b/compiler/src/value/boolean/input.rs index 25a9b915f2..d35661f112 100644 --- a/compiler/src/value/boolean/input.rs +++ b/compiler/src/value/boolean/input.rs @@ -17,7 +17,7 @@ //! Methods to enforce constraints on input boolean values in a resolved Leo program. use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_core_ast::{InputValue, Span}; +use leo_ast::{InputValue, Span}; use snarkos_errors::gadgets::SynthesisError; use snarkos_models::{ diff --git a/compiler/src/value/field/field_type.rs b/compiler/src/value/field/field_type.rs index f2423ff0e3..39146ae593 100644 --- a/compiler/src/value/field/field_type.rs +++ b/compiler/src/value/field/field_type.rs @@ -17,7 +17,7 @@ //! A data type that represents a field value use crate::errors::FieldError; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_errors::gadgets::SynthesisError; use snarkos_models::{ diff --git a/compiler/src/value/field/input.rs b/compiler/src/value/field/input.rs index 6cf4339192..a498b25345 100644 --- a/compiler/src/value/field/input.rs +++ b/compiler/src/value/field/input.rs @@ -17,7 +17,7 @@ //! Methods to enforce constraints on input field values in a compiled Leo program. use crate::{errors::FieldError, value::ConstrainedValue, FieldType, GroupType}; -use leo_core_ast::{InputValue, Span}; +use leo_ast::{InputValue, Span}; use snarkos_errors::gadgets::SynthesisError; use snarkos_models::{ diff --git a/compiler/src/value/group/group_type.rs b/compiler/src/value/group/group_type.rs index 3521abecee..c80a6a8325 100644 --- a/compiler/src/value/group/group_type.rs +++ b/compiler/src/value/group/group_type.rs @@ -17,7 +17,7 @@ //! A data type that represents members in the group formed by the set of affine points on a curve. use crate::errors::GroupError; -use leo_core_ast::{GroupValue, Span}; +use leo_ast::{GroupValue, Span}; use snarkos_models::{ curves::{Field, One}, diff --git a/compiler/src/value/group/input.rs b/compiler/src/value/group/input.rs index a4cdae715c..2ff04b6095 100644 --- a/compiler/src/value/group/input.rs +++ b/compiler/src/value/group/input.rs @@ -17,7 +17,7 @@ //! Methods to enforce constraints on input group values in a Leo program. use crate::{errors::GroupError, ConstrainedValue, GroupType}; -use leo_core_ast::{GroupValue, InputValue, Span}; +use leo_ast::{GroupValue, InputValue, Span}; use snarkos_errors::gadgets::SynthesisError; use snarkos_models::{ diff --git a/compiler/src/value/group/targets/edwards_bls12.rs b/compiler/src/value/group/targets/edwards_bls12.rs index 66cbc8cae3..7a1ab306dc 100644 --- a/compiler/src/value/group/targets/edwards_bls12.rs +++ b/compiler/src/value/group/targets/edwards_bls12.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::GroupError, GroupType}; -use leo_core_ast::{GroupCoordinate, GroupTuple, GroupValue, Span}; +use leo_ast::{GroupCoordinate, GroupTuple, GroupValue, Span}; use snarkos_curves::{ edwards_bls12::{EdwardsAffine, EdwardsParameters, Fq}, diff --git a/compiler/src/value/implicit/implicit.rs b/compiler/src/value/implicit/implicit.rs index b838a4a689..d72c9f4648 100644 --- a/compiler/src/value/implicit/implicit.rs +++ b/compiler/src/value/implicit/implicit.rs @@ -17,7 +17,7 @@ //! Enforces constraints on an implicit number in a compiled Leo program. use crate::{errors::ValueError, value::ConstrainedValue, GroupType}; -use leo_core_ast::{Span, Type}; +use leo_ast::{Span, Type}; use snarkos_models::curves::{Field, PrimeField}; diff --git a/compiler/src/value/integer/integer.rs b/compiler/src/value/integer/integer.rs index f859caf69a..1476f3a3bc 100644 --- a/compiler/src/value/integer/integer.rs +++ b/compiler/src/value/integer/integer.rs @@ -16,7 +16,7 @@ //! Conversion of integer declarations to constraints in Leo. use crate::{errors::IntegerError, IntegerTrait}; -use leo_core_ast::{InputValue, IntegerType, Span}; +use leo_ast::{InputValue, IntegerType, Span}; use leo_gadgets::{ arithmetic::*, bits::comparator::{ComparatorGadget, EvaluateLtGadget}, diff --git a/compiler/src/value/value.rs b/compiler/src/value/value.rs index e74a688ddb..1082e9c053 100644 --- a/compiler/src/value/value.rs +++ b/compiler/src/value/value.rs @@ -26,7 +26,7 @@ use crate::{ GroupType, Integer, }; -use leo_core_ast::{Circuit, Function, GroupValue, Identifier, Span, Type}; +use leo_ast::{Circuit, Function, GroupValue, Identifier, Span, Type}; use leo_core_packages::Value; use snarkos_errors::gadgets::SynthesisError; diff --git a/compiler/tests/address/mod.rs b/compiler/tests/address/mod.rs index fac98eb643..3d892a5fb7 100644 --- a/compiler/tests/address/mod.rs +++ b/compiler/tests/address/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{assert_satisfied, expect_compiler_error, generate_main_input, parse_program}; -use leo_core_ast::InputValue; +use leo_ast::InputValue; static TEST_ADDRESS_1: &str = "aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8"; static TEST_ADDRESS_2: &str = "aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r"; diff --git a/compiler/tests/console/mod.rs b/compiler/tests/console/mod.rs index 73f0b41fe6..ba7c48aae9 100644 --- a/compiler/tests/console/mod.rs +++ b/compiler/tests/console/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{assert_satisfied, expect_compiler_error, generate_main_input, parse_program}; -use leo_core_ast::InputValue; +use leo_ast::InputValue; #[test] fn test_log() { diff --git a/compiler/tests/core/packages/unstable/blake2s/mod.rs b/compiler/tests/core/packages/unstable/blake2s/mod.rs index edbbc2e8bf..2b308db42e 100644 --- a/compiler/tests/core/packages/unstable/blake2s/mod.rs +++ b/compiler/tests/core/packages/unstable/blake2s/mod.rs @@ -23,7 +23,7 @@ use crate::{ parse_program_with_input, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U8Type, UnsignedIntegerType}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; diff --git a/compiler/tests/field/mod.rs b/compiler/tests/field/mod.rs index 706c5bd70d..0cb5e4198c 100644 --- a/compiler/tests/field/mod.rs +++ b/compiler/tests/field/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{assert_satisfied, expect_compiler_error, generate_main_input, parse_program}; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use snarkos_curves::edwards_bls12::Fq; use snarkos_utilities::bytes::ToBytes; diff --git a/compiler/tests/group/mod.rs b/compiler/tests/group/mod.rs index 901597806f..c560afdc57 100644 --- a/compiler/tests/group/mod.rs +++ b/compiler/tests/group/mod.rs @@ -18,7 +18,7 @@ use crate::{ assert_satisfied, expect_compiler_error, expect_synthesis_error, field::field_to_decimal_string, generate_main_input, parse_program, parse_program_with_input, }; -use leo_core_ast::{GroupCoordinate, GroupTuple, GroupValue, InputValue, Span}; +use leo_ast::{GroupCoordinate, GroupTuple, GroupValue, InputValue, Span}; use snarkos_curves::edwards_bls12::EdwardsAffine; diff --git a/compiler/tests/integers/i128/mod.rs b/compiler/tests/integers/i128/mod.rs index 8f4023a99a..8cb73fff1a 100644 --- a/compiler/tests/integers/i128/mod.rs +++ b/compiler/tests/integers/i128/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_computation_error, expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{I128Type, IntegerType, SignedIntegerType}; test_int!( diff --git a/compiler/tests/integers/i16/mod.rs b/compiler/tests/integers/i16/mod.rs index 73519f487a..ad2988aad0 100644 --- a/compiler/tests/integers/i16/mod.rs +++ b/compiler/tests/integers/i16/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_computation_error, expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{I16Type, IntegerType, SignedIntegerType}; test_int!( diff --git a/compiler/tests/integers/i32/mod.rs b/compiler/tests/integers/i32/mod.rs index 6c18449559..f4df3cc7ff 100644 --- a/compiler/tests/integers/i32/mod.rs +++ b/compiler/tests/integers/i32/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_computation_error, expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{I32Type, IntegerType, SignedIntegerType}; test_int!( diff --git a/compiler/tests/integers/i64/mod.rs b/compiler/tests/integers/i64/mod.rs index 1d61ef1bca..713e02dd8e 100644 --- a/compiler/tests/integers/i64/mod.rs +++ b/compiler/tests/integers/i64/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_computation_error, expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{I64Type, IntegerType, SignedIntegerType}; test_int!( diff --git a/compiler/tests/integers/i8/mod.rs b/compiler/tests/integers/i8/mod.rs index 6a8f535b72..813e2c13d2 100644 --- a/compiler/tests/integers/i8/mod.rs +++ b/compiler/tests/integers/i8/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_computation_error, expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{I8Type, IntegerType, SignedIntegerType}; test_int!( diff --git a/compiler/tests/integers/u128/mod.rs b/compiler/tests/integers/u128/mod.rs index 84e72e27c7..5312c43e5a 100644 --- a/compiler/tests/integers/u128/mod.rs +++ b/compiler/tests/integers/u128/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U128Type, UnsignedIntegerType}; test_uint!( diff --git a/compiler/tests/integers/u16/mod.rs b/compiler/tests/integers/u16/mod.rs index c6a3388505..fac708a456 100644 --- a/compiler/tests/integers/u16/mod.rs +++ b/compiler/tests/integers/u16/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U16Type, UnsignedIntegerType}; test_uint!( diff --git a/compiler/tests/integers/u32/mod.rs b/compiler/tests/integers/u32/mod.rs index fc4cd16eb8..ac6b51f3fd 100644 --- a/compiler/tests/integers/u32/mod.rs +++ b/compiler/tests/integers/u32/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U32Type, UnsignedIntegerType}; test_uint!( diff --git a/compiler/tests/integers/u64/mod.rs b/compiler/tests/integers/u64/mod.rs index bd18a0fd09..d66ec56e64 100644 --- a/compiler/tests/integers/u64/mod.rs +++ b/compiler/tests/integers/u64/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U64Type, UnsignedIntegerType}; test_uint!( diff --git a/compiler/tests/integers/u8/mod.rs b/compiler/tests/integers/u8/mod.rs index f9d6a5e1bb..3eb3666263 100644 --- a/compiler/tests/integers/u8/mod.rs +++ b/compiler/tests/integers/u8/mod.rs @@ -21,7 +21,7 @@ use crate::{ integers::{expect_parsing_error, IntegerTester}, parse_program, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; use leo_input::types::{IntegerType, U8Type, UnsignedIntegerType}; test_uint!( diff --git a/compiler/tests/mod.rs b/compiler/tests/mod.rs index fd16809cf0..a18efa9428 100644 --- a/compiler/tests/mod.rs +++ b/compiler/tests/mod.rs @@ -35,6 +35,7 @@ pub mod statements; pub mod syntax; pub mod tuples; +use leo_ast::{InputValue, MainInput}; use leo_compiler::{ compiler::Compiler, errors::CompilerError, @@ -42,7 +43,6 @@ use leo_compiler::{ ConstrainedValue, OutputBytes, }; -use leo_core_ast::{InputValue, MainInput}; use leo_input::types::{IntegerType, U32Type, UnsignedIntegerType}; use snarkos_curves::edwards_bls12::Fq; diff --git a/compiler/tests/mutability/mod.rs b/compiler/tests/mutability/mod.rs index 3ac48f07d4..8442357044 100644 --- a/compiler/tests/mutability/mod.rs +++ b/compiler/tests/mutability/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{assert_satisfied, expect_compiler_error, expect_type_inference_error, generate_main_input, parse_program}; -use leo_core_ast::InputValue; +use leo_ast::InputValue; #[test] fn test_let() { diff --git a/compiler/tests/statements/conditional/mod.rs b/compiler/tests/statements/conditional/mod.rs index d6b5ab8c14..3c243c9804 100644 --- a/compiler/tests/statements/conditional/mod.rs +++ b/compiler/tests/statements/conditional/mod.rs @@ -24,7 +24,7 @@ use crate::{ parse_program_with_input, EdwardsTestCompiler, }; -use leo_core_ast::InputValue; +use leo_ast::InputValue; #[test] fn test_assert() { diff --git a/compiler/tests/statements/mod.rs b/compiler/tests/statements/mod.rs index c6b7efdd2f..4680bee86d 100644 --- a/compiler/tests/statements/mod.rs +++ b/compiler/tests/statements/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{assert_satisfied, expect_type_inference_error, generate_main_input, parse_program}; -use leo_core_ast::InputValue; +use leo_ast::InputValue; pub mod conditional; diff --git a/core-packages/Cargo.toml b/core-packages/Cargo.toml index b0d93dc423..abc77f3d5d 100644 --- a/core-packages/Cargo.toml +++ b/core-packages/Cargo.toml @@ -21,8 +21,8 @@ edition = "2018" path = "../gadgets" version = "1.0.3" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.snarkos-errors] diff --git a/core-packages/src/errors/core_circuit.rs b/core-packages/src/errors/core_circuit.rs index 5b2e81c70f..ce394e18de 100644 --- a/core-packages/src/errors/core_circuit.rs +++ b/core-packages/src/errors/core_circuit.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::Value; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use snarkos_errors::gadgets::SynthesisError; diff --git a/core-packages/src/errors/core_package.rs b/core-packages/src/errors/core_package.rs index 6c8726b906..7ce7f150b8 100644 --- a/core-packages/src/errors/core_package.rs +++ b/core-packages/src/errors/core_package.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/core-packages/src/errors/core_package_list.rs b/core-packages/src/errors/core_package_list.rs index 57e4b292e7..f8c2f35026 100644 --- a/core-packages/src/errors/core_package_list.rs +++ b/core-packages/src/errors/core_package_list.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, ImportSymbol, Span}; +use leo_ast::{Error as FormattedError, ImportSymbol, Span}; use crate::CorePackageError; use std::path::Path; diff --git a/core-packages/src/errors/leo_core_package.rs b/core-packages/src/errors/leo_core_package.rs index be5bed0ffb..30db8ef7d3 100644 --- a/core-packages/src/errors/leo_core_package.rs +++ b/core-packages/src/errors/leo_core_package.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{CoreCircuitError, CorePackageListError}; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/core-packages/src/lib.rs b/core-packages/src/lib.rs index 1293becee1..67533ae4a5 100644 --- a/core-packages/src/lib.rs +++ b/core-packages/src/lib.rs @@ -27,7 +27,7 @@ pub mod types; pub use self::types::*; use crate::CoreCircuit; -use leo_core_ast::Span; +use leo_ast::Span; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/core-packages/src/packages/unstable/blake2s.rs b/core-packages/src/packages/unstable/blake2s.rs index f9ede1f7e2..a9371cd070 100644 --- a/core-packages/src/packages/unstable/blake2s.rs +++ b/core-packages/src/packages/unstable/blake2s.rs @@ -16,7 +16,7 @@ use crate::{CoreCircuit, CoreCircuitError, Value}; -use leo_core_ast::{ +use leo_ast::{ Circuit, CircuitMember, Expression, diff --git a/core-packages/src/types/core_circuit.rs b/core-packages/src/types/core_circuit.rs index 7d58d6b3c7..b098db3970 100644 --- a/core-packages/src/types/core_circuit.rs +++ b/core-packages/src/types/core_circuit.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{CoreCircuitError, Value}; -use leo_core_ast::{Circuit, Identifier, Span}; +use leo_ast::{Circuit, Identifier, Span}; use snarkos_models::{ curves::{Field, PrimeField}, diff --git a/core-packages/src/types/core_circuit_struct_list.rs b/core-packages/src/types/core_circuit_struct_list.rs index f8dd653ecc..8da8f6f160 100644 --- a/core-packages/src/types/core_circuit_struct_list.rs +++ b/core-packages/src/types/core_circuit_struct_list.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::Circuit; +use leo_ast::Circuit; /// List of imported core circuit structs. /// This struct is created from a `CorePackageList` diff --git a/core-packages/src/types/core_package.rs b/core-packages/src/types/core_package.rs index 9435910765..814de215f5 100644 --- a/core-packages/src/types/core_package.rs +++ b/core-packages/src/types/core_package.rs @@ -20,7 +20,7 @@ use crate::{ CoreCircuitStructList, CorePackageError, }; -use leo_core_ast::{Identifier, ImportSymbol, Package, PackageAccess}; +use leo_ast::{Identifier, ImportSymbol, Package, PackageAccess}; use std::convert::TryFrom; /// A core package dependency to be imported into a Leo program. diff --git a/core-packages/src/types/core_package_list.rs b/core-packages/src/types/core_package_list.rs index a70c8f886b..cf2c760921 100644 --- a/core-packages/src/types/core_package_list.rs +++ b/core-packages/src/types/core_package_list.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{CoreCircuitStructList, CorePackage, CorePackageListError, UNSTABLE_CORE_PACKAGE_KEYWORD}; -use leo_core_ast::PackageAccess; +use leo_ast::PackageAccess; use std::convert::TryFrom; /// A list of core package dependencies. diff --git a/grammar/src/lib.rs b/grammar/src/lib.rs index f2e818788c..201e053dc6 100644 --- a/grammar/src/lib.rs +++ b/grammar/src/lib.rs @@ -18,7 +18,7 @@ //! //! This module contains the [`Grammar`] type, a wrapper around the [`File`] type in this module. //! The [`Grammar`] type is the datatype generated by the pest parser using grammar from `leo.pest`. -//! The [`Grammar`] type is intended to be parsed into a [`LeoCoreAst`]. It should not be parsed by +//! The [`Grammar`] type is intended to be parsed into a [`LeoAst`]. It should not be parsed by //! any other pass of the compiler. #[macro_use] diff --git a/imports/Cargo.toml b/imports/Cargo.toml index 4dea07fb0e..6990d086c4 100644 --- a/imports/Cargo.toml +++ b/imports/Cargo.toml @@ -17,8 +17,8 @@ include = ["Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "GPL-3.0" edition = "2018" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.leo-grammar] diff --git a/imports/src/errors/import_parser.rs b/imports/src/errors/import_parser.rs index 5885eccbda..5638e867cd 100644 --- a/imports/src/errors/import_parser.rs +++ b/imports/src/errors/import_parser.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Identifier, Span}; +use leo_ast::{Error as FormattedError, Identifier, Span}; use leo_grammar::ParserError; use std::{io, path::Path}; diff --git a/imports/src/parser/core_package.rs b/imports/src/parser/core_package.rs index 8227bbab7a..67c3df8d47 100644 --- a/imports/src/parser/core_package.rs +++ b/imports/src/parser/core_package.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::ImportParserError, ImportParser}; -use leo_core_ast::Package; +use leo_ast::Package; pub static CORE_PACKAGE_NAME: &str = "core"; diff --git a/imports/src/parser/import_parser.rs b/imports/src/parser/import_parser.rs index f5da49856b..58a2ca8f19 100644 --- a/imports/src/parser/import_parser.rs +++ b/imports/src/parser/import_parser.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::errors::ImportParserError; -use leo_core_ast::{Package, Program}; +use leo_ast::{Package, Program}; use std::{ collections::{HashMap, HashSet}, diff --git a/imports/src/parser/parse_package.rs b/imports/src/parser/parse_package.rs index 5656119d39..0ab54a84ca 100644 --- a/imports/src/parser/parse_package.rs +++ b/imports/src/parser/parse_package.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::ImportParserError, ImportParser, CORE_PACKAGE_NAME}; -use leo_core_ast::{Package, PackageAccess}; +use leo_ast::{Package, PackageAccess}; use std::{fs, fs::DirEntry, path::PathBuf}; diff --git a/imports/src/parser/parse_symbol.rs b/imports/src/parser/parse_symbol.rs index 8f09a1fbcc..4856862aad 100644 --- a/imports/src/parser/parse_symbol.rs +++ b/imports/src/parser/parse_symbol.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{errors::ImportParserError, ImportParser}; -use leo_core_ast::{ImportSymbol, Program, Span}; +use leo_ast::{ImportSymbol, Program, Span}; use leo_grammar::Grammar; use std::{ffi::OsString, fs::DirEntry, path::PathBuf}; diff --git a/state/Cargo.toml b/state/Cargo.toml index 36f172edd9..d49bc194d2 100644 --- a/state/Cargo.toml +++ b/state/Cargo.toml @@ -21,8 +21,8 @@ edition = "2018" path = "../input" version = "1.0.3" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.snarkos-algorithms] diff --git a/state/src/local_data_commitment/local_data_commitment.rs b/state/src/local_data_commitment/local_data_commitment.rs index 0b3d33ee9a..fd6fc3cd64 100644 --- a/state/src/local_data_commitment/local_data_commitment.rs +++ b/state/src/local_data_commitment/local_data_commitment.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{verify_record_commitment, LocalDataVerificationError, StateLeafValues, StateValues}; -use leo_core_ast::Input as TypedInput; +use leo_ast::Input as TypedInput; use snarkos_algorithms::commitment_tree::CommitmentMerklePath; use snarkos_dpc::base_dpc::{ diff --git a/state/src/local_data_commitment/state_leaf_values.rs b/state/src/local_data_commitment/state_leaf_values.rs index 4f01fad3fd..4c7b743f7f 100644 --- a/state/src/local_data_commitment/state_leaf_values.rs +++ b/state/src/local_data_commitment/state_leaf_values.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{find_input, input_to_integer_string, input_to_u8_vec, StateLeafValuesError}; -use leo_core_ast::StateLeaf as TypedStateLeaf; +use leo_ast::StateLeaf as TypedStateLeaf; use std::convert::TryFrom; diff --git a/state/src/local_data_commitment/state_values.rs b/state/src/local_data_commitment/state_values.rs index 7dcdc9c783..eafc9d4f2f 100644 --- a/state/src/local_data_commitment/state_values.rs +++ b/state/src/local_data_commitment/state_values.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{find_input, input_to_integer_string, input_to_u8_vec, StateValuesError}; -use leo_core_ast::State as TypedState; +use leo_ast::State as TypedState; use std::convert::TryFrom; diff --git a/state/src/record_commitment/dpc_record_values.rs b/state/src/record_commitment/dpc_record_values.rs index 1b61660f60..5d0e9a271b 100644 --- a/state/src/record_commitment/dpc_record_values.rs +++ b/state/src/record_commitment/dpc_record_values.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{utilities::*, DPCRecordValuesError}; -use leo_core_ast::Record as TypedRecord; +use leo_ast::Record as TypedRecord; use snarkos_dpc::base_dpc::instantiated::Components; use snarkos_objects::AccountAddress; diff --git a/state/src/record_commitment/record_commitment.rs b/state/src/record_commitment/record_commitment.rs index c42cac2d48..5b9ebc38b7 100644 --- a/state/src/record_commitment/record_commitment.rs +++ b/state/src/record_commitment/record_commitment.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{DPCRecordValues, RecordVerificationError}; -use leo_core_ast::Record as TypedRecord; +use leo_ast::Record as TypedRecord; use snarkos_dpc::base_dpc::{ instantiated::{Components, RecordCommitment}, diff --git a/state/src/utilities/input_value.rs b/state/src/utilities/input_value.rs index 2500acde9b..a04fde7c78 100644 --- a/state/src/utilities/input_value.rs +++ b/state/src/utilities/input_value.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::InputValueError; -use leo_core_ast::{InputValue, Parameter}; +use leo_ast::{InputValue, Parameter}; use std::collections::HashMap; diff --git a/state/tests/test_verify_local_data_commitment.rs b/state/tests/test_verify_local_data_commitment.rs index 226fbbfb71..83dc69a46b 100644 --- a/state/tests/test_verify_local_data_commitment.rs +++ b/state/tests/test_verify_local_data_commitment.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::Input; +use leo_ast::Input; use leo_input::LeoInputParser; use leo_state::verify_local_data_commitment; diff --git a/state/tests/test_verify_record_commitment.rs b/state/tests/test_verify_record_commitment.rs index be03b32094..0a148a407f 100644 --- a/state/tests/test_verify_record_commitment.rs +++ b/state/tests/test_verify_record_commitment.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::Input; +use leo_ast::Input; use leo_input::LeoInputParser; use leo_state::verify_record_commitment; diff --git a/symbol-table/Cargo.toml b/symbol-table/Cargo.toml index ca61f72300..41a7c9437a 100644 --- a/symbol-table/Cargo.toml +++ b/symbol-table/Cargo.toml @@ -21,8 +21,8 @@ edition = "2018" path = "../grammar" version = "1.0.3" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.leo-core-packages] diff --git a/symbol-table/src/errors/symbol_table.rs b/symbol-table/src/errors/symbol_table.rs index 0b1f61ef88..f281605ea6 100644 --- a/symbol-table/src/errors/symbol_table.rs +++ b/symbol-table/src/errors/symbol_table.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{TypeError, UserDefinedType}; -use leo_core_ast::{Error as FormattedError, ImportSymbol, Program, Span}; +use leo_ast::{Error as FormattedError, ImportSymbol, Program, Span}; use leo_core_packages::{CorePackageListError, LeoCorePackageError}; use std::path::Path; diff --git a/symbol-table/src/errors/type_.rs b/symbol-table/src/errors/type_.rs index 487b323b4a..5e3bed8102 100644 --- a/symbol-table/src/errors/type_.rs +++ b/symbol-table/src/errors/type_.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::Type; -use leo_core_ast::{Error as FormattedError, Identifier, Span}; +use leo_ast::{Error as FormattedError, Identifier, Span}; use std::path::Path; diff --git a/symbol-table/src/imports/imported_symbols.rs b/symbol-table/src/imports/imported_symbols.rs index a68d6f5f31..c344b9457b 100644 --- a/symbol-table/src/imports/imported_symbols.rs +++ b/symbol-table/src/imports/imported_symbols.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{ImportStatement, ImportSymbol, Package, PackageAccess}; +use leo_ast::{ImportStatement, ImportSymbol, Package, PackageAccess}; /// Stores the the package file name and imported symbol from an import statement #[derive(Debug)] diff --git a/symbol-table/src/symbol_table.rs b/symbol-table/src/symbol_table.rs index 7af8f9a530..edabc6f772 100644 --- a/symbol-table/src/symbol_table.rs +++ b/symbol-table/src/symbol_table.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{CircuitType, CircuitVariableType, FunctionType, ImportedSymbols, SymbolTableError, UserDefinedType}; -use leo_core_ast::{Circuit, Function, Identifier, ImportStatement, ImportSymbol, Input, Package, Program}; +use leo_ast::{Circuit, Function, Identifier, ImportStatement, ImportSymbol, Input, Package, Program}; use leo_core_packages::CorePackageList; use leo_imports::ImportParser; diff --git a/symbol-table/src/types/circuits/circuit.rs b/symbol-table/src/types/circuits/circuit.rs index 5a1b6e0f4b..2e6ea923f0 100644 --- a/symbol-table/src/types/circuits/circuit.rs +++ b/symbol-table/src/types/circuits/circuit.rs @@ -22,7 +22,7 @@ use crate::{ Type, TypeError, }; -use leo_core_ast::{Circuit, CircuitMember, Identifier, InputValue, Parameter, Span}; +use leo_ast::{Circuit, CircuitMember, Identifier, InputValue, Parameter, Span}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/symbol-table/src/types/circuits/circuit_variable.rs b/symbol-table/src/types/circuits/circuit_variable.rs index dfc19e7336..dfbb4d94dc 100644 --- a/symbol-table/src/types/circuits/circuit_variable.rs +++ b/symbol-table/src/types/circuits/circuit_variable.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{Attribute, CircuitType, Type}; -use leo_core_ast::Identifier; +use leo_ast::Identifier; use serde::{Deserialize, Serialize}; diff --git a/symbol-table/src/types/functions/function.rs b/symbol-table/src/types/functions/function.rs index 2cddcdef4b..ca96be17e7 100644 --- a/symbol-table/src/types/functions/function.rs +++ b/symbol-table/src/types/functions/function.rs @@ -19,7 +19,7 @@ use crate::{ SymbolTable, TypeError, }; -use leo_core_ast::{Function, Identifier}; +use leo_ast::{Function, Identifier}; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; diff --git a/symbol-table/src/types/functions/function_input.rs b/symbol-table/src/types/functions/function_input.rs index 7d04ecd643..42afe2a52a 100644 --- a/symbol-table/src/types/functions/function_input.rs +++ b/symbol-table/src/types/functions/function_input.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{FunctionInputVariableType, SymbolTable, Type, TypeError}; -use leo_core_ast::{FunctionInput, Identifier}; +use leo_ast::{FunctionInput, Identifier}; use serde::{Deserialize, Serialize}; diff --git a/symbol-table/src/types/functions/function_input_variable.rs b/symbol-table/src/types/functions/function_input_variable.rs index 53069b43a1..2cfd8275ec 100644 --- a/symbol-table/src/types/functions/function_input_variable.rs +++ b/symbol-table/src/types/functions/function_input_variable.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{Attribute, SymbolTable, Type, TypeError, UserDefinedType}; -use leo_core_ast::{FunctionInputVariable, Identifier, Span}; +use leo_ast::{FunctionInputVariable, Identifier, Span}; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; diff --git a/symbol-table/src/types/functions/function_output.rs b/symbol-table/src/types/functions/function_output.rs index dcefe2b207..2da52025cf 100644 --- a/symbol-table/src/types/functions/function_output.rs +++ b/symbol-table/src/types/functions/function_output.rs @@ -16,7 +16,7 @@ use crate::{SymbolTable, Type, TypeError}; -use leo_core_ast::{Identifier, Span, Type as UnresolvedType}; +use leo_ast::{Identifier, Span, Type as UnresolvedType}; use serde::{Deserialize, Serialize}; diff --git a/symbol-table/src/types/type_.rs b/symbol-table/src/types/type_.rs index 110a2607bc..ba819be1e7 100644 --- a/symbol-table/src/types/type_.rs +++ b/symbol-table/src/types/type_.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . use crate::{SymbolTable, TypeError, TypeVariable}; -use leo_core_ast::{Identifier, IntegerType, Span, Type as UnresolvedType}; +use leo_ast::{Identifier, IntegerType, Span, Type as UnresolvedType}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/symbol-table/src/types/type_variable.rs b/symbol-table/src/types/type_variable.rs index f9e5420433..161c5f3953 100644 --- a/symbol-table/src/types/type_variable.rs +++ b/symbol-table/src/types/type_variable.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::Identifier; +use leo_ast::Identifier; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/symbol-table/src/types/user_defined/user_defined_type.rs b/symbol-table/src/types/user_defined/user_defined_type.rs index 3a536f0d08..80e75eedf8 100644 --- a/symbol-table/src/types/user_defined/user_defined_type.rs +++ b/symbol-table/src/types/user_defined/user_defined_type.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . use crate::{Attribute, FunctionInputVariableType, Type}; -use leo_core_ast::{Circuit, Function, Identifier}; +use leo_ast::{Circuit, Function, Identifier}; use std::{ fmt, diff --git a/symbol-table/tests/mod.rs b/symbol-table/tests/mod.rs index da0796f1f5..5e7646b25e 100644 --- a/symbol-table/tests/mod.rs +++ b/symbol-table/tests/mod.rs @@ -16,7 +16,7 @@ pub mod symbol_table; -use leo_core_ast::{Input, LeoCoreAst}; +use leo_ast::{Input, LeoAst}; use leo_grammar::Grammar; use leo_symbol_table::{SymbolTable, SymbolTableError}; @@ -27,7 +27,7 @@ const TEST_PROGRAM_PATH: &str = ""; /// A helper struct to test a `SymbolTable`. pub struct TestSymbolTable { - typed: LeoCoreAst, + typed: LeoAst, } impl TestSymbolTable { @@ -45,7 +45,7 @@ impl TestSymbolTable { let ast = Grammar::new(&file_path, &*file_string).unwrap(); // Get typed syntax tree - let typed = LeoCoreAst::new(TEST_PROGRAM_PATH, &ast); + let typed = LeoAst::new(TEST_PROGRAM_PATH, &ast); Self { typed } } diff --git a/type-inference/Cargo.toml b/type-inference/Cargo.toml index e448fab596..b8dee93e48 100644 --- a/type-inference/Cargo.toml +++ b/type-inference/Cargo.toml @@ -17,8 +17,8 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "GPL-3.0" edition = "2018" -[dependencies.leo-core-ast] -path = "../core-ast" +[dependencies.leo-ast] +path = "../ast" version = "1.0.3" [dependencies.leo-imports] diff --git a/type-inference/src/assertions/type_assertion.rs b/type-inference/src/assertions/type_assertion.rs index fd01a4aaba..8baf98f5b0 100644 --- a/type-inference/src/assertions/type_assertion.rs +++ b/type-inference/src/assertions/type_assertion.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{TypeAssertionError, TypeEquality, TypeMembership, TypeVariablePairs}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_symbol_table::{Type, TypeVariable}; use serde::{Deserialize, Serialize}; diff --git a/type-inference/src/assertions/type_equality.rs b/type-inference/src/assertions/type_equality.rs index baeddd9ddd..f20fd696ce 100644 --- a/type-inference/src/assertions/type_equality.rs +++ b/type-inference/src/assertions/type_equality.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{TypeAssertionError, TypeVariablePairs}; -use leo_core_ast::Span; +use leo_ast::Span; use leo_symbol_table::{Type, TypeVariable}; use serde::{Deserialize, Serialize}; diff --git a/type-inference/src/assertions/type_membership.rs b/type-inference/src/assertions/type_membership.rs index c31e22ce01..5df0edb0c7 100644 --- a/type-inference/src/assertions/type_membership.rs +++ b/type-inference/src/assertions/type_membership.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::TypeAssertionError; -use leo_core_ast::Span; +use leo_ast::Span; use leo_symbol_table::{Type, TypeVariable}; use serde::{Deserialize, Serialize}; diff --git a/type-inference/src/assertions/type_variable_pair.rs b/type-inference/src/assertions/type_variable_pair.rs index abde4984fe..b7e7f09552 100644 --- a/type-inference/src/assertions/type_variable_pair.rs +++ b/type-inference/src/assertions/type_variable_pair.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::TypeAssertionError; -use leo_core_ast::Span; +use leo_ast::Span; use leo_symbol_table::{flatten_array_type, Type, TypeVariable}; use std::borrow::Cow; diff --git a/type-inference/src/errors/frame.rs b/type-inference/src/errors/frame.rs index 59c1bdeb96..1d671fc40b 100644 --- a/type-inference/src/errors/frame.rs +++ b/type-inference/src/errors/frame.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{ScopeError, TypeAssertionError}; -use leo_core_ast::{Error as FormattedError, Expression, Identifier, Span}; +use leo_ast::{Error as FormattedError, Expression, Identifier, Span}; use leo_symbol_table::{Type, TypeError}; use std::path::Path; diff --git a/type-inference/src/errors/scope.rs b/type-inference/src/errors/scope.rs index 1d834a8073..e31c3aaea4 100644 --- a/type-inference/src/errors/scope.rs +++ b/type-inference/src/errors/scope.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::VariableTableError; -use leo_core_ast::Error as FormattedError; +use leo_ast::Error as FormattedError; use std::path::Path; diff --git a/type-inference/src/errors/type_assertion.rs b/type-inference/src/errors/type_assertion.rs index 0f55bd22d2..a2da4a6c08 100644 --- a/type-inference/src/errors/type_assertion.rs +++ b/type-inference/src/errors/type_assertion.rs @@ -16,7 +16,7 @@ use crate::TypeMembership; -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use leo_symbol_table::Type; use std::path::Path; diff --git a/type-inference/src/errors/type_inference.rs b/type-inference/src/errors/type_inference.rs index 83c7dde93e..dac08fc59b 100644 --- a/type-inference/src/errors/type_inference.rs +++ b/type-inference/src/errors/type_inference.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::FrameError; -use leo_core_ast::Error as FormattedError; +use leo_ast::Error as FormattedError; use std::path::Path; diff --git a/type-inference/src/errors/variable_table.rs b/type-inference/src/errors/variable_table.rs index cc359db3f9..bb26dfb7e6 100644 --- a/type-inference/src/errors/variable_table.rs +++ b/type-inference/src/errors/variable_table.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_core_ast::{Error as FormattedError, Span}; +use leo_ast::{Error as FormattedError, Span}; use std::path::Path; diff --git a/type-inference/src/objects/frame.rs b/type-inference/src/objects/frame.rs index 1148a619ea..9fd37814d6 100644 --- a/type-inference/src/objects/frame.rs +++ b/type-inference/src/objects/frame.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{FrameError, Scope, TypeAssertion}; -use leo_core_ast::{ +use leo_ast::{ Assignee, AssigneeAccess, CircuitVariableDefinition, diff --git a/type-inference/src/type_inference.rs b/type-inference/src/type_inference.rs index 1984203e7e..ee485d1d47 100644 --- a/type-inference/src/type_inference.rs +++ b/type-inference/src/type_inference.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{Frame, Scope, TypeInferenceError}; -use leo_core_ast::{Circuit, CircuitMember, Function, Program}; +use leo_ast::{Circuit, CircuitMember, Function, Program}; use leo_symbol_table::SymbolTable; /// A type inference check for a Leo program. diff --git a/type-inference/tests/mod.rs b/type-inference/tests/mod.rs index dedcdf7fda..0753812059 100644 --- a/type-inference/tests/mod.rs +++ b/type-inference/tests/mod.rs @@ -23,7 +23,7 @@ pub mod variables; use leo_grammar::Grammar; use leo_type_inference::TypeInference; -use leo_core_ast::{Input, LeoCoreAst, Program}; +use leo_ast::{Input, LeoAst, Program}; use leo_imports::ImportParser; use leo_symbol_table::SymbolTable; use std::path::PathBuf; @@ -49,7 +49,7 @@ impl TestTypeInference { let ast = Grammar::new(&file_path, &*file_string).unwrap(); // Get typed syntax tree. - let typed = LeoCoreAst::new(TEST_PROGRAM_NAME, &ast); + let typed = LeoAst::new(TEST_PROGRAM_NAME, &ast); let program = typed.into_repr(); // Create empty import parser.