From 7cf41558bcf956e0403288f14dcf12c0370e68a1 Mon Sep 17 00:00:00 2001 From: collin Date: Fri, 30 Oct 2020 10:51:45 -0700 Subject: [PATCH] rename static-check -> symbol-table 3 --- Cargo.lock | 8 ++++---- Cargo.toml | 6 +++--- compiler/Cargo.toml | 4 ++-- compiler/src/compiler.rs | 4 ++-- compiler/src/errors/compiler.rs | 2 +- compiler/src/import/store/import.rs | 2 +- dynamic-check/Cargo.toml | 4 ++-- dynamic-check/src/assertions/type_assertion.rs | 2 +- dynamic-check/src/assertions/type_equality.rs | 2 +- dynamic-check/src/assertions/type_membership.rs | 2 +- dynamic-check/src/assertions/type_variable_pair.rs | 2 +- dynamic-check/src/dynamic_check.rs | 2 +- dynamic-check/src/errors/frame.rs | 2 +- dynamic-check/src/errors/type_assertion.rs | 2 +- dynamic-check/src/objects/frame.rs | 2 +- dynamic-check/src/objects/scope.rs | 2 +- dynamic-check/src/objects/variable_table.rs | 2 +- dynamic-check/tests/mod.rs | 2 +- {static-check => symbol-table}/Cargo.toml | 2 +- .../src/attributes/attribute.rs | 0 {static-check => symbol-table}/src/attributes/mod.rs | 0 {static-check => symbol-table}/src/errors/mod.rs | 0 {static-check => symbol-table}/src/errors/symbol_table.rs | 0 {static-check => symbol-table}/src/errors/type_.rs | 0 .../src/imports/imported_symbols.rs | 0 {static-check => symbol-table}/src/imports/mod.rs | 0 {static-check => symbol-table}/src/lib.rs | 0 {static-check => symbol-table}/src/symbol_table.rs | 0 .../src/types/circuits/circuit.rs | 0 .../src/types/circuits/circuit_function.rs | 0 .../src/types/circuits/circuit_variable.rs | 0 {static-check => symbol-table}/src/types/circuits/mod.rs | 0 .../src/types/functions/function.rs | 0 .../src/types/functions/function_input.rs | 0 .../src/types/functions/function_input_variable.rs | 0 .../src/types/functions/function_output.rs | 0 {static-check => symbol-table}/src/types/functions/mod.rs | 0 {static-check => symbol-table}/src/types/mod.rs | 0 {static-check => symbol-table}/src/types/type_.rs | 0 {static-check => symbol-table}/src/types/type_variable.rs | 0 .../src/types/user_defined/mod.rs | 0 .../src/types/user_defined/user_defined_type.rs | 0 {static-check => symbol-table}/tests/mod.rs | 0 .../tests/symbol_table/duplicate_circuit.leo | 0 .../tests/symbol_table/duplicate_function.leo | 0 {static-check => symbol-table}/tests/symbol_table/mod.rs | 0 .../tests/symbol_table/self_not_available.leo | 0 .../tests/symbol_table/undefined_circuit.leo | 0 48 files changed, 27 insertions(+), 27 deletions(-) rename {static-check => symbol-table}/Cargo.toml (96%) rename {static-check => symbol-table}/src/attributes/attribute.rs (100%) rename {static-check => symbol-table}/src/attributes/mod.rs (100%) rename {static-check => symbol-table}/src/errors/mod.rs (100%) rename {static-check => symbol-table}/src/errors/symbol_table.rs (100%) rename {static-check => symbol-table}/src/errors/type_.rs (100%) rename {static-check => symbol-table}/src/imports/imported_symbols.rs (100%) rename {static-check => symbol-table}/src/imports/mod.rs (100%) rename {static-check => symbol-table}/src/lib.rs (100%) rename {static-check => symbol-table}/src/symbol_table.rs (100%) rename {static-check => symbol-table}/src/types/circuits/circuit.rs (100%) rename {static-check => symbol-table}/src/types/circuits/circuit_function.rs (100%) rename {static-check => symbol-table}/src/types/circuits/circuit_variable.rs (100%) rename {static-check => symbol-table}/src/types/circuits/mod.rs (100%) rename {static-check => symbol-table}/src/types/functions/function.rs (100%) rename {static-check => symbol-table}/src/types/functions/function_input.rs (100%) rename {static-check => symbol-table}/src/types/functions/function_input_variable.rs (100%) rename {static-check => symbol-table}/src/types/functions/function_output.rs (100%) rename {static-check => symbol-table}/src/types/functions/mod.rs (100%) rename {static-check => symbol-table}/src/types/mod.rs (100%) rename {static-check => symbol-table}/src/types/type_.rs (100%) rename {static-check => symbol-table}/src/types/type_variable.rs (100%) rename {static-check => symbol-table}/src/types/user_defined/mod.rs (100%) rename {static-check => symbol-table}/src/types/user_defined/user_defined_type.rs (100%) rename {static-check => symbol-table}/tests/mod.rs (100%) rename {static-check => symbol-table}/tests/symbol_table/duplicate_circuit.leo (100%) rename {static-check => symbol-table}/tests/symbol_table/duplicate_function.leo (100%) rename {static-check => symbol-table}/tests/symbol_table/mod.rs (100%) rename {static-check => symbol-table}/tests/symbol_table/self_not_available.leo (100%) rename {static-check => symbol-table}/tests/symbol_table/undefined_circuit.leo (100%) diff --git a/Cargo.lock b/Cargo.lock index 7e9d4d1a47..cdf38c7bed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1259,7 +1259,7 @@ dependencies = [ "leo-input", "leo-package", "leo-state", - "leo-static-check", + "leo-symbol-table", "leo-typed", "num-bigint", "pest", @@ -1302,7 +1302,7 @@ version = "1.0.3" dependencies = [ "leo-ast", "leo-imports", - "leo-static-check", + "leo-symbol-table", "leo-typed", "serde", "serde_json", @@ -1369,7 +1369,7 @@ dependencies = [ "leo-input", "leo-package", "leo-state", - "leo-static-check", + "leo-symbol-table", "notify", "num-bigint", "rand", @@ -1430,7 +1430,7 @@ dependencies = [ ] [[package]] -name = "leo-static-check" +name = "leo-symbol-table" version = "1.0.3" dependencies = [ "leo-ast", diff --git a/Cargo.toml b/Cargo.toml index 6ea0e8e171..6becd8320c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ members = [ "package", "typed", "state", - "static-check", + "symbol-table", ] [dependencies.leo-compiler] @@ -72,8 +72,8 @@ version = "1.0.3" path = "./state" version = "1.0.3" -[dependencies.leo-static-check] -path = "./static-check" +[dependencies.leo-symbol-table] +path = "./symbol-table" version = "1.0.3" [dependencies.snarkos-algorithms] diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 25e05398bb..9944c1551a 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -53,8 +53,8 @@ version = "1.0.3" path = "../state" version = "1.0.3" -[dependencies.leo-static-check] -path = "../static-check" +[dependencies.leo-symbol-table] +path = "../symbol-table" version = "1.0.3" [dependencies.snarkos-curves] diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index 3c653f4a7a..28eaf8a715 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -29,7 +29,7 @@ use leo_imports::ImportParser; use leo_input::LeoInputParser; use leo_package::inputs::InputPairs; use leo_state::verify_local_data_commitment; -use leo_static_check::SymbolTable; +use leo_symbol_table::SymbolTable; use leo_typed::{Input, LeoTypedAst, MainInput, Program}; use snarkos_dpc::{base_dpc::instantiated::Components, SystemParameters}; @@ -232,7 +232,7 @@ impl> Compiler { self.program = typed_tree.into_repr(); self.imported_programs = ImportParser::parse(&self.program)?; - // Run static check on program. + // Create a new symbol table from the program, imported programs, and program input. let symbol_table = SymbolTable::new(&self.program, &self.imported_programs, &self.program_input)?; // Run dynamic check on program. diff --git a/compiler/src/errors/compiler.rs b/compiler/src/errors/compiler.rs index 2ebe45a579..c82569dccb 100644 --- a/compiler/src/errors/compiler.rs +++ b/compiler/src/errors/compiler.rs @@ -20,7 +20,7 @@ use leo_dynamic_check::DynamicCheckError; use leo_imports::ImportParserError; use leo_input::InputParserError; use leo_state::LocalDataVerificationError; -use leo_static_check::SymbolTableError; +use leo_symbol_table::SymbolTableError; use bincode::Error as SerdeError; use std::path::{Path, PathBuf}; diff --git a/compiler/src/import/store/import.rs b/compiler/src/import/store/import.rs index 2f0c96fbf9..094d7c0ca0 100644 --- a/compiler/src/import/store/import.rs +++ b/compiler/src/import/store/import.rs @@ -16,7 +16,7 @@ use crate::{errors::ImportError, ConstrainedProgram, GroupType}; use leo_imports::ImportParser; -use leo_static_check::imported_symbols::ImportedSymbols; +use leo_symbol_table::imported_symbols::ImportedSymbols; use leo_typed::ImportStatement; use snarkos_models::curves::{Field, PrimeField}; diff --git a/dynamic-check/Cargo.toml b/dynamic-check/Cargo.toml index 76855ac894..cd4bf2b8f4 100644 --- a/dynamic-check/Cargo.toml +++ b/dynamic-check/Cargo.toml @@ -28,8 +28,8 @@ version = "1.0.3" [dependencies.serde_json] version = "1.0" -[dependencies.leo-static-check] -path = "../static-check" +[dependencies.leo-symbol-table] +path = "../symbol-table" version = "1.0.3" [dependencies.leo-typed] diff --git a/dynamic-check/src/assertions/type_assertion.rs b/dynamic-check/src/assertions/type_assertion.rs index 2655e85298..030603cb22 100644 --- a/dynamic-check/src/assertions/type_assertion.rs +++ b/dynamic-check/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_static_check::{Type, TypeVariable}; +use leo_symbol_table::{Type, TypeVariable}; use leo_typed::Span; use serde::{Deserialize, Serialize}; diff --git a/dynamic-check/src/assertions/type_equality.rs b/dynamic-check/src/assertions/type_equality.rs index ed7e70f6ab..d8380ee085 100644 --- a/dynamic-check/src/assertions/type_equality.rs +++ b/dynamic-check/src/assertions/type_equality.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{TypeAssertionError, TypeVariablePairs}; -use leo_static_check::{Type, TypeVariable}; +use leo_symbol_table::{Type, TypeVariable}; use leo_typed::Span; use serde::{Deserialize, Serialize}; diff --git a/dynamic-check/src/assertions/type_membership.rs b/dynamic-check/src/assertions/type_membership.rs index 312f810056..b1590a21f2 100644 --- a/dynamic-check/src/assertions/type_membership.rs +++ b/dynamic-check/src/assertions/type_membership.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::TypeAssertionError; -use leo_static_check::{Type, TypeVariable}; +use leo_symbol_table::{Type, TypeVariable}; use leo_typed::Span; use serde::{Deserialize, Serialize}; diff --git a/dynamic-check/src/assertions/type_variable_pair.rs b/dynamic-check/src/assertions/type_variable_pair.rs index 0cf33318ee..446413f435 100644 --- a/dynamic-check/src/assertions/type_variable_pair.rs +++ b/dynamic-check/src/assertions/type_variable_pair.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::TypeAssertionError; -use leo_static_check::{flatten_array_type, Type, TypeVariable}; +use leo_symbol_table::{flatten_array_type, Type, TypeVariable}; use leo_typed::Span; use std::borrow::Cow; diff --git a/dynamic-check/src/dynamic_check.rs b/dynamic-check/src/dynamic_check.rs index f5aa5f2845..797084ce49 100644 --- a/dynamic-check/src/dynamic_check.rs +++ b/dynamic-check/src/dynamic_check.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{DynamicCheckError, Frame, Scope}; -use leo_static_check::SymbolTable; +use leo_symbol_table::SymbolTable; use leo_typed::{Circuit, CircuitMember, Function, Program}; /// Performs a dynamic type inference check over a program. diff --git a/dynamic-check/src/errors/frame.rs b/dynamic-check/src/errors/frame.rs index 74484ad9f6..14e2914457 100644 --- a/dynamic-check/src/errors/frame.rs +++ b/dynamic-check/src/errors/frame.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{ScopeError, TypeAssertionError}; -use leo_static_check::{Type, TypeError}; +use leo_symbol_table::{Type, TypeError}; use leo_typed::{Error as FormattedError, Expression, Identifier, Span}; use std::path::Path; diff --git a/dynamic-check/src/errors/type_assertion.rs b/dynamic-check/src/errors/type_assertion.rs index 4fad9ffeeb..eca87557ab 100644 --- a/dynamic-check/src/errors/type_assertion.rs +++ b/dynamic-check/src/errors/type_assertion.rs @@ -16,7 +16,7 @@ use crate::TypeMembership; -use leo_static_check::Type; +use leo_symbol_table::Type; use leo_typed::{Error as FormattedError, Span}; use std::path::Path; diff --git a/dynamic-check/src/objects/frame.rs b/dynamic-check/src/objects/frame.rs index 63ab137d83..5ae47b1b44 100644 --- a/dynamic-check/src/objects/frame.rs +++ b/dynamic-check/src/objects/frame.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{FrameError, Scope, TypeAssertion}; -use leo_static_check::{Attribute, CircuitFunctionType, CircuitType, FunctionType, SymbolTable, Type, TypeVariable}; +use leo_symbol_table::{Attribute, CircuitFunctionType, CircuitType, FunctionType, SymbolTable, Type, TypeVariable}; use leo_typed::{ Assignee, AssigneeAccess, diff --git a/dynamic-check/src/objects/scope.rs b/dynamic-check/src/objects/scope.rs index aed1547380..34a0e20c58 100644 --- a/dynamic-check/src/objects/scope.rs +++ b/dynamic-check/src/objects/scope.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{ScopeError, VariableTable}; -use leo_static_check::{FunctionInputType, Type}; +use leo_symbol_table::{FunctionInputType, Type}; /// A structure for tracking the types of defined variables in a block of code. #[derive(Clone, Default)] diff --git a/dynamic-check/src/objects/variable_table.rs b/dynamic-check/src/objects/variable_table.rs index 85f84bae0e..f6060b33a7 100644 --- a/dynamic-check/src/objects/variable_table.rs +++ b/dynamic-check/src/objects/variable_table.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::VariableTableError; -use leo_static_check::{FunctionInputType, Type}; +use leo_symbol_table::{FunctionInputType, Type}; use std::collections::HashMap; /// Mapping of variable names to types diff --git a/dynamic-check/tests/mod.rs b/dynamic-check/tests/mod.rs index d51648c106..9998780b58 100644 --- a/dynamic-check/tests/mod.rs +++ b/dynamic-check/tests/mod.rs @@ -24,7 +24,7 @@ use leo_ast::LeoAst; use leo_dynamic_check::DynamicCheck; use leo_imports::ImportParser; -use leo_static_check::SymbolTable; +use leo_symbol_table::SymbolTable; use leo_typed::{Input, LeoTypedAst, Program}; use std::path::PathBuf; diff --git a/static-check/Cargo.toml b/symbol-table/Cargo.toml similarity index 96% rename from static-check/Cargo.toml rename to symbol-table/Cargo.toml index 0e605147d9..8527bf14e8 100644 --- a/static-check/Cargo.toml +++ b/symbol-table/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "leo-static-check" +name = "leo-symbol-table" version = "1.0.3" authors = [ "The Aleo Team " ] description = "Stores user-defined variables during type resolution" diff --git a/static-check/src/attributes/attribute.rs b/symbol-table/src/attributes/attribute.rs similarity index 100% rename from static-check/src/attributes/attribute.rs rename to symbol-table/src/attributes/attribute.rs diff --git a/static-check/src/attributes/mod.rs b/symbol-table/src/attributes/mod.rs similarity index 100% rename from static-check/src/attributes/mod.rs rename to symbol-table/src/attributes/mod.rs diff --git a/static-check/src/errors/mod.rs b/symbol-table/src/errors/mod.rs similarity index 100% rename from static-check/src/errors/mod.rs rename to symbol-table/src/errors/mod.rs diff --git a/static-check/src/errors/symbol_table.rs b/symbol-table/src/errors/symbol_table.rs similarity index 100% rename from static-check/src/errors/symbol_table.rs rename to symbol-table/src/errors/symbol_table.rs diff --git a/static-check/src/errors/type_.rs b/symbol-table/src/errors/type_.rs similarity index 100% rename from static-check/src/errors/type_.rs rename to symbol-table/src/errors/type_.rs diff --git a/static-check/src/imports/imported_symbols.rs b/symbol-table/src/imports/imported_symbols.rs similarity index 100% rename from static-check/src/imports/imported_symbols.rs rename to symbol-table/src/imports/imported_symbols.rs diff --git a/static-check/src/imports/mod.rs b/symbol-table/src/imports/mod.rs similarity index 100% rename from static-check/src/imports/mod.rs rename to symbol-table/src/imports/mod.rs diff --git a/static-check/src/lib.rs b/symbol-table/src/lib.rs similarity index 100% rename from static-check/src/lib.rs rename to symbol-table/src/lib.rs diff --git a/static-check/src/symbol_table.rs b/symbol-table/src/symbol_table.rs similarity index 100% rename from static-check/src/symbol_table.rs rename to symbol-table/src/symbol_table.rs diff --git a/static-check/src/types/circuits/circuit.rs b/symbol-table/src/types/circuits/circuit.rs similarity index 100% rename from static-check/src/types/circuits/circuit.rs rename to symbol-table/src/types/circuits/circuit.rs diff --git a/static-check/src/types/circuits/circuit_function.rs b/symbol-table/src/types/circuits/circuit_function.rs similarity index 100% rename from static-check/src/types/circuits/circuit_function.rs rename to symbol-table/src/types/circuits/circuit_function.rs diff --git a/static-check/src/types/circuits/circuit_variable.rs b/symbol-table/src/types/circuits/circuit_variable.rs similarity index 100% rename from static-check/src/types/circuits/circuit_variable.rs rename to symbol-table/src/types/circuits/circuit_variable.rs diff --git a/static-check/src/types/circuits/mod.rs b/symbol-table/src/types/circuits/mod.rs similarity index 100% rename from static-check/src/types/circuits/mod.rs rename to symbol-table/src/types/circuits/mod.rs diff --git a/static-check/src/types/functions/function.rs b/symbol-table/src/types/functions/function.rs similarity index 100% rename from static-check/src/types/functions/function.rs rename to symbol-table/src/types/functions/function.rs diff --git a/static-check/src/types/functions/function_input.rs b/symbol-table/src/types/functions/function_input.rs similarity index 100% rename from static-check/src/types/functions/function_input.rs rename to symbol-table/src/types/functions/function_input.rs diff --git a/static-check/src/types/functions/function_input_variable.rs b/symbol-table/src/types/functions/function_input_variable.rs similarity index 100% rename from static-check/src/types/functions/function_input_variable.rs rename to symbol-table/src/types/functions/function_input_variable.rs diff --git a/static-check/src/types/functions/function_output.rs b/symbol-table/src/types/functions/function_output.rs similarity index 100% rename from static-check/src/types/functions/function_output.rs rename to symbol-table/src/types/functions/function_output.rs diff --git a/static-check/src/types/functions/mod.rs b/symbol-table/src/types/functions/mod.rs similarity index 100% rename from static-check/src/types/functions/mod.rs rename to symbol-table/src/types/functions/mod.rs diff --git a/static-check/src/types/mod.rs b/symbol-table/src/types/mod.rs similarity index 100% rename from static-check/src/types/mod.rs rename to symbol-table/src/types/mod.rs diff --git a/static-check/src/types/type_.rs b/symbol-table/src/types/type_.rs similarity index 100% rename from static-check/src/types/type_.rs rename to symbol-table/src/types/type_.rs diff --git a/static-check/src/types/type_variable.rs b/symbol-table/src/types/type_variable.rs similarity index 100% rename from static-check/src/types/type_variable.rs rename to symbol-table/src/types/type_variable.rs diff --git a/static-check/src/types/user_defined/mod.rs b/symbol-table/src/types/user_defined/mod.rs similarity index 100% rename from static-check/src/types/user_defined/mod.rs rename to symbol-table/src/types/user_defined/mod.rs diff --git a/static-check/src/types/user_defined/user_defined_type.rs b/symbol-table/src/types/user_defined/user_defined_type.rs similarity index 100% rename from static-check/src/types/user_defined/user_defined_type.rs rename to symbol-table/src/types/user_defined/user_defined_type.rs diff --git a/static-check/tests/mod.rs b/symbol-table/tests/mod.rs similarity index 100% rename from static-check/tests/mod.rs rename to symbol-table/tests/mod.rs diff --git a/static-check/tests/symbol_table/duplicate_circuit.leo b/symbol-table/tests/symbol_table/duplicate_circuit.leo similarity index 100% rename from static-check/tests/symbol_table/duplicate_circuit.leo rename to symbol-table/tests/symbol_table/duplicate_circuit.leo diff --git a/static-check/tests/symbol_table/duplicate_function.leo b/symbol-table/tests/symbol_table/duplicate_function.leo similarity index 100% rename from static-check/tests/symbol_table/duplicate_function.leo rename to symbol-table/tests/symbol_table/duplicate_function.leo diff --git a/static-check/tests/symbol_table/mod.rs b/symbol-table/tests/symbol_table/mod.rs similarity index 100% rename from static-check/tests/symbol_table/mod.rs rename to symbol-table/tests/symbol_table/mod.rs diff --git a/static-check/tests/symbol_table/self_not_available.leo b/symbol-table/tests/symbol_table/self_not_available.leo similarity index 100% rename from static-check/tests/symbol_table/self_not_available.leo rename to symbol-table/tests/symbol_table/self_not_available.leo diff --git a/static-check/tests/symbol_table/undefined_circuit.leo b/symbol-table/tests/symbol_table/undefined_circuit.leo similarity index 100% rename from static-check/tests/symbol_table/undefined_circuit.leo rename to symbol-table/tests/symbol_table/undefined_circuit.leo