This commit is contained in:
Protryon 2021-06-04 06:03:59 -07:00
parent 936a35ebd2
commit dc91b07e5c
5 changed files with 7 additions and 9 deletions

View File

@ -213,7 +213,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> {
let statement = scope.context.alloc_statement(Statement::Assign(AssignStatement { let statement = scope.context.alloc_statement(Statement::Assign(AssignStatement {
parent: Cell::new(None), parent: Cell::new(None),
span: Some(statement.span.clone()), span: Some(statement.span.clone()),
operation: statement.operation.clone(), operation: statement.operation,
target_variable: Cell::new(variable), target_variable: Cell::new(variable),
target_accesses, target_accesses,
value: Cell::new(value), value: Cell::new(value),
@ -231,7 +231,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> {
impl<'a> Into<leo_ast::AssignStatement> for &AssignStatement<'a> { impl<'a> Into<leo_ast::AssignStatement> for &AssignStatement<'a> {
fn into(self) -> leo_ast::AssignStatement { fn into(self) -> leo_ast::AssignStatement {
leo_ast::AssignStatement { leo_ast::AssignStatement {
operation: self.operation.clone(), operation: self.operation,
assignee: leo_ast::Assignee { assignee: leo_ast::Assignee {
identifier: self.target_variable.get().borrow().name.clone(), identifier: self.target_variable.get().borrow().name.clone(),
accesses: self accesses: self

View File

@ -347,7 +347,7 @@ impl Canonicalizer {
Statement::Assign(AssignStatement { Statement::Assign(AssignStatement {
assignee, assignee,
value, value,
operation: assign.operation.clone(), operation: assign.operation,
span: assign.span.clone(), span: assign.span.clone(),
}) })
} }

View File

@ -325,7 +325,7 @@ pub trait ReconstructingReducer {
value: Expression, value: Expression,
) -> Result<AssignStatement, ReducerError> { ) -> Result<AssignStatement, ReducerError> {
Ok(AssignStatement { Ok(AssignStatement {
operation: assign.operation.clone(), operation: assign.operation,
assignee, assignee,
value, value,
span: assign.span.clone(), span: assign.span.clone(),

View File

@ -65,7 +65,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> ConstrainedProgram<'a, F, G> {
} }
} }
} else { } else {
for (i, item) in input.into_iter().enumerate() { for (i, item) in input.iter_mut().enumerate() {
let namespace_string = format!( let namespace_string = format!(
"evaluate dyn array assignment eq {} {}:{}", "evaluate dyn array assignment eq {} {}:{}",
i, context.span.line_start, context.span.col_start i, context.span.line_start, context.span.col_start

View File

@ -67,10 +67,8 @@ pub fn run_tests<T: Runner>(runner: &T, expectation_category: &str) {
let mut outputs = vec![]; let mut outputs = vec![];
for (path, content) in tests.into_iter() { for (path, content) in tests.into_iter() {
if !filter.is_empty() { if !filter.is_empty() && !path.contains(filter) {
if !path.contains(filter) { continue;
continue;
}
} }
let config = extract_test_config(&content); let config = extract_test_config(&content);
if config.is_none() { if config.is_none() {