move integer enum and errors into compiler

This commit is contained in:
collin 2020-06-25 14:27:19 -07:00
parent 47ef6be719
commit cc8a3d9878
25 changed files with 39 additions and 41 deletions

1
Cargo.lock generated
View File

@ -554,7 +554,6 @@ dependencies = [
"serde",
"snarkos-errors",
"snarkos-models",
"thiserror",
]
[[package]]

View File

@ -10,13 +10,13 @@ use crate::{
new_scope,
FieldType,
GroupType,
Integer,
};
use leo_types::{
CircuitFieldDefinition,
CircuitMember,
Expression,
Identifier,
Integer,
IntegerType,
RangeOrExpression,
Span,

View File

@ -8,8 +8,9 @@ use crate::{
field_from_input,
group_from_input,
GroupType,
Integer,
};
use leo_types::{Expression, Function, InputValue, Integer, Program, Span, Type};
use leo_types::{Expression, Function, InputValue, Program, Span, Type};
use crate::errors::StatementError;
use snarkos_models::{

View File

@ -1,6 +1,6 @@
//! Conversion of integer declarations to constraints in Leo.
use crate::{errors::IntegerError, InputValue, IntegerType, Span};
use crate::errors::IntegerError;
use leo_types::{InputValue, IntegerType, Span};
use snarkos_errors::gadgets::SynthesisError;
use snarkos_models::{

View File

@ -12,6 +12,9 @@ pub use expression::*;
pub mod import;
pub use import::*;
pub mod integer;
pub use integer::*;
pub(crate) mod field;
pub(crate) use field::*;

View File

@ -5,6 +5,7 @@ use crate::{
errors::StatementError,
new_scope,
GroupType,
Integer,
};
use leo_types::{
Assignee,
@ -13,7 +14,6 @@ use leo_types::{
Declare,
Expression,
Identifier,
Integer,
RangeOrExpression,
Span,
Statement,

View File

@ -8,8 +8,9 @@ use crate::{
new_bool_constant,
FieldType,
GroupType,
Integer,
};
use leo_types::{Circuit, Function, Identifier, Integer, Span, Type};
use leo_types::{Circuit, Function, Identifier, Span, Type};
use snarkos_errors::gadgets::SynthesisError;
use snarkos_models::{

View File

@ -1,5 +1,5 @@
use crate::errors::{BooleanError, FieldError, FunctionError, GroupError, ValueError};
use leo_types::{Error as FormattedError, Identifier, IntegerError, Span};
use crate::errors::{BooleanError, FieldError, FunctionError, GroupError, IntegerError, ValueError};
use leo_types::{Error as FormattedError, Identifier, Span};
use snarkos_errors::gadgets::SynthesisError;
use std::path::PathBuf;

View File

@ -1,5 +1,5 @@
use crate::errors::{BooleanError, ExpressionError, FieldError, GroupError, StatementError, ValueError};
use leo_types::{Error as FormattedError, IntegerError, Span};
use crate::errors::{BooleanError, ExpressionError, FieldError, GroupError, IntegerError, StatementError, ValueError};
use leo_types::{Error as FormattedError, Span};
use std::path::PathBuf;
#[derive(Debug, Error)]

View File

@ -1,4 +1,4 @@
use crate::{error::Error as FormattedError, Span};
use leo_types::{error::Error as FormattedError, Span};
use snarkos_errors::gadgets::SynthesisError;
use std::path::PathBuf;

View File

@ -12,6 +12,9 @@ pub use expression::*;
pub mod import;
pub use import::*;
pub mod integer;
pub use integer::*;
pub mod field;
pub use field::*;

View File

@ -1,5 +1,5 @@
use crate::errors::{BooleanError, ExpressionError, ValueError};
use leo_types::{Error as FormattedError, IntegerError, Span, Type};
use crate::errors::{BooleanError, ExpressionError, IntegerError, ValueError};
use leo_types::{Error as FormattedError, Span, Type};
use std::path::PathBuf;
#[derive(Debug, Error)]

View File

@ -1,5 +1,5 @@
use crate::errors::{BooleanError, FieldError, GroupError};
use leo_types::{Error as FormattedError, IntegerError, Span};
use crate::errors::{BooleanError, FieldError, GroupError, IntegerError};
use leo_types::{Error as FormattedError, Span};
use std::path::PathBuf;
#[derive(Debug, Error)]

View File

@ -9,9 +9,10 @@ use crate::{
use leo_compiler::{
errors::{CompilerError, FunctionError},
ConstrainedValue,
Integer,
};
use leo_inputs::types::{IntegerType, U32Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_models::gadgets::utilities::uint::UInt32;

View File

@ -10,8 +10,9 @@ use leo_compiler::{
errors::{CompilerError, ExpressionError, FunctionError, StatementError},
ConstrainedCircuitMember,
ConstrainedValue,
Integer,
};
use leo_types::{Expression, Function, Identifier, Integer, Span, Statement, Type};
use leo_types::{Expression, Function, Identifier, Span, Statement, Type};
use snarkos_models::gadgets::utilities::uint::UInt32;

View File

@ -2,8 +2,7 @@
pub mod macros;
use crate::{get_error, EdwardsTestCompiler};
use leo_compiler::errors::{CompilerError, FunctionError};
use leo_types::IntegerError;
use leo_compiler::errors::{CompilerError, FunctionError, IntegerError};
pub trait IntegerTester {
/// Tests use of the integer in a function input

View File

@ -7,9 +7,9 @@ use crate::{
EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::ConstrainedValue;
use leo_compiler::{ConstrainedValue, Integer};
use leo_inputs::types::{IntegerType, U128Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{

View File

@ -7,9 +7,9 @@ use crate::{
EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::ConstrainedValue;
use leo_compiler::{ConstrainedValue, Integer};
use leo_inputs::types::{IntegerType, U16Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{

View File

@ -7,9 +7,9 @@ use crate::{
EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::ConstrainedValue;
use leo_compiler::{ConstrainedValue, Integer};
use leo_inputs::types::{IntegerType, U32Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{

View File

@ -7,9 +7,9 @@ use crate::{
EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::ConstrainedValue;
use leo_compiler::{ConstrainedValue, Integer};
use leo_inputs::types::{IntegerType, U64Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{

View File

@ -7,9 +7,9 @@ use crate::{
EdwardsConstrainedValue,
EdwardsTestCompiler,
};
use leo_compiler::ConstrainedValue;
use leo_compiler::{ConstrainedValue, Integer};
use leo_inputs::types::{IntegerType, U8Type};
use leo_types::{InputValue, Integer};
use leo_types::InputValue;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{

View File

@ -2,8 +2,8 @@ use crate::{array::input_value_u32_one, parse_program, EdwardsConstrainedValue,
use leo_compiler::{
errors::{CompilerError, FunctionError, StatementError},
ConstrainedValue,
Integer,
};
use leo_types::Integer;
use snarkos_curves::edwards_bls12::Fq;
use snarkos_models::gadgets::{r1cs::TestConstraintSystem, utilities::uint::UInt32};

View File

@ -13,4 +13,3 @@ snarkos-models = { path = "../../snarkOS/models", version = "0.8.0", default-fe
pest = { version = "2.0" }
serde = { version = "1.0" }
thiserror = { version = "1.0" }

View File

@ -1,5 +1,2 @@
pub mod error;
pub use error::*;
pub mod integer;
pub use integer::*;

View File

@ -1,6 +1,3 @@
#[macro_use]
extern crate thiserror;
pub mod circuits;
pub use circuits::*;
@ -22,9 +19,6 @@ pub use imports::*;
pub mod inputs;
pub use inputs::*;
pub mod integer;
pub use integer::*;
pub mod program;
pub use program::*;