mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-11 16:10:09 +03:00
itemize imports
This commit is contained in:
parent
c9f70800fd
commit
4f50b44a63
@ -10,7 +10,7 @@ use_try_shorthand = true
|
|||||||
# Nightly configurations
|
# Nightly configurations
|
||||||
imports_layout = "HorizontalVertical"
|
imports_layout = "HorizontalVertical"
|
||||||
license_template_path = ".resources/license_header"
|
license_template_path = ".resources/license_header"
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Item"
|
||||||
overflow_delimited_expr = true
|
overflow_delimited_expr = true
|
||||||
reorder_impl_items = true
|
reorder_impl_items = true
|
||||||
version = "Two"
|
version = "Two"
|
||||||
|
@ -14,16 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::statement::*;
|
||||||
statement::*,
|
use crate::BoolAnd;
|
||||||
BoolAnd,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::Monoid;
|
||||||
Monoid,
|
use crate::MonoidalReducerExpression;
|
||||||
MonoidalReducerExpression,
|
use crate::MonoidalReducerStatement;
|
||||||
MonoidalReducerStatement,
|
use crate::Node;
|
||||||
Node,
|
use crate::Span;
|
||||||
Span,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct ReturnPathReducer {
|
pub struct ReturnPathReducer {
|
||||||
pub errors: Vec<(Span, String)>,
|
pub errors: Vec<(Span, String)>,
|
||||||
|
@ -14,10 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, IntegerType, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::IntegerType;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use num_bigint::BigInt;
|
use num_bigint::BigInt;
|
||||||
use std::{convert::TryInto, fmt};
|
use std::convert::TryInto;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
/// Constant integer values in a program.
|
/// Constant integer values in a program.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{cell::Cell, unimplemented};
|
use std::cell::Cell;
|
||||||
|
use std::unimplemented;
|
||||||
|
|
||||||
use typed_arena::Arena;
|
use typed_arena::Arena;
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
//! Errors encountered when attempting to convert to an asg from an ast.
|
//! Errors encountered when attempting to convert to an asg from an ast.
|
||||||
|
|
||||||
use crate::Span;
|
use crate::Span;
|
||||||
use leo_ast::{AstError, Error as FormattedError};
|
use leo_ast::AstError;
|
||||||
|
use leo_ast::Error as FormattedError;
|
||||||
use leo_grammar::ParserError;
|
use leo_grammar::ParserError;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_ast::IntegerType;
|
use leo_ast::IntegerType;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_ast::SpreadOrExpression;
|
use leo_ast::SpreadOrExpression;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_ast::IntegerType;
|
use leo_ast::IntegerType;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -14,8 +14,18 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
pub use leo_ast::{BinaryOperation, BinaryOperationClass};
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
pub use leo_ast::BinaryOperation;
|
||||||
|
pub use leo_ast::BinaryOperationClass;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,22 +14,21 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::CircuitMember;
|
||||||
CircuitMember,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Function;
|
||||||
Function,
|
use crate::FunctionQualifier;
|
||||||
FunctionQualifier,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Type;
|
||||||
Type,
|
pub use leo_ast::BinaryOperation;
|
||||||
};
|
pub use leo_ast::Node as AstNode;
|
||||||
pub use leo_ast::{BinaryOperation, Node as AstNode};
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,21 +14,19 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::Circuit;
|
||||||
Circuit,
|
use crate::CircuitMember;
|
||||||
CircuitMember,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Type;
|
||||||
Type,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,23 +14,22 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::Circuit;
|
||||||
Circuit,
|
use crate::CircuitMember;
|
||||||
CircuitMember,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Type;
|
||||||
Type,
|
|
||||||
};
|
|
||||||
|
|
||||||
use indexmap::{IndexMap, IndexSet};
|
use indexmap::IndexMap;
|
||||||
|
use indexmap::IndexSet;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -14,20 +14,18 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::ConstInt;
|
||||||
ConstInt,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::GroupValue;
|
||||||
GroupValue,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Type;
|
||||||
Type,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -62,7 +62,14 @@ pub use unary::*;
|
|||||||
mod variable_ref;
|
mod variable_ref;
|
||||||
pub use variable_ref::*;
|
pub use variable_ref::*;
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum Expression<'a> {
|
pub enum Expression<'a> {
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::ConstValue;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::ExpressionNode;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
pub use leo_ast::UnaryOperation;
|
pub use leo_ast::UnaryOperation;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -14,22 +14,20 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Constant;
|
||||||
Constant,
|
use crate::DefinitionStatement;
|
||||||
DefinitionStatement,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Type;
|
||||||
Type,
|
use crate::Variable;
|
||||||
Variable,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use crate::{AsgContext, AsgConvertError, Program, Span};
|
use crate::AsgContext;
|
||||||
|
use crate::AsgConvertError;
|
||||||
|
use crate::Program;
|
||||||
|
use crate::Span;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,7 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Circuit, CircuitMember, Identifier, Scope, Type, Variable};
|
use crate::Circuit;
|
||||||
|
use crate::CircuitMember;
|
||||||
|
use crate::Identifier;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Type;
|
||||||
|
use crate::Variable;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -74,7 +74,9 @@ pub use pass::*;
|
|||||||
pub mod context;
|
pub mod context;
|
||||||
pub use context::*;
|
pub use context::*;
|
||||||
|
|
||||||
pub use leo_ast::{Ast, Identifier, Span};
|
pub use leo_ast::Ast;
|
||||||
|
pub use leo_ast::Identifier;
|
||||||
|
pub use leo_ast::Span;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
@ -14,18 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgContextInner;
|
||||||
AsgContextInner,
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::Circuit;
|
||||||
Circuit,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::Function;
|
||||||
Function,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Variable;
|
||||||
Variable,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// A node in the abstract semantic graph.
|
/// A node in the abstract semantic graph.
|
||||||
pub trait Node {
|
pub trait Node {
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
// TODO (protryon): We should merge this with core
|
// TODO (protryon): We should merge this with core
|
||||||
|
|
||||||
use crate::{AsgContext, AsgConvertError, Program};
|
use crate::AsgContext;
|
||||||
|
use crate::AsgConvertError;
|
||||||
|
use crate::Program;
|
||||||
|
|
||||||
// TODO (protryon): Make asg deep copy so we can cache resolved core modules
|
// TODO (protryon): Make asg deep copy so we can cache resolved core modules
|
||||||
// TODO (protryon): Figure out how to do headers without bogus returns
|
// TODO (protryon): Figure out how to do headers without bogus returns
|
||||||
|
@ -14,7 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, Function, Identifier, Node, Scope, Span, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::Function;
|
||||||
|
use crate::Identifier;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -14,24 +14,23 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::BlockStatement;
|
||||||
BlockStatement,
|
use crate::Circuit;
|
||||||
Circuit,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::MonoidalDirector;
|
||||||
MonoidalDirector,
|
use crate::ReturnPathReducer;
|
||||||
ReturnPathReducer,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Type;
|
||||||
Type,
|
use crate::Variable;
|
||||||
Variable,
|
|
||||||
};
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use leo_ast::FunctionInput;
|
use leo_ast::FunctionInput;
|
||||||
|
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::Cell;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq)]
|
#[derive(Clone, Copy, PartialEq)]
|
||||||
pub enum FunctionQualifier {
|
pub enum FunctionQualifier {
|
||||||
|
@ -24,11 +24,20 @@ pub use circuit::*;
|
|||||||
mod function;
|
mod function;
|
||||||
pub use function::*;
|
pub use function::*;
|
||||||
|
|
||||||
use crate::{ArenaNode, AsgContext, AsgConvertError, ImportResolver, Input, Scope};
|
use crate::ArenaNode;
|
||||||
use leo_ast::{Identifier, PackageAccess, PackageOrPackages, Span};
|
use crate::AsgContext;
|
||||||
|
use crate::AsgConvertError;
|
||||||
|
use crate::ImportResolver;
|
||||||
|
use crate::Input;
|
||||||
|
use crate::Scope;
|
||||||
|
use leo_ast::Identifier;
|
||||||
|
use leo_ast::PackageAccess;
|
||||||
|
use leo_ast::PackageOrPackages;
|
||||||
|
use leo_ast::Span;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::Cell;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
/// Stores the Leo program abstract semantic graph (ASG).
|
/// Stores the Leo program abstract semantic graph (ASG).
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{expression::*, program::*, statement::*};
|
use crate::expression::*;
|
||||||
|
use crate::program::*;
|
||||||
|
use crate::statement::*;
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{expression::*, program::*, statement::*, Monoid};
|
use crate::expression::*;
|
||||||
|
use crate::program::*;
|
||||||
|
use crate::statement::*;
|
||||||
|
use crate::Monoid;
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
pub trait MonoidalReducerExpression<'a, T: Monoid> {
|
pub trait MonoidalReducerExpression<'a, T: Monoid> {
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
use crate::{expression::*, program::*, statement::*};
|
use crate::expression::*;
|
||||||
|
use crate::program::*;
|
||||||
|
use crate::statement::*;
|
||||||
|
|
||||||
pub enum VisitResult {
|
pub enum VisitResult {
|
||||||
VisitChildren,
|
VisitChildren,
|
||||||
|
@ -15,9 +15,12 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{expression::*, program::*, statement::*};
|
use crate::expression::*;
|
||||||
|
use crate::program::*;
|
||||||
|
use crate::statement::*;
|
||||||
|
|
||||||
use std::{cell::Cell, marker::PhantomData};
|
use std::cell::Cell;
|
||||||
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
pub struct VisitorDirector<'a, R: ExpressionVisitor<'a>> {
|
pub struct VisitorDirector<'a, R: ExpressionVisitor<'a>> {
|
||||||
visitor: R,
|
visitor: R,
|
||||||
|
@ -14,10 +14,20 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ArenaNode, AsgContext, AsgConvertError, Circuit, Expression, Function, Input, Statement, Type, Variable};
|
use crate::ArenaNode;
|
||||||
|
use crate::AsgContext;
|
||||||
|
use crate::AsgConvertError;
|
||||||
|
use crate::Circuit;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::Function;
|
||||||
|
use crate::Input;
|
||||||
|
use crate::Statement;
|
||||||
|
use crate::Type;
|
||||||
|
use crate::Variable;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::Cell;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
/// An abstract data type that track the current bindings for variables, functions, and circuits.
|
/// An abstract data type that track the current bindings for variables, functions, and circuits.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -14,24 +14,22 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::CircuitMember;
|
||||||
CircuitMember,
|
use crate::ConstInt;
|
||||||
ConstInt,
|
use crate::ConstValue;
|
||||||
ConstValue,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::IntegerType;
|
||||||
IntegerType,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Type;
|
||||||
Type,
|
use crate::Variable;
|
||||||
Variable,
|
|
||||||
};
|
|
||||||
pub use leo_ast::AssignOperation;
|
pub use leo_ast::AssignOperation;
|
||||||
use leo_ast::AssigneeAccess as AstAssigneeAccess;
|
use leo_ast::AssigneeAccess as AstAssigneeAccess;
|
||||||
|
|
||||||
|
@ -14,7 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, FromAst, Node, PartialType, Scope, Span, Statement};
|
use crate::AsgConvertError;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, BlockStatement, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::BlockStatement;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -14,7 +14,15 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
use crate::Type;
|
||||||
use leo_ast::ConsoleFunction as AstConsoleFunction;
|
use leo_ast::ConsoleFunction as AstConsoleFunction;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -14,23 +14,23 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::InnerVariable;
|
||||||
InnerVariable,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Type;
|
||||||
Type,
|
use crate::Variable;
|
||||||
Variable,
|
use leo_ast::AstError;
|
||||||
};
|
use leo_ast::DeprecatedError;
|
||||||
use leo_ast::{AstError, DeprecatedError};
|
|
||||||
|
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::Cell;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct DefinitionStatement<'a> {
|
pub struct DefinitionStatement<'a> {
|
||||||
|
@ -14,7 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, Expression, FromAst, Node, PartialType, Scope, Span, Statement};
|
use crate::AsgConvertError;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -16,21 +16,20 @@
|
|||||||
|
|
||||||
use leo_ast::IntegerType;
|
use leo_ast::IntegerType;
|
||||||
|
|
||||||
use crate::{
|
use crate::AsgConvertError;
|
||||||
AsgConvertError,
|
use crate::Expression;
|
||||||
Expression,
|
use crate::ExpressionNode;
|
||||||
ExpressionNode,
|
use crate::FromAst;
|
||||||
FromAst,
|
use crate::InnerVariable;
|
||||||
InnerVariable,
|
use crate::Node;
|
||||||
Node,
|
use crate::PartialType;
|
||||||
PartialType,
|
use crate::Scope;
|
||||||
Scope,
|
use crate::Span;
|
||||||
Span,
|
use crate::Statement;
|
||||||
Statement,
|
use crate::Variable;
|
||||||
Variable,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::Cell;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct IterationStatement<'a> {
|
pub struct IterationStatement<'a> {
|
||||||
|
@ -42,7 +42,12 @@ pub use iteration::*;
|
|||||||
mod return_;
|
mod return_;
|
||||||
pub use return_::*;
|
pub use return_::*;
|
||||||
|
|
||||||
use crate::{AsgConvertError, FromAst, Node, PartialType, Scope, Span};
|
use crate::AsgConvertError;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum Statement<'a> {
|
pub enum Statement<'a> {
|
||||||
|
@ -14,7 +14,15 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{AsgConvertError, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type};
|
use crate::AsgConvertError;
|
||||||
|
use crate::Expression;
|
||||||
|
use crate::FromAst;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::PartialType;
|
||||||
|
use crate::Scope;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
use crate::{Expression, Statement, Type};
|
use crate::Expression;
|
||||||
|
use crate::Statement;
|
||||||
|
use crate::Type;
|
||||||
use leo_ast::Identifier;
|
use leo_ast::Identifier;
|
||||||
|
|
||||||
/// Specifies how a program variable was declared.
|
/// Specifies how a program variable was declared.
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{load_asg, make_test_context};
|
use crate::load_asg;
|
||||||
|
use crate::make_test_context;
|
||||||
use leo_ast::Ast;
|
use leo_ast::Ast;
|
||||||
use leo_grammar::Grammar;
|
use leo_grammar::Grammar;
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{load_asg, load_asg_imports, make_test_context, mocked_resolver};
|
use crate::load_asg;
|
||||||
|
use crate::load_asg_imports;
|
||||||
|
use crate::make_test_context;
|
||||||
|
use crate::mocked_resolver;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_basic() {
|
fn test_basic() {
|
||||||
|
@ -17,8 +17,11 @@
|
|||||||
use leo_ast::Ast;
|
use leo_ast::Ast;
|
||||||
use leo_grammar::Grammar;
|
use leo_grammar::Grammar;
|
||||||
|
|
||||||
use criterion::{criterion_group, criterion_main, Criterion};
|
use criterion::criterion_group;
|
||||||
use std::{path::Path, time::Duration};
|
use criterion::criterion_main;
|
||||||
|
use criterion::Criterion;
|
||||||
|
use std::path::Path;
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
fn ast(ast: &Grammar) -> Ast {
|
fn ast(ast: &Grammar) -> Ast {
|
||||||
Ast::new("leo_tree", &ast).unwrap()
|
Ast::new("leo_tree", &ast).unwrap()
|
||||||
|
@ -14,11 +14,18 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Circuit, DeprecatedError, Function, FunctionInput, Identifier, ImportStatement, TestFunction};
|
use crate::Circuit;
|
||||||
use leo_grammar::{
|
use crate::DeprecatedError;
|
||||||
annotations::{Annotation, AnnotationArguments, AnnotationName},
|
use crate::Function;
|
||||||
definitions::{AnnotatedDefinition, Definition},
|
use crate::FunctionInput;
|
||||||
};
|
use crate::Identifier;
|
||||||
|
use crate::ImportStatement;
|
||||||
|
use crate::TestFunction;
|
||||||
|
use leo_grammar::annotations::Annotation;
|
||||||
|
use leo_grammar::annotations::AnnotationArguments;
|
||||||
|
use leo_grammar::annotations::AnnotationName;
|
||||||
|
use leo_grammar::definitions::AnnotatedDefinition;
|
||||||
|
use leo_grammar::definitions::Definition;
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{CircuitMember, Identifier};
|
use crate::CircuitMember;
|
||||||
|
use crate::Identifier;
|
||||||
use leo_grammar::circuits::Circuit as GrammarCircuit;
|
use leo_grammar::circuits::Circuit as GrammarCircuit;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Identifier};
|
use crate::Expression;
|
||||||
|
use crate::Identifier;
|
||||||
use leo_grammar::circuits::CircuitImpliedVariable;
|
use leo_grammar::circuits::CircuitImpliedVariable;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct CircuitImpliedVariableDefinition {
|
pub struct CircuitImpliedVariableDefinition {
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Function, Identifier, Type};
|
use crate::Function;
|
||||||
use leo_grammar::{
|
use crate::Identifier;
|
||||||
circuits::{CircuitMember as GrammarCircuitMember, CircuitVariableDefinition as GrammarCircuitVariableDefinition},
|
use crate::Type;
|
||||||
functions::Function as GrammarFunction,
|
use leo_grammar::circuits::CircuitMember as GrammarCircuitMember;
|
||||||
};
|
use leo_grammar::circuits::CircuitVariableDefinition as GrammarCircuitVariableDefinition;
|
||||||
|
use leo_grammar::functions::Function as GrammarFunction;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Identifier};
|
use crate::Expression;
|
||||||
|
use crate::Identifier;
|
||||||
use leo_grammar::circuits::CircuitVariable;
|
use leo_grammar::circuits::CircuitVariable;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct CircuitVariableDefinition {
|
pub struct CircuitVariableDefinition {
|
||||||
|
@ -18,7 +18,8 @@ use crate::PositiveNumber;
|
|||||||
use leo_grammar::types::ArrayDimensions as GrammarArrayDimensions;
|
use leo_grammar::types::ArrayDimensions as GrammarArrayDimensions;
|
||||||
use leo_input::types::ArrayDimensions as InputArrayDimensions;
|
use leo_input::types::ArrayDimensions as InputArrayDimensions;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// A vector of positive numbers that represent array dimensions.
|
/// A vector of positive numbers that represent array dimensions.
|
||||||
|
@ -14,36 +14,33 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputKeyword, MutSelfKeyword, SelfKeyword, Span};
|
use crate::InputKeyword;
|
||||||
use leo_grammar::{
|
use crate::MutSelfKeyword;
|
||||||
annotations::AnnotationArgument,
|
use crate::SelfKeyword;
|
||||||
common::{
|
use crate::Span;
|
||||||
Identifier as GrammarIdentifier,
|
use leo_grammar::annotations::AnnotationArgument;
|
||||||
KeywordOrIdentifier,
|
use leo_grammar::common::Identifier as GrammarIdentifier;
|
||||||
MutSelfKeyword as GrammarMutSelfKeyword,
|
use leo_grammar::common::KeywordOrIdentifier;
|
||||||
SelfKeyword as GrammarSelfKeyword,
|
use leo_grammar::common::MutSelfKeyword as GrammarMutSelfKeyword;
|
||||||
SelfKeywordOrIdentifier,
|
use leo_grammar::common::SelfKeyword as GrammarSelfKeyword;
|
||||||
},
|
use leo_grammar::common::SelfKeywordOrIdentifier;
|
||||||
expressions::CircuitName,
|
use leo_grammar::expressions::CircuitName;
|
||||||
functions::InputKeyword as GrammarInputKeyword,
|
use leo_grammar::functions::InputKeyword as GrammarInputKeyword;
|
||||||
imports::PackageName as GrammarPackageName,
|
use leo_grammar::imports::PackageName as GrammarPackageName;
|
||||||
types::SelfType,
|
use leo_grammar::types::SelfType;
|
||||||
};
|
|
||||||
use leo_input::common::Identifier as InputIdentifier;
|
use leo_input::common::Identifier as InputIdentifier;
|
||||||
|
|
||||||
use crate::Node;
|
use crate::Node;
|
||||||
use serde::{
|
use serde::de::Visitor;
|
||||||
de::{self, Visitor},
|
use serde::de::{self};
|
||||||
Deserialize,
|
use serde::Deserialize;
|
||||||
Deserializer,
|
use serde::Deserializer;
|
||||||
Serialize,
|
use serde::Serialize;
|
||||||
Serializer,
|
use serde::Serializer;
|
||||||
};
|
use std::collections::BTreeMap;
|
||||||
use std::{
|
use std::fmt;
|
||||||
collections::BTreeMap,
|
use std::hash::Hash;
|
||||||
fmt,
|
use std::hash::Hasher;
|
||||||
hash::{Hash, Hasher},
|
|
||||||
};
|
|
||||||
|
|
||||||
/// An identifier in the constrained program.
|
/// An identifier in the constrained program.
|
||||||
///
|
///
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Node, Span};
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::functions::InputKeyword as GrammarInputKeyword;
|
use leo_grammar::functions::InputKeyword as GrammarInputKeyword;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// The `input` keyword can view program register, record, and state values.
|
/// The `input` keyword can view program register, record, and state values.
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Node, Span};
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::common::MutSelfKeyword as GrammarMutSelfKeyword;
|
use leo_grammar::common::MutSelfKeyword as GrammarMutSelfKeyword;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// The `mut self` keyword can view and modify circuit values inside of a circuit function.
|
/// The `mut self` keyword can view and modify circuit values inside of a circuit function.
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
use leo_grammar::values::PositiveNumber as GrammarPositiveNumber;
|
use leo_grammar::values::PositiveNumber as GrammarPositiveNumber;
|
||||||
use leo_input::values::PositiveNumber as InputPositiveNumber;
|
use leo_input::values::PositiveNumber as InputPositiveNumber;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// A number string guaranteed to be positive by the pest grammar.
|
/// A number string guaranteed to be positive by the pest grammar.
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Node, Span};
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::common::SelfKeyword as GrammarSelfKeyword;
|
use leo_grammar::common::SelfKeyword as GrammarSelfKeyword;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// The `self` keyword can view circuit values inside of a circuit function.
|
/// The `self` keyword can view circuit values inside of a circuit function.
|
||||||
|
@ -15,8 +15,10 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use pest::Span as GrammarSpan;
|
use pest::Span as GrammarSpan;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
use std::hash::{Hash, Hasher};
|
use serde::Serialize;
|
||||||
|
use std::hash::Hash;
|
||||||
|
use std::hash::Hasher;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
pub struct Span {
|
pub struct Span {
|
||||||
|
@ -14,13 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Node, Span};
|
use crate::Expression;
|
||||||
use leo_grammar::{
|
use crate::Node;
|
||||||
common::SpreadOrExpression as GrammarSpreadOrExpression,
|
use crate::Span;
|
||||||
expressions::Expression as GrammarExpression,
|
use leo_grammar::common::SpreadOrExpression as GrammarSpreadOrExpression;
|
||||||
};
|
use leo_grammar::expressions::Expression as GrammarExpression;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Spread or expression
|
/// Spread or expression
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Error as FormattedError, Span};
|
use crate::Error as FormattedError;
|
||||||
use leo_grammar::{annotations::AnnotationName, definitions::Deprecated};
|
use crate::Span;
|
||||||
|
use leo_grammar::annotations::AnnotationName;
|
||||||
|
use leo_grammar::definitions::Deprecated;
|
||||||
|
|
||||||
use std::{convert::TryFrom, path::Path};
|
use std::convert::TryFrom;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum DeprecatedError {
|
pub enum DeprecatedError {
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
use crate::Span;
|
use crate::Span;
|
||||||
|
|
||||||
use std::{fmt, path::Path};
|
use std::fmt;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
pub const INDENT: &str = " ";
|
pub const INDENT: &str = " ";
|
||||||
|
|
||||||
|
@ -14,44 +14,43 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::ArrayDimensions;
|
||||||
ArrayDimensions,
|
use crate::CircuitImpliedVariableDefinition;
|
||||||
CircuitImpliedVariableDefinition,
|
use crate::GroupValue;
|
||||||
GroupValue,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::IntegerType;
|
||||||
IntegerType,
|
use crate::PositiveNumber;
|
||||||
PositiveNumber,
|
use crate::Span;
|
||||||
Span,
|
use crate::SpreadOrExpression;
|
||||||
SpreadOrExpression,
|
use leo_grammar::access::Access;
|
||||||
};
|
use leo_grammar::access::AssigneeAccess;
|
||||||
use leo_grammar::{
|
use leo_grammar::access::SelfAccess;
|
||||||
access::{Access, AssigneeAccess, SelfAccess},
|
use leo_grammar::common::Assignee;
|
||||||
common::{Assignee, Identifier as GrammarIdentifier, RangeOrExpression as GrammarRangeOrExpression},
|
use leo_grammar::common::Identifier as GrammarIdentifier;
|
||||||
expressions::{
|
use leo_grammar::common::RangeOrExpression as GrammarRangeOrExpression;
|
||||||
ArrayInitializerExpression,
|
use leo_grammar::expressions::ArrayInitializerExpression;
|
||||||
ArrayInlineExpression as GrammarArrayInlineExpression,
|
use leo_grammar::expressions::ArrayInlineExpression as GrammarArrayInlineExpression;
|
||||||
BinaryExpression as GrammarBinaryExpression,
|
use leo_grammar::expressions::BinaryExpression as GrammarBinaryExpression;
|
||||||
CircuitInlineExpression,
|
use leo_grammar::expressions::CircuitInlineExpression;
|
||||||
Expression as GrammarExpression,
|
use leo_grammar::expressions::Expression as GrammarExpression;
|
||||||
PostfixExpression,
|
use leo_grammar::expressions::PostfixExpression;
|
||||||
SelfPostfixExpression,
|
use leo_grammar::expressions::SelfPostfixExpression;
|
||||||
TernaryExpression as GrammarTernaryExpression,
|
use leo_grammar::expressions::TernaryExpression as GrammarTernaryExpression;
|
||||||
UnaryExpression as GrammarUnaryExpression,
|
use leo_grammar::expressions::UnaryExpression as GrammarUnaryExpression;
|
||||||
},
|
use leo_grammar::operations::BinaryOperation as GrammarBinaryOperation;
|
||||||
operations::{BinaryOperation as GrammarBinaryOperation, UnaryOperation as GrammarUnaryOperation},
|
use leo_grammar::operations::UnaryOperation as GrammarUnaryOperation;
|
||||||
values::{
|
use leo_grammar::values::AddressValue;
|
||||||
AddressValue,
|
use leo_grammar::values::BooleanValue;
|
||||||
BooleanValue,
|
use leo_grammar::values::FieldValue;
|
||||||
FieldValue,
|
use leo_grammar::values::GroupValue as GrammarGroupValue;
|
||||||
GroupValue as GrammarGroupValue,
|
use leo_grammar::values::IntegerValue;
|
||||||
IntegerValue,
|
use leo_grammar::values::NumberValue as GrammarNumber;
|
||||||
NumberValue as GrammarNumber,
|
use leo_grammar::values::Value;
|
||||||
Value,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
use leo_grammar::{access::TupleAccess, expressions::TupleExpression};
|
use leo_grammar::access::TupleAccess;
|
||||||
use serde::{Deserialize, Serialize};
|
use leo_grammar::expressions::TupleExpression;
|
||||||
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use crate::Node;
|
use crate::Node;
|
||||||
|
@ -14,10 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Block, FunctionInput, Identifier, Node, Span, Type};
|
use crate::Block;
|
||||||
|
use crate::FunctionInput;
|
||||||
|
use crate::Identifier;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_grammar::functions::Function as GrammarFunction;
|
use leo_grammar::functions::Function as GrammarFunction;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Identifier, Node, Span, Type};
|
use crate::Identifier;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_grammar::functions::FunctionInput as GrammarFunctionInput;
|
use leo_grammar::functions::FunctionInput as GrammarFunctionInput;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{FunctionInputVariable, InputKeyword, MutSelfKeyword, Node, SelfKeyword, Span};
|
use crate::FunctionInputVariable;
|
||||||
|
use crate::InputKeyword;
|
||||||
|
use crate::MutSelfKeyword;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::SelfKeyword;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::functions::input::Input as GrammarInput;
|
use leo_grammar::functions::input::Input as GrammarInput;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Enumerates the possible inputs to a function.
|
/// Enumerates the possible inputs to a function.
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Function, Identifier};
|
use crate::Function;
|
||||||
|
use crate::Identifier;
|
||||||
use leo_grammar::functions::TestFunction as GrammarTestFunction;
|
use leo_grammar::functions::TestFunction as GrammarTestFunction;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct TestFunction {
|
pub struct TestFunction {
|
||||||
|
@ -15,22 +15,19 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::common::span::Span;
|
use crate::common::span::Span;
|
||||||
use leo_grammar::values::{
|
use leo_grammar::values::GroupCoordinate as GrammarGroupCoordinate;
|
||||||
GroupCoordinate as GrammarGroupCoordinate,
|
use leo_grammar::values::Inferred as GrammarInferred;
|
||||||
Inferred as GrammarInferred,
|
use leo_grammar::values::NumberValue as GrammarNumberValue;
|
||||||
NumberValue as GrammarNumberValue,
|
use leo_grammar::values::SignHigh as GrammarSignHigh;
|
||||||
SignHigh as GrammarSignHigh,
|
use leo_grammar::values::SignLow as GrammarSignLow;
|
||||||
SignLow as GrammarSignLow,
|
use leo_input::values::GroupCoordinate as InputGroupCoordinate;
|
||||||
};
|
use leo_input::values::Inferred as InputInferred;
|
||||||
use leo_input::values::{
|
use leo_input::values::NumberValue as InputNumberValue;
|
||||||
GroupCoordinate as InputGroupCoordinate,
|
use leo_input::values::SignHigh as InputSignHigh;
|
||||||
Inferred as InputInferred,
|
use leo_input::values::SignLow as InputSignLow;
|
||||||
NumberValue as InputNumberValue,
|
|
||||||
SignHigh as InputSignHigh,
|
|
||||||
SignLow as InputSignLow,
|
|
||||||
};
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,19 +14,17 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{common::span::Span, groups::GroupCoordinate};
|
use crate::common::span::Span;
|
||||||
use leo_grammar::values::{
|
use crate::groups::GroupCoordinate;
|
||||||
GroupRepresentation as GrammarGroupRepresentation,
|
use leo_grammar::values::GroupRepresentation as GrammarGroupRepresentation;
|
||||||
GroupTuple as GrammarGroupTuple,
|
use leo_grammar::values::GroupTuple as GrammarGroupTuple;
|
||||||
GroupValue as GrammarGroupValue,
|
use leo_grammar::values::GroupValue as GrammarGroupValue;
|
||||||
};
|
use leo_input::values::GroupRepresentation as InputGroupRepresentation;
|
||||||
use leo_input::values::{
|
use leo_input::values::GroupTuple as InputGroupTuple;
|
||||||
GroupRepresentation as InputGroupRepresentation,
|
use leo_input::values::GroupValue as InputGroupValue;
|
||||||
GroupTuple as InputGroupTuple,
|
|
||||||
GroupValue as InputGroupValue,
|
|
||||||
};
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{PackageOrPackages, Span};
|
use crate::PackageOrPackages;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::imports::Import as GrammarImport;
|
use leo_grammar::imports::Import as GrammarImport;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Represents an import statement in a Leo program.
|
/// Represents an import statement in a Leo program.
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Identifier, Span};
|
use crate::Identifier;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::imports::ImportSymbol as GrammarImportSymbol;
|
use leo_grammar::imports::ImportSymbol as GrammarImportSymbol;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{common::Identifier, PackageAccess, Span};
|
use crate::common::Identifier;
|
||||||
|
use crate::PackageAccess;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::imports::Package as GrammarPackage;
|
use leo_grammar::imports::Package as GrammarPackage;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ImportSymbol, Package, Packages, Span};
|
use crate::ImportSymbol;
|
||||||
|
use crate::Package;
|
||||||
|
use crate::Packages;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::imports::PackageAccess as GrammarPackageAccess;
|
use leo_grammar::imports::PackageAccess as GrammarPackageAccess;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Package, Packages};
|
use crate::Package;
|
||||||
|
use crate::Packages;
|
||||||
use leo_grammar::imports::PackageOrPackages as GrammarPackageOrPackages;
|
use leo_grammar::imports::PackageOrPackages as GrammarPackageOrPackages;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{common::Identifier, PackageAccess, Span};
|
use crate::common::Identifier;
|
||||||
|
use crate::PackageAccess;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::imports::Packages as GrammarPackages;
|
use leo_grammar::imports::Packages as GrammarPackages;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -14,11 +14,17 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, MainInput, ProgramInput, ProgramState, Record, Registers, State, StateLeaf};
|
use crate::InputValue;
|
||||||
use leo_input::{
|
use crate::MainInput;
|
||||||
files::{File, TableOrSection},
|
use crate::ProgramInput;
|
||||||
InputParserError,
|
use crate::ProgramState;
|
||||||
};
|
use crate::Record;
|
||||||
|
use crate::Registers;
|
||||||
|
use crate::State;
|
||||||
|
use crate::StateLeaf;
|
||||||
|
use leo_input::files::File;
|
||||||
|
use leo_input::files::TableOrSection;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
pub struct Input {
|
pub struct Input {
|
||||||
|
@ -14,13 +14,25 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ArrayDimensions, GroupValue};
|
use crate::ArrayDimensions;
|
||||||
use leo_input::{
|
use crate::GroupValue;
|
||||||
errors::InputParserError,
|
use leo_input::errors::InputParserError;
|
||||||
expressions::{ArrayInitializerExpression, ArrayInlineExpression, Expression, TupleExpression},
|
use leo_input::expressions::ArrayInitializerExpression;
|
||||||
types::{ArrayType, DataType, IntegerType, TupleType, Type},
|
use leo_input::expressions::ArrayInlineExpression;
|
||||||
values::{Address, AddressValue, BooleanValue, FieldValue, GroupValue as InputGroupValue, NumberValue, Value},
|
use leo_input::expressions::Expression;
|
||||||
};
|
use leo_input::expressions::TupleExpression;
|
||||||
|
use leo_input::types::ArrayType;
|
||||||
|
use leo_input::types::DataType;
|
||||||
|
use leo_input::types::IntegerType;
|
||||||
|
use leo_input::types::TupleType;
|
||||||
|
use leo_input::types::Type;
|
||||||
|
use leo_input::values::Address;
|
||||||
|
use leo_input::values::AddressValue;
|
||||||
|
use leo_input::values::BooleanValue;
|
||||||
|
use leo_input::values::FieldValue;
|
||||||
|
use leo_input::values::GroupValue as InputGroupValue;
|
||||||
|
use leo_input::values::NumberValue;
|
||||||
|
use leo_input::values::Value;
|
||||||
use pest::Span;
|
use pest::Span;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Identifier, Span, Type};
|
use crate::Identifier;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
use leo_input::parameters::Parameter as GrammarParameter;
|
use leo_input::parameters::Parameter as GrammarParameter;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Hash)]
|
#[derive(Clone, PartialEq, Eq, Hash)]
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::InputValue;
|
use crate::InputValue;
|
||||||
use leo_input::{definitions::Definition, InputParserError};
|
use leo_input::definitions::Definition;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,11 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, MainInput, Registers};
|
use crate::InputValue;
|
||||||
use leo_input::{
|
use crate::MainInput;
|
||||||
sections::{Header, Section},
|
use crate::Registers;
|
||||||
InputParserError,
|
use leo_input::sections::Header;
|
||||||
};
|
use leo_input::sections::Section;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Default)]
|
#[derive(Clone, PartialEq, Eq, Default)]
|
||||||
pub struct ProgramInput {
|
pub struct ProgramInput {
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, Parameter};
|
use crate::InputValue;
|
||||||
use leo_input::{definitions::Definition, InputParserError};
|
use crate::Parameter;
|
||||||
|
use leo_input::definitions::Definition;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Record, StateLeaf};
|
use crate::Record;
|
||||||
use leo_input::{
|
use crate::StateLeaf;
|
||||||
sections::{Header, Section},
|
use leo_input::sections::Header;
|
||||||
InputParserError,
|
use leo_input::sections::Section;
|
||||||
};
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Default)]
|
#[derive(Clone, PartialEq, Eq, Default)]
|
||||||
pub struct PrivateState {
|
pub struct PrivateState {
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, Parameter};
|
use crate::InputValue;
|
||||||
use leo_input::{definitions::Definition, InputParserError};
|
use crate::Parameter;
|
||||||
|
use leo_input::definitions::Definition;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, Parameter};
|
use crate::InputValue;
|
||||||
use leo_input::{definitions::Definition, InputParserError};
|
use crate::Parameter;
|
||||||
|
use leo_input::definitions::Definition;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,11 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{PrivateState, PublicState, Record, State, StateLeaf};
|
use crate::PrivateState;
|
||||||
use leo_input::{
|
use crate::PublicState;
|
||||||
tables::{Table, Visibility},
|
use crate::Record;
|
||||||
InputParserError,
|
use crate::State;
|
||||||
};
|
use crate::StateLeaf;
|
||||||
|
use leo_input::tables::Table;
|
||||||
|
use leo_input::tables::Visibility;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Default)]
|
#[derive(Clone, PartialEq, Eq, Default)]
|
||||||
pub struct ProgramState {
|
pub struct ProgramState {
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::State;
|
use crate::State;
|
||||||
use leo_input::{
|
use leo_input::sections::Header;
|
||||||
sections::{Header, Section},
|
use leo_input::sections::Section;
|
||||||
InputParserError,
|
use leo_input::InputParserError;
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Default)]
|
#[derive(Clone, PartialEq, Eq, Default)]
|
||||||
pub struct PublicState {
|
pub struct PublicState {
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{InputValue, Parameter};
|
use crate::InputValue;
|
||||||
use leo_input::{definitions::Definition, InputParserError};
|
use crate::Parameter;
|
||||||
|
use leo_input::definitions::Definition;
|
||||||
|
use leo_input::InputParserError;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
|
@ -14,9 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use leo_ast::{Ast, AstError};
|
use leo_ast::Ast;
|
||||||
|
use leo_ast::AstError;
|
||||||
use leo_grammar::Grammar;
|
use leo_grammar::Grammar;
|
||||||
use std::{env, fs, path::Path};
|
use std::env;
|
||||||
|
use std::fs;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
fn to_leo_tree(filepath: &Path) -> Result<String, AstError> {
|
fn to_leo_tree(filepath: &Path) -> Result<String, AstError> {
|
||||||
// Loads the Leo code as a string from the given file path.
|
// Loads the Leo code as a string from the given file path.
|
||||||
|
@ -17,20 +17,20 @@
|
|||||||
//! A Leo program consists of import, circuit, and function definitions.
|
//! A Leo program consists of import, circuit, and function definitions.
|
||||||
//! Each defined type consists of ast statements and expressions.
|
//! Each defined type consists of ast statements and expressions.
|
||||||
|
|
||||||
use crate::{
|
use crate::load_annotation;
|
||||||
load_annotation,
|
use crate::Circuit;
|
||||||
Circuit,
|
use crate::DeprecatedError;
|
||||||
DeprecatedError,
|
use crate::Function;
|
||||||
Function,
|
use crate::FunctionInput;
|
||||||
FunctionInput,
|
use crate::Identifier;
|
||||||
Identifier,
|
use crate::ImportStatement;
|
||||||
ImportStatement,
|
use crate::TestFunction;
|
||||||
TestFunction,
|
use leo_grammar::definitions::Definition;
|
||||||
};
|
use leo_grammar::files::File;
|
||||||
use leo_grammar::{definitions::Definition, files::File};
|
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Stores the Leo program abstract syntax tree.
|
/// Stores the Leo program abstract syntax tree.
|
||||||
|
@ -14,13 +14,18 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Identifier, PositiveNumber, Span};
|
use crate::Expression;
|
||||||
use leo_grammar::{
|
use crate::Identifier;
|
||||||
access::{ArrayAccess, AssigneeAccess as GrammarAssigneeAccess},
|
use crate::PositiveNumber;
|
||||||
common::{Assignee as GrammarAssignee, Range, RangeOrExpression},
|
use crate::Span;
|
||||||
};
|
use leo_grammar::access::ArrayAccess;
|
||||||
|
use leo_grammar::access::AssigneeAccess as GrammarAssigneeAccess;
|
||||||
|
use leo_grammar::common::Assignee as GrammarAssignee;
|
||||||
|
use leo_grammar::common::Range;
|
||||||
|
use leo_grammar::common::RangeOrExpression;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,11 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Node, Span};
|
use crate::Expression;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
|
||||||
pub use leo_grammar::operations::AssignOperation as GrammarAssignOperation;
|
pub use leo_grammar::operations::AssignOperation as GrammarAssignOperation;
|
||||||
use leo_grammar::statements::AssignStatement as GrammarAssignStatement;
|
use leo_grammar::statements::AssignStatement as GrammarAssignStatement;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
mod assignee;
|
mod assignee;
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Node, Span, Statement};
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
use leo_grammar::statements::Block as GrammarBlock;
|
use leo_grammar::statements::Block as GrammarBlock;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
|
@ -14,10 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Block, Expression, Node, Span, Statement};
|
use crate::Block;
|
||||||
use leo_grammar::statements::{ConditionalNestedOrEndStatement, ConditionalStatement as GrammarConditionalStatement};
|
use crate::Expression;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Statement;
|
||||||
|
use leo_grammar::statements::ConditionalNestedOrEndStatement;
|
||||||
|
use leo_grammar::statements::ConditionalStatement as GrammarConditionalStatement;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
|
@ -14,16 +14,16 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, FormattedString};
|
use crate::Expression;
|
||||||
use leo_grammar::console::{
|
use crate::FormattedString;
|
||||||
ConsoleAssert as GrammarConsoleAssert,
|
use leo_grammar::console::ConsoleAssert as GrammarConsoleAssert;
|
||||||
ConsoleDebug as GrammarConsoleDebug,
|
use leo_grammar::console::ConsoleDebug as GrammarConsoleDebug;
|
||||||
ConsoleError as GrammarConsoleError,
|
use leo_grammar::console::ConsoleError as GrammarConsoleError;
|
||||||
ConsoleFunction as GrammarConsoleFunction,
|
use leo_grammar::console::ConsoleFunction as GrammarConsoleFunction;
|
||||||
ConsoleLog as GrammarConsoleLog,
|
use leo_grammar::console::ConsoleLog as GrammarConsoleLog;
|
||||||
};
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ConsoleFunction, Node, Span};
|
use crate::ConsoleFunction;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::console::ConsoleFunctionCall as GrammarConsoleFunctionCall;
|
use leo_grammar::console::ConsoleFunctionCall as GrammarConsoleFunctionCall;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Node, Span};
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::console::FormattedContainer as GrammarFormattedContainer;
|
use leo_grammar::console::FormattedContainer as GrammarFormattedContainer;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
|
@ -14,10 +14,14 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, FormattedContainer, Node, Span};
|
use crate::Expression;
|
||||||
|
use crate::FormattedContainer;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::console::FormattedString as GrammarFormattedString;
|
use leo_grammar::console::FormattedString as GrammarFormattedString;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
use leo_grammar::common::Declare as GrammarDeclare;
|
use leo_grammar::common::Declare as GrammarDeclare;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Node, Span, Type};
|
use crate::Expression;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
use crate::Type;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
mod variable_name;
|
mod variable_name;
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Identifier, Node, Span};
|
use crate::Identifier;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
use leo_grammar::common::VariableName as GrammarVariableName;
|
use leo_grammar::common::VariableName as GrammarVariableName;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
@ -14,10 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{Expression, Node, Span};
|
use crate::Expression;
|
||||||
|
use crate::Node;
|
||||||
|
use crate::Span;
|
||||||
|
|
||||||
use leo_grammar::statements::ExpressionStatement as GrammarExpressionStatement;
|
use leo_grammar::statements::ExpressionStatement as GrammarExpressionStatement;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
|
use serde::Serialize;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user