From b50919085b9700d43b884d803e278bd40307aa06 Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 18 Mar 2021 15:19:07 -0400 Subject: [PATCH 01/10] deprecate let mut, undeprecate const, let is now mutable by default --- HEAD | 0 asg/tests/fail/address/implicit_invalid.leo | 2 +- .../fail/array/multi_fail_initializer.leo | 2 +- asg/tests/fail/array/multi_fail_inline.leo | 2 +- .../fail/array/multi_initializer_fail.leo | 2 +- .../fail/array/nested_3x2_value_fail.leo | 2 +- asg/tests/fail/array/tuple_3x2_value_fail.leo | 2 +- asg/tests/fail/array/type_fail.leo | 2 +- .../type_nested_value_nested_3x2_fail.leo | 2 +- .../type_nested_value_nested_4x3x2_fail.leo | 2 +- .../type_nested_value_tuple_3x2_fail.leo | 2 +- .../type_nested_value_tuple_4x3x2_fail.leo | 2 +- .../type_tuple_value_nested_3x2_fail.leo | 2 +- .../type_tuple_value_nested_3x2_swap_fail.leo | 4 +- .../type_tuple_value_nested_4x3x2_fail.leo | 2 +- .../array/type_tuple_value_tuple_3x2_fail.leo | 2 +- .../type_tuple_value_tuple_3x2_swap_fail.leo | 4 +- .../type_tuple_value_tuple_4x3x2_fail.leo | 2 +- asg/tests/fail/boolean/true_and_u32.leo | 2 +- asg/tests/fail/boolean/true_or_u32.leo | 2 +- asg/tests/fail/circuits/inline_fail.leo | 2 +- asg/tests/fail/circuits/inline_undefined.leo | 2 +- .../fail/circuits/member_function_fail.leo | 4 +- .../fail/circuits/member_function_invalid.leo | 4 +- .../member_static_function_invalid.leo | 2 +- .../member_static_function_undefined.leo | 2 +- .../fail/circuits/member_variable_fail.leo | 4 +- asg/tests/fail/circuits/mod.rs | 2 +- asg/tests/fail/circuits/mut_function_fail.leo | 2 +- .../fail/circuits/mut_self_function_fail.leo | 2 +- .../mut_self_static_function_fail.leo | 2 +- .../fail/circuits/mut_self_variable_fail.leo | 2 +- .../circuits/mut_static_function_fail.leo | 2 +- asg/tests/fail/circuits/mut_variable_fail.leo | 2 +- .../fail/circuits/self_member_invalid.leo | 4 +- .../fail/circuits/self_member_undefined.leo | 4 +- asg/tests/fail/function/array_input.leo | 2 +- .../multiple_returns_fail_conditional.leo | 4 +- .../function/return_array_nested_fail.leo | 2 +- .../fail/function/return_array_tuple_fail.leo | 2 +- asg/tests/fail/function/scope_fail.leo | 4 +- asg/tests/fail/group/both_sign_high.leo | 2 +- asg/tests/fail/group/both_sign_inferred.leo | 2 +- asg/tests/fail/group/both_sign_low.leo | 2 +- asg/tests/fail/integers/i128/max_fail.leo | 2 +- asg/tests/fail/integers/i128/min_fail.leo | 2 +- asg/tests/fail/integers/i128/negate_min.leo | 4 +- asg/tests/fail/integers/i16/max_fail.leo | 2 +- asg/tests/fail/integers/i16/min_fail.leo | 2 +- asg/tests/fail/integers/i16/negate_min.leo | 4 +- asg/tests/fail/integers/i32/max_fail.leo | 2 +- asg/tests/fail/integers/i32/min_fail.leo | 2 +- asg/tests/fail/integers/i32/negate_min.leo | 4 +- asg/tests/fail/integers/i64/max_fail.leo | 2 +- asg/tests/fail/integers/i64/min_fail.leo | 2 +- asg/tests/fail/integers/i64/negate_min.leo | 4 +- asg/tests/fail/integers/i8/max_fail.leo | 2 +- asg/tests/fail/integers/i8/min_fail.leo | 2 +- asg/tests/fail/integers/i8/negate_min.leo | 4 +- asg/tests/fail/integers/u128/max_fail.leo | 2 +- asg/tests/fail/integers/u128/min_fail.leo | 2 +- asg/tests/fail/integers/u16/max_fail.leo | 2 +- asg/tests/fail/integers/u16/min_fail.leo | 2 +- asg/tests/fail/integers/u32/max_fail.leo | 2 +- asg/tests/fail/integers/u32/min_fail.leo | 2 +- asg/tests/fail/integers/u64/max_fail.leo | 2 +- asg/tests/fail/integers/u64/min_fail.leo | 2 +- asg/tests/fail/integers/u8/max_fail.leo | 2 +- asg/tests/fail/integers/u8/min_fail.leo | 2 +- asg/tests/fail/mutability/array.leo | 2 +- asg/tests/fail/mutability/circuit.leo | 2 +- .../fail/mutability/circuit_function_mut.leo | 2 +- .../circuit_static_function_mut.leo | 2 +- asg/tests/fail/mutability/const.leo | 2 +- asg/tests/fail/mutability/let.leo | 2 +- .../statements/const_declaration_fail.leo | 3 - .../statements/let_mut_declaration_fail.leo | 3 + asg/tests/fail/statements/mod.rs | 4 +- .../pass/address/console_assert_pass.leo | 4 +- asg/tests/pass/address/implicit_invalid.leo | 2 +- asg/tests/pass/address/implicit_valid.leo | 2 +- asg/tests/pass/address/input.leo | 2 +- asg/tests/pass/address/ternary.leo | 6 +- asg/tests/pass/address/valid.leo | 2 +- asg/tests/pass/array/implicit.leo | 8 +- asg/tests/pass/array/index_u8.leo | 4 +- asg/tests/pass/array/multi_initializer.leo | 4 +- asg/tests/pass/array/nested_3x2_value.leo | 4 +- asg/tests/pass/array/slice.leo | 2 +- asg/tests/pass/array/slice_i8.leo | 2 +- asg/tests/pass/array/slice_lower.leo | 6 +- asg/tests/pass/array/spread.leo | 4 +- asg/tests/pass/array/tuple_3x2_value.leo | 4 +- asg/tests/pass/array/type_input_3x2.leo | 2 +- asg/tests/pass/array/type_input_4x3x2.leo | 2 +- .../array/type_nested_value_nested_3x2.leo | 4 +- .../array/type_nested_value_nested_4x3x2.leo | 4 +- .../array/type_nested_value_tuple_3x2.leo | 4 +- .../array/type_nested_value_tuple_4x3x2.leo | 4 +- .../array/type_tuple_value_nested_3x2.leo | 4 +- .../array/type_tuple_value_nested_4x3x2.leo | 4 +- .../pass/array/type_tuple_value_tuple_3x2.leo | 4 +- .../array/type_tuple_value_tuple_4x3x2.leo | 4 +- asg/tests/pass/boolean/all.leo | 6 +- asg/tests/pass/boolean/false_and_false.leo | 2 +- asg/tests/pass/boolean/false_or_false.leo | 2 +- asg/tests/pass/boolean/not_mutable.leo | 4 +- asg/tests/pass/boolean/true_and_false.leo | 2 +- asg/tests/pass/boolean/true_and_true.leo | 2 +- asg/tests/pass/boolean/true_or_false.leo | 2 +- asg/tests/pass/boolean/true_or_true.leo | 2 +- ...define_circuit_inside_circuit_function.leo | 4 +- asg/tests/pass/circuits/inline.leo | 2 +- asg/tests/pass/circuits/member_function.leo | 2 +- .../pass/circuits/member_function_nested.leo | 4 +- .../pass/circuits/member_static_function.leo | 2 +- asg/tests/pass/circuits/member_variable.leo | 2 +- .../circuits/member_variable_and_function.leo | 4 +- asg/tests/pass/circuits/mod.rs | 2 +- asg/tests/pass/circuits/mut_self_variable.leo | 2 +- .../mut_self_variable_conditional.leo | 2 +- asg/tests/pass/circuits/mut_variable.leo | 2 +- asg/tests/pass/circuits/pedersen_mock.leo | 12 +- asg/tests/pass/circuits/self_circuit.leo | 2 +- asg/tests/pass/circuits/self_member.leo | 4 +- asg/tests/pass/core/blake2s_random.leo | 2 +- asg/tests/pass/core/unstable_blake2s.leo | 6 +- asg/tests/pass/field/ternary.leo | 2 +- asg/tests/pass/form_ast.rs | 4 +- asg/tests/pass/function/array_input.leo | 2 +- asg/tests/pass/function/iteration.leo | 2 +- .../pass/function/iteration_repeated.leo | 4 +- asg/tests/pass/function/mod.rs | 10 +- asg/tests/pass/function/multiple_returns.leo | 2 +- asg/tests/pass/function/repeated.leo | 2 +- .../function/return_array_nested_pass.leo | 4 +- .../pass/function/return_array_tuple_pass.leo | 4 +- asg/tests/pass/function/return_tuple.leo | 6 +- .../function/return_tuple_conditional.leo | 2 +- asg/tests/pass/function/value_unchanged.leo | 2 +- asg/tests/pass/group/both_sign_high.leo | 2 +- asg/tests/pass/group/both_sign_inferred.leo | 2 +- asg/tests/pass/group/both_sign_low.leo | 2 +- asg/tests/pass/group/one.leo | 2 +- asg/tests/pass/group/point.leo | 2 +- asg/tests/pass/group/point_input.leo | 2 +- asg/tests/pass/group/ternary.leo | 2 +- asg/tests/pass/group/x_and_y.leo | 2 +- asg/tests/pass/group/x_sign_high.leo | 2 +- asg/tests/pass/group/x_sign_inferred.leo | 2 +- asg/tests/pass/group/x_sign_low.leo | 2 +- asg/tests/pass/group/y_sign_high.leo | 2 +- asg/tests/pass/group/y_sign_inferred.leo | 2 +- asg/tests/pass/group/y_sign_low.leo | 2 +- asg/tests/pass/group/zero.leo | 2 +- asg/tests/pass/import/many_import.leo | 14 +- asg/tests/pass/import/many_import_star.leo | 12 +- asg/tests/pass/import/multiple.leo | 2 +- asg/tests/pass/import/star.leo | 2 +- .../input_files/program_state/access_all.leo | 2 +- asg/tests/pass/integers/i128/max.leo | 2 +- asg/tests/pass/integers/i128/min.leo | 2 +- asg/tests/pass/integers/i128/negate_zero.leo | 2 +- asg/tests/pass/integers/i128/ternary.leo | 2 +- asg/tests/pass/integers/i16/max.leo | 2 +- asg/tests/pass/integers/i16/min.leo | 2 +- asg/tests/pass/integers/i16/negate_zero.leo | 2 +- asg/tests/pass/integers/i16/ternary.leo | 2 +- asg/tests/pass/integers/i32/max.leo | 2 +- asg/tests/pass/integers/i32/min.leo | 2 +- asg/tests/pass/integers/i32/negate_zero.leo | 2 +- asg/tests/pass/integers/i32/ternary.leo | 2 +- asg/tests/pass/integers/i64/max.leo | 2 +- asg/tests/pass/integers/i64/min.leo | 2 +- asg/tests/pass/integers/i64/negate_zero.leo | 2 +- asg/tests/pass/integers/i64/ternary.leo | 2 +- asg/tests/pass/integers/i8/max.leo | 2 +- asg/tests/pass/integers/i8/min.leo | 2 +- asg/tests/pass/integers/i8/negate_zero.leo | 2 +- asg/tests/pass/integers/i8/ternary.leo | 2 +- asg/tests/pass/integers/u128/max.leo | 2 +- asg/tests/pass/integers/u128/min.leo | 2 +- asg/tests/pass/integers/u128/ternary.leo | 2 +- asg/tests/pass/integers/u16/max.leo | 2 +- asg/tests/pass/integers/u16/min.leo | 2 +- asg/tests/pass/integers/u16/ternary.leo | 2 +- asg/tests/pass/integers/u32/max.leo | 2 +- asg/tests/pass/integers/u32/min.leo | 2 +- asg/tests/pass/integers/u32/ternary.leo | 2 +- asg/tests/pass/integers/u64/max.leo | 2 +- asg/tests/pass/integers/u64/min.leo | 2 +- asg/tests/pass/integers/u64/ternary.leo | 2 +- asg/tests/pass/integers/u8/max.leo | 2 +- asg/tests/pass/integers/u8/min.leo | 2 +- asg/tests/pass/integers/u8/ternary.leo | 2 +- asg/tests/pass/mutability/array_mut.leo | 2 +- .../pass/mutability/array_splice_mut.leo | 2 +- asg/tests/pass/mutability/array_tuple_mut.leo | 2 +- asg/tests/pass/mutability/circuit_mut.leo | 2 +- .../pass/mutability/circuit_variable_mut.leo | 2 +- asg/tests/pass/mutability/let_mut.leo | 2 +- asg/tests/pass/mutability/let_mut_nested.leo | 6 +- asg/tests/pass/mutability/swap.leo | 8 +- asg/tests/pass/statements/block.leo | 2 +- .../pass/statements/conditional/chain.leo | 2 +- .../pass/statements/conditional/for_loop.leo | 4 +- .../pass/statements/conditional/mutate.leo | 2 +- .../pass/statements/conditional/nested.leo | 2 +- asg/tests/pass/statements/iteration_basic.leo | 2 +- asg/tests/pass/statements/ternary_basic.leo | 4 +- asg/tests/pass/tuples/access.leo | 2 +- asg/tests/pass/tuples/basic.leo | 2 +- asg/tests/pass/tuples/function.leo | 2 +- asg/tests/pass/tuples/function_multiple.leo | 2 +- asg/tests/pass/tuples/function_typed.leo | 2 +- asg/tests/pass/tuples/multiple.leo | 2 +- asg/tests/pass/tuples/multiple_typed.leo | 2 +- asg/tests/pass/tuples/nested.leo | 4 +- asg/tests/pass/tuples/nested_access.leo | 4 +- asg/tests/pass/tuples/nested_typed.leo | 4 +- asg/tests/pass/tuples/typed.leo | 2 +- .../tests/address/console_assert_fail.leo | 4 +- .../tests/address/console_assert_pass.leo | 4 +- compiler/tests/address/empty.leo | 2 +- compiler/tests/address/implicit_invalid.leo | 2 +- compiler/tests/address/implicit_valid.leo | 2 +- compiler/tests/address/input.leo | 2 +- compiler/tests/address/invalid_length.leo | 2 +- compiler/tests/address/invalid_prefix.leo | 2 +- compiler/tests/address/ternary.leo | 6 +- compiler/tests/address/valid.leo | 2 +- compiler/tests/array/input/inline_fail.leo | 2 +- .../tests/array/multi_fail_initializer.leo | 2 +- compiler/tests/array/multi_fail_inline.leo | 2 +- compiler/tests/array/multi_initializer.leo | 4 +- .../tests/array/multi_initializer_fail.leo | 2 +- compiler/tests/array/nested.leo | 4 +- compiler/tests/array/nested_3x2_value.leo | 4 +- .../tests/array/nested_3x2_value_fail.leo | 2 +- compiler/tests/array/slice.leo | 2 +- compiler/tests/array/slice_lower.leo | 6 +- compiler/tests/array/spread.leo | 4 +- compiler/tests/array/tuple_3x2_value.leo | 4 +- compiler/tests/array/tuple_3x2_value_fail.leo | 2 +- compiler/tests/array/type_fail.leo | 2 +- compiler/tests/array/type_input_3x2.leo | 2 +- compiler/tests/array/type_input_4x3x2.leo | 2 +- .../array/type_nested_value_nested_3x2.leo | 4 +- .../type_nested_value_nested_3x2_fail.leo | 2 +- .../array/type_nested_value_nested_4x3x2.leo | 4 +- .../type_nested_value_nested_4x3x2_fail.leo | 2 +- .../array/type_nested_value_tuple_3x2.leo | 4 +- .../type_nested_value_tuple_3x2_fail.leo | 2 +- .../array/type_nested_value_tuple_4x3x2.leo | 4 +- .../type_nested_value_tuple_4x3x2_fail.leo | 2 +- .../array/type_tuple_value_nested_3x2.leo | 4 +- .../type_tuple_value_nested_3x2_fail.leo | 2 +- .../array/type_tuple_value_nested_4x3x2.leo | 4 +- .../type_tuple_value_nested_4x3x2_fail.leo | 2 +- .../array/type_tuple_value_tuple_3x2.leo | 4 +- .../array/type_tuple_value_tuple_3x2_fail.leo | 2 +- .../array/type_tuple_value_tuple_4x3x2.leo | 4 +- .../type_tuple_value_tuple_4x3x2_fail.leo | 2 +- compiler/tests/array/variable_slice_fail.leo | 4 +- compiler/tests/boolean/all.leo | 6 +- compiler/tests/boolean/conditional_mut.leo | 4 +- compiler/tests/boolean/false_and_false.leo | 2 +- compiler/tests/boolean/false_or_false.leo | 2 +- compiler/tests/boolean/not_mutable.leo | 4 +- compiler/tests/boolean/true_and_false.leo | 2 +- compiler/tests/boolean/true_and_true.leo | 2 +- compiler/tests/boolean/true_and_u32.leo | 2 +- compiler/tests/boolean/true_or_false.leo | 2 +- compiler/tests/boolean/true_or_true.leo | 2 +- compiler/tests/boolean/true_or_u32.leo | 2 +- ...define_circuit_inside_circuit_function.leo | 4 +- .../tests/circuits/duplicate_name_context.leo | 6 +- compiler/tests/circuits/inline.leo | 2 +- compiler/tests/circuits/inline_fail.leo | 2 +- .../tests/circuits/inline_member_fail.leo | 4 +- .../tests/circuits/inline_member_pass.leo | 6 +- compiler/tests/circuits/inline_undefined.leo | 2 +- compiler/tests/circuits/member_function.leo | 2 +- .../tests/circuits/member_function_fail.leo | 4 +- .../circuits/member_function_invalid.leo | 4 +- .../tests/circuits/member_function_nested.leo | 4 +- .../tests/circuits/member_static_function.leo | 2 +- .../member_static_function_invalid.leo | 2 +- .../member_static_function_undefined.leo | 2 +- compiler/tests/circuits/member_variable.leo | 2 +- .../circuits/member_variable_and_function.leo | 4 +- .../tests/circuits/member_variable_fail.leo | 4 +- compiler/tests/circuits/mut_function_fail.leo | 2 +- .../tests/circuits/mut_self_function_fail.leo | 2 +- .../mut_self_static_function_fail.leo | 2 +- compiler/tests/circuits/mut_self_variable.leo | 2 +- .../circuits/mut_self_variable_branch.leo | 2 +- .../mut_self_variable_conditional.leo | 2 +- .../tests/circuits/mut_self_variable_fail.leo | 2 +- .../circuits/mut_static_function_fail.leo | 2 +- compiler/tests/circuits/mut_variable.leo | 2 +- compiler/tests/circuits/mut_variable_fail.leo | 2 +- compiler/tests/circuits/pedersen_mock.leo | 12 +- compiler/tests/circuits/self_circuit.leo | 2 +- compiler/tests/circuits/self_member.leo | 4 +- .../tests/circuits/self_member_invalid.leo | 4 +- .../tests/circuits/self_member_undefined.leo | 4 +- compiler/tests/compiler/main.leo | 2 +- .../blake2s/arguments_length_fail.leo | 4 +- .../unstable/blake2s/arguments_type_fail.leo | 6 +- .../unstable/blake2s/blake2s_random.leo | 2 +- compiler/tests/core/unstable_blake2s.leo | 6 +- compiler/tests/field/field.leo | 4 +- compiler/tests/field/ternary.leo | 2 +- compiler/tests/function/array_input.leo | 2 +- .../function/array_params_direct_call.leo | 2 +- compiler/tests/function/iteration.leo | 2 +- .../tests/function/iteration_repeated.leo | 4 +- compiler/tests/function/multiple_returns.leo | 2 +- .../multiple_returns_fail_conditional.leo | 4 +- compiler/tests/function/repeated.leo | 2 +- .../function/return_array_nested_fail.leo | 2 +- .../function/return_array_nested_pass.leo | 4 +- .../function/return_array_tuple_fail.leo | 2 +- .../function/return_array_tuple_pass.leo | 4 +- compiler/tests/function/return_tuple.leo | 6 +- .../function/return_tuple_conditional.leo | 2 +- compiler/tests/function/scope_fail.leo | 4 +- compiler/tests/function/value_unchanged.leo | 2 +- compiler/tests/group/both_sign_high.leo | 2 +- compiler/tests/group/both_sign_inferred.leo | 2 +- compiler/tests/group/both_sign_low.leo | 2 +- compiler/tests/group/one.leo | 2 +- compiler/tests/group/point.leo | 2 +- compiler/tests/group/point_input.leo | 2 +- .../tests/group/positive_and_negative.leo | 12 +- compiler/tests/group/ternary.leo | 2 +- compiler/tests/group/x_and_y.leo | 2 +- compiler/tests/group/x_sign_high.leo | 2 +- compiler/tests/group/x_sign_inferred.leo | 2 +- compiler/tests/group/x_sign_low.leo | 2 +- compiler/tests/group/y_sign_high.leo | 2 +- compiler/tests/group/y_sign_inferred.leo | 2 +- compiler/tests/group/y_sign_low.leo | 2 +- compiler/tests/group/zero.leo | 2 +- compiler/tests/import/many_import.leo | 14 +- compiler/tests/import/many_import_star.leo | 12 +- compiler/tests/import/multiple.leo | 2 +- compiler/tests/import/star.leo | 2 +- .../main_multi_dimension_array.leo | 2 +- .../input_files/program_state/access_all.leo | 2 +- compiler/tests/integers/i128/max.leo | 2 +- compiler/tests/integers/i128/max_fail.leo | 2 +- compiler/tests/integers/i128/min.leo | 2 +- compiler/tests/integers/i128/min_fail.leo | 2 +- compiler/tests/integers/i128/negate_min.leo | 4 +- compiler/tests/integers/i128/negate_zero.leo | 2 +- compiler/tests/integers/i128/ternary.leo | 2 +- compiler/tests/integers/i16/max.leo | 2 +- compiler/tests/integers/i16/max_fail.leo | 2 +- compiler/tests/integers/i16/min.leo | 2 +- compiler/tests/integers/i16/min_fail.leo | 2 +- compiler/tests/integers/i16/negate_min.leo | 4 +- compiler/tests/integers/i16/negate_zero.leo | 2 +- compiler/tests/integers/i16/ternary.leo | 2 +- compiler/tests/integers/i32/max.leo | 2 +- compiler/tests/integers/i32/max_fail.leo | 2 +- compiler/tests/integers/i32/min.leo | 2 +- compiler/tests/integers/i32/min_fail.leo | 2 +- compiler/tests/integers/i32/negate_min.leo | 4 +- compiler/tests/integers/i32/negate_zero.leo | 2 +- compiler/tests/integers/i32/ternary.leo | 2 +- compiler/tests/integers/i64/max.leo | 2 +- compiler/tests/integers/i64/max_fail.leo | 2 +- compiler/tests/integers/i64/min.leo | 2 +- compiler/tests/integers/i64/min_fail.leo | 2 +- compiler/tests/integers/i64/negate_min.leo | 4 +- compiler/tests/integers/i64/negate_zero.leo | 2 +- compiler/tests/integers/i64/ternary.leo | 2 +- compiler/tests/integers/i8/max.leo | 2 +- compiler/tests/integers/i8/max_fail.leo | 2 +- compiler/tests/integers/i8/min.leo | 2 +- compiler/tests/integers/i8/min_fail.leo | 2 +- compiler/tests/integers/i8/negate_min.leo | 4 +- compiler/tests/integers/i8/negate_zero.leo | 2 +- compiler/tests/integers/i8/ternary.leo | 2 +- compiler/tests/integers/u128/max.leo | 2 +- compiler/tests/integers/u128/max_fail.leo | 2 +- compiler/tests/integers/u128/min.leo | 2 +- compiler/tests/integers/u128/min_fail.leo | 2 +- compiler/tests/integers/u128/ternary.leo | 2 +- compiler/tests/integers/u16/max.leo | 2 +- compiler/tests/integers/u16/max_fail.leo | 2 +- compiler/tests/integers/u16/min.leo | 2 +- compiler/tests/integers/u16/min_fail.leo | 2 +- compiler/tests/integers/u16/ternary.leo | 2 +- compiler/tests/integers/u32/max.leo | 2 +- compiler/tests/integers/u32/max_fail.leo | 2 +- compiler/tests/integers/u32/min.leo | 2 +- compiler/tests/integers/u32/min_fail.leo | 2 +- compiler/tests/integers/u32/ternary.leo | 2 +- compiler/tests/integers/u64/max.leo | 2 +- compiler/tests/integers/u64/max_fail.leo | 2 +- compiler/tests/integers/u64/min.leo | 2 +- compiler/tests/integers/u64/min_fail.leo | 2 +- compiler/tests/integers/u64/ternary.leo | 2 +- compiler/tests/integers/u8/max.leo | 2 +- compiler/tests/integers/u8/max_fail.leo | 2 +- compiler/tests/integers/u8/min.leo | 2 +- compiler/tests/integers/u8/min_fail.leo | 2 +- compiler/tests/integers/u8/ternary.leo | 2 +- compiler/tests/mutability/array.leo | 2 +- compiler/tests/mutability/array_mut.leo | 2 +- .../tests/mutability/array_splice_mut.leo | 2 +- compiler/tests/mutability/array_tuple_mut.leo | 2 +- compiler/tests/mutability/circuit.leo | 2 +- .../tests/mutability/circuit_function_mut.leo | 2 +- compiler/tests/mutability/circuit_mut.leo | 2 +- .../circuit_static_function_mut.leo | 2 +- .../tests/mutability/circuit_variable_mut.leo | 2 +- compiler/tests/mutability/const.leo | 2 +- compiler/tests/mutability/let.leo | 2 +- compiler/tests/mutability/let_mut.leo | 2 +- compiler/tests/mutability/let_mut_nested.leo | 6 +- compiler/tests/mutability/swap.leo | 8 +- compiler/tests/statements/block.leo | 2 +- .../tests/statements/conditional/chain.leo | 2 +- .../tests/statements/conditional/for_loop.leo | 4 +- .../tests/statements/conditional/mutate.leo | 2 +- .../tests/statements/conditional/nested.leo | 2 +- compiler/tests/statements/iteration_basic.leo | 2 +- compiler/tests/statements/ternary_basic.leo | 4 +- .../tests/syntax/compare_mismatched_types.leo | 2 +- .../tests/syntax/identifiers/address_fail.leo | 2 +- .../tests/syntax/identifiers/console_fail.leo | 2 +- .../tests/syntax/identifiers/field_fail.leo | 2 +- .../tests/syntax/identifiers/group_fail.leo | 2 +- compiler/tests/syntax/identifiers/i8_fail.leo | 2 +- .../tests/syntax/identifiers/input_fail.leo | 2 +- .../syntax/identifiers/self_keyword_fail.leo | 2 +- .../syntax/identifiers/self_type_fail.leo | 2 +- .../tests/syntax/identifiers/true_fail.leo | 2 +- compiler/tests/syntax/identifiers/u8_fail.leo | 2 +- compiler/tests/syntax/semicolon.leo | 2 +- compiler/tests/tuples/access.leo | 2 +- compiler/tests/tuples/basic.leo | 2 +- compiler/tests/tuples/function.leo | 2 +- compiler/tests/tuples/function_multiple.leo | 2 +- compiler/tests/tuples/function_typed.leo | 2 +- compiler/tests/tuples/multiple.leo | 2 +- compiler/tests/tuples/multiple_typed.leo | 2 +- compiler/tests/tuples/nested.leo | 4 +- compiler/tests/tuples/nested_access.leo | 4 +- compiler/tests/tuples/nested_typed.leo | 4 +- compiler/tests/tuples/typed.leo | 2 +- examples/hello-world/src/main.leo | 2 +- examples/pedersen-hash/src/main.leo | 8 +- parser/benches/big_circuit.leo | 4 +- parser/benches/big_if_else.leo | 2 +- parser/benches/big_ternary.leo | 2 +- parser/benches/long_array.leo | 4 +- parser/benches/long_expr.leo | 10 +- parser/benches/many_assigns.leo | 768 +++++++++--------- parser/src/errors/deprecated.rs | 4 +- parser/src/parser/statement.rs | 29 +- tests/fail/parse/address/empty.leo | 2 +- tests/fail/parse/address/invalid_length.leo | 2 +- tests/fail/parse/address/invalid_prefix.leo | 2 +- tests/fail/parse/array/type_fail.leo | 2 +- tests/fail/parse/circuits/self_circuit.leo | 2 +- tests/fail/parse/syntax/address_fail.leo | 2 +- tests/fail/parse/syntax/console_fail.leo | 2 +- tests/fail/parse/syntax/field_fail.leo | 2 +- tests/fail/parse/syntax/group_fail.leo | 2 +- tests/fail/parse/syntax/i8_fail.leo | 2 +- tests/fail/parse/syntax/input_fail.leo | 2 +- tests/fail/parse/syntax/self_keyword_fail.leo | 2 +- tests/fail/parse/syntax/self_type_fail.leo | 2 +- tests/fail/parse/syntax/semicolon.leo | 2 +- tests/fail/parse/syntax/true_fail.leo | 2 +- tests/fail/parse/syntax/u8_fail.leo | 2 +- .../parse/address/console_assert_fail.leo | 4 +- .../parse/address/console_assert_pass.leo | 4 +- tests/pass/parse/address/implicit_invalid.leo | 2 +- tests/pass/parse/address/implicit_valid.leo | 2 +- tests/pass/parse/address/input.leo | 2 +- tests/pass/parse/address/ternary.leo | 6 +- tests/pass/parse/address/valid.leo | 2 +- .../parse/array/multi_fail_initializer.leo | 2 +- tests/pass/parse/array/multi_fail_inline.leo | 2 +- tests/pass/parse/array/multi_initializer.leo | 4 +- .../parse/array/multi_initializer_fail.leo | 2 +- tests/pass/parse/array/nested.leo | 4 +- tests/pass/parse/array/nested_3x2_value.leo | 4 +- .../parse/array/nested_3x2_value_fail.leo | 2 +- tests/pass/parse/array/slice.leo | 2 +- tests/pass/parse/array/slice_lower.leo | 6 +- tests/pass/parse/array/spread.leo | 4 +- tests/pass/parse/array/tuple_3x2_value.leo | 4 +- .../pass/parse/array/tuple_3x2_value_fail.leo | 2 +- tests/pass/parse/array/type_input_3x2.leo | 2 +- tests/pass/parse/array/type_input_4x3x2.leo | 2 +- .../array/type_nested_value_nested_3x2.leo | 4 +- .../type_nested_value_nested_3x2_fail.leo | 2 +- .../array/type_nested_value_nested_4x3x2.leo | 4 +- .../type_nested_value_nested_4x3x2_fail.leo | 2 +- .../array/type_nested_value_tuple_3x2.leo | 4 +- .../type_nested_value_tuple_3x2_fail.leo | 2 +- .../array/type_nested_value_tuple_4x3x2.leo | 4 +- .../type_nested_value_tuple_4x3x2_fail.leo | 2 +- .../array/type_tuple_value_nested_3x2.leo | 4 +- .../type_tuple_value_nested_3x2_fail.leo | 2 +- .../array/type_tuple_value_nested_4x3x2.leo | 4 +- .../type_tuple_value_nested_4x3x2_fail.leo | 2 +- .../array/type_tuple_value_tuple_3x2.leo | 4 +- .../array/type_tuple_value_tuple_3x2_fail.leo | 2 +- .../array/type_tuple_value_tuple_4x3x2.leo | 4 +- .../type_tuple_value_tuple_4x3x2_fail.leo | 2 +- .../pass/parse/array/variable_slice_fail.leo | 4 +- tests/pass/parse/boolean/all.leo | 6 +- tests/pass/parse/boolean/conditional_mut.leo | 4 +- tests/pass/parse/boolean/false_and_false.leo | 2 +- tests/pass/parse/boolean/false_or_false.leo | 2 +- tests/pass/parse/boolean/not_mutable.leo | 4 +- tests/pass/parse/boolean/true_and_false.leo | 2 +- tests/pass/parse/boolean/true_and_true.leo | 2 +- tests/pass/parse/boolean/true_and_u32.leo | 2 +- tests/pass/parse/boolean/true_or_false.leo | 2 +- tests/pass/parse/boolean/true_or_true.leo | 2 +- tests/pass/parse/boolean/true_or_u32.leo | 2 +- ...define_circuit_inside_circuit_function.leo | 4 +- .../parse/circuits/duplicate_name_context.leo | 6 +- tests/pass/parse/circuits/inline.leo | 2 +- tests/pass/parse/circuits/inline_fail.leo | 2 +- .../parse/circuits/inline_member_fail.leo | 4 +- .../parse/circuits/inline_member_pass.leo | 6 +- .../pass/parse/circuits/inline_undefined.leo | 2 +- tests/pass/parse/circuits/member_function.leo | 2 +- .../parse/circuits/member_function_fail.leo | 4 +- .../circuits/member_function_invalid.leo | 4 +- .../parse/circuits/member_function_nested.leo | 4 +- .../parse/circuits/member_static_function.leo | 2 +- .../member_static_function_invalid.leo | 2 +- .../member_static_function_undefined.leo | 2 +- tests/pass/parse/circuits/member_variable.leo | 2 +- .../circuits/member_variable_and_function.leo | 4 +- .../parse/circuits/member_variable_fail.leo | 4 +- .../pass/parse/circuits/mut_function_fail.leo | 2 +- .../parse/circuits/mut_self_function_fail.leo | 2 +- .../mut_self_static_function_fail.leo | 2 +- .../pass/parse/circuits/mut_self_variable.leo | 2 +- .../circuits/mut_self_variable_branch.leo | 2 +- .../mut_self_variable_conditional.leo | 2 +- .../parse/circuits/mut_self_variable_fail.leo | 2 +- .../circuits/mut_static_function_fail.leo | 2 +- tests/pass/parse/circuits/mut_variable.leo | 2 +- .../pass/parse/circuits/mut_variable_fail.leo | 2 +- tests/pass/parse/circuits/pedersen_mock.leo | 12 +- tests/pass/parse/circuits/self_member.leo | 4 +- .../parse/circuits/self_member_invalid.leo | 4 +- .../parse/circuits/self_member_undefined.leo | 4 +- tests/pass/parse/compiler/main.leo | 2 +- .../pass/parse/core/arguments_length_fail.leo | 4 +- tests/pass/parse/core/arguments_type_fail.leo | 6 +- tests/pass/parse/core/blake2s_random.leo | 2 +- tests/pass/parse/core/unstable_blake2s.leo | 6 +- tests/pass/parse/field/field.leo | 4 +- tests/pass/parse/field/ternary.leo | 2 +- tests/pass/parse/function/array_input.leo | 2 +- .../function/array_params_direct_call.leo | 2 +- tests/pass/parse/function/iteration.leo | 2 +- .../parse/function/iteration_repeated.leo | 4 +- .../pass/parse/function/multiple_returns.leo | 2 +- .../multiple_returns_fail_conditional.leo | 4 +- tests/pass/parse/function/repeated.leo | 2 +- .../function/return_array_nested_fail.leo | 2 +- .../function/return_array_nested_pass.leo | 4 +- .../function/return_array_tuple_fail.leo | 2 +- .../function/return_array_tuple_pass.leo | 4 +- tests/pass/parse/function/return_tuple.leo | 6 +- .../function/return_tuple_conditional.leo | 2 +- tests/pass/parse/function/scope_fail.leo | 4 +- tests/pass/parse/function/value_unchanged.leo | 2 +- tests/pass/parse/group/both_sign_high.leo | 2 +- tests/pass/parse/group/both_sign_inferred.leo | 2 +- tests/pass/parse/group/both_sign_low.leo | 2 +- tests/pass/parse/group/one.leo | 2 +- tests/pass/parse/group/point.leo | 2 +- tests/pass/parse/group/point_input.leo | 2 +- .../parse/group/positive_and_negative.leo | 12 +- tests/pass/parse/group/ternary.leo | 2 +- tests/pass/parse/group/x_and_y.leo | 2 +- tests/pass/parse/group/x_sign_high.leo | 2 +- tests/pass/parse/group/x_sign_inferred.leo | 2 +- tests/pass/parse/group/x_sign_low.leo | 2 +- tests/pass/parse/group/y_sign_high.leo | 2 +- tests/pass/parse/group/y_sign_inferred.leo | 2 +- tests/pass/parse/group/y_sign_low.leo | 2 +- tests/pass/parse/group/zero.leo | 2 +- tests/pass/parse/import/many_import.leo | 14 +- tests/pass/parse/import/many_import_star.leo | 12 +- tests/pass/parse/import/multiple.leo | 2 +- tests/pass/parse/import/star.leo | 2 +- tests/pass/parse/integers/i128/max.leo | 2 +- tests/pass/parse/integers/i128/max_fail.leo | 2 +- tests/pass/parse/integers/i128/min.leo | 2 +- tests/pass/parse/integers/i128/min_fail.leo | 2 +- tests/pass/parse/integers/i128/negate_min.leo | 4 +- .../pass/parse/integers/i128/negate_zero.leo | 2 +- tests/pass/parse/integers/i128/ternary.leo | 2 +- tests/pass/parse/integers/i16/max.leo | 2 +- tests/pass/parse/integers/i16/max_fail.leo | 2 +- tests/pass/parse/integers/i16/min.leo | 2 +- tests/pass/parse/integers/i16/min_fail.leo | 2 +- tests/pass/parse/integers/i16/negate_min.leo | 4 +- tests/pass/parse/integers/i16/negate_zero.leo | 2 +- tests/pass/parse/integers/i16/ternary.leo | 2 +- tests/pass/parse/integers/i32/max.leo | 2 +- tests/pass/parse/integers/i32/max_fail.leo | 2 +- tests/pass/parse/integers/i32/min.leo | 2 +- tests/pass/parse/integers/i32/min_fail.leo | 2 +- tests/pass/parse/integers/i32/negate_min.leo | 4 +- tests/pass/parse/integers/i32/negate_zero.leo | 2 +- tests/pass/parse/integers/i32/ternary.leo | 2 +- tests/pass/parse/integers/i64/max.leo | 2 +- tests/pass/parse/integers/i64/max_fail.leo | 2 +- tests/pass/parse/integers/i64/min.leo | 2 +- tests/pass/parse/integers/i64/min_fail.leo | 2 +- tests/pass/parse/integers/i64/negate_min.leo | 4 +- tests/pass/parse/integers/i64/negate_zero.leo | 2 +- tests/pass/parse/integers/i64/ternary.leo | 2 +- tests/pass/parse/integers/i8/max.leo | 2 +- tests/pass/parse/integers/i8/max_fail.leo | 2 +- tests/pass/parse/integers/i8/min.leo | 2 +- tests/pass/parse/integers/i8/min_fail.leo | 2 +- tests/pass/parse/integers/i8/negate_min.leo | 4 +- tests/pass/parse/integers/i8/negate_zero.leo | 2 +- tests/pass/parse/integers/i8/ternary.leo | 2 +- tests/pass/parse/integers/u128/max.leo | 2 +- tests/pass/parse/integers/u128/max_fail.leo | 2 +- tests/pass/parse/integers/u128/min.leo | 2 +- tests/pass/parse/integers/u128/min_fail.leo | 2 +- tests/pass/parse/integers/u128/ternary.leo | 2 +- tests/pass/parse/integers/u16/max.leo | 2 +- tests/pass/parse/integers/u16/max_fail.leo | 2 +- tests/pass/parse/integers/u16/min.leo | 2 +- tests/pass/parse/integers/u16/min_fail.leo | 2 +- tests/pass/parse/integers/u16/ternary.leo | 2 +- tests/pass/parse/integers/u32/max.leo | 2 +- tests/pass/parse/integers/u32/max_fail.leo | 2 +- tests/pass/parse/integers/u32/min.leo | 2 +- tests/pass/parse/integers/u32/min_fail.leo | 2 +- tests/pass/parse/integers/u32/ternary.leo | 2 +- tests/pass/parse/integers/u64/max.leo | 2 +- tests/pass/parse/integers/u64/max_fail.leo | 2 +- tests/pass/parse/integers/u64/min.leo | 2 +- tests/pass/parse/integers/u64/min_fail.leo | 2 +- tests/pass/parse/integers/u64/ternary.leo | 2 +- tests/pass/parse/integers/u8/max.leo | 2 +- tests/pass/parse/integers/u8/max_fail.leo | 2 +- tests/pass/parse/integers/u8/min.leo | 2 +- tests/pass/parse/integers/u8/min_fail.leo | 2 +- tests/pass/parse/integers/u8/ternary.leo | 2 +- tests/pass/parse/mutability/array.leo | 2 +- tests/pass/parse/mutability/array_mut.leo | 2 +- .../parse/mutability/array_splice_mut.leo | 2 +- .../pass/parse/mutability/array_tuple_mut.leo | 2 +- tests/pass/parse/mutability/circuit.leo | 2 +- .../parse/mutability/circuit_function_mut.leo | 2 +- tests/pass/parse/mutability/circuit_mut.leo | 2 +- .../circuit_static_function_mut.leo | 2 +- .../parse/mutability/circuit_variable_mut.leo | 2 +- tests/pass/parse/mutability/const.leo | 2 +- tests/pass/parse/mutability/let.leo | 2 +- tests/pass/parse/mutability/let_mut.leo | 2 +- .../pass/parse/mutability/let_mut_nested.leo | 6 +- tests/pass/parse/mutability/swap.leo | 8 +- tests/pass/parse/statements/block.leo | 2 +- tests/pass/parse/statements/chain.leo | 2 +- tests/pass/parse/statements/for_loop.leo | 4 +- .../pass/parse/statements/iteration_basic.leo | 2 +- tests/pass/parse/statements/mutate.leo | 2 +- tests/pass/parse/statements/nested.leo | 2 +- tests/pass/parse/statements/ternary_basic.leo | 4 +- .../parse/syntax/compare_mismatched_types.leo | 2 +- tests/pass/parse/tuples/access.leo | 2 +- tests/pass/parse/tuples/basic.leo | 2 +- tests/pass/parse/tuples/function.leo | 2 +- tests/pass/parse/tuples/function_multiple.leo | 2 +- tests/pass/parse/tuples/function_typed.leo | 2 +- tests/pass/parse/tuples/multiple.leo | 2 +- tests/pass/parse/tuples/multiple_typed.leo | 2 +- tests/pass/parse/tuples/nested.leo | 4 +- tests/pass/parse/tuples/nested_access.leo | 4 +- tests/pass/parse/tuples/nested_typed.leo | 4 +- tests/pass/parse/tuples/typed.leo | 2 +- 696 files changed, 1356 insertions(+), 1359 deletions(-) create mode 100644 HEAD delete mode 100644 asg/tests/fail/statements/const_declaration_fail.leo create mode 100644 asg/tests/fail/statements/let_mut_declaration_fail.leo diff --git a/HEAD b/HEAD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/asg/tests/fail/address/implicit_invalid.leo b/asg/tests/fail/address/implicit_invalid.leo index 6f8eba5114..aadc38a6d8 100644 --- a/asg/tests/fail/address/implicit_invalid.leo +++ b/asg/tests/fail/address/implicit_invalid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/asg/tests/fail/array/multi_fail_initializer.leo b/asg/tests/fail/array/multi_fail_initializer.leo index 258750b327..be1ab315bd 100644 --- a/asg/tests/fail/array/multi_fail_initializer.leo +++ b/asg/tests/fail/array/multi_fail_initializer.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions + const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions } \ No newline at end of file diff --git a/asg/tests/fail/array/multi_fail_inline.leo b/asg/tests/fail/array/multi_fail_inline.leo index 50a06c09b2..49c9296798 100644 --- a/asg/tests/fail/array/multi_fail_inline.leo +++ b/asg/tests/fail/array/multi_fail_inline.leo @@ -1,4 +1,4 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8, 1u8], + const arr: [u8; (2, 2)] = [[1u8, 1u8], [1u8]]; // incorrect dimensions } \ No newline at end of file diff --git a/asg/tests/fail/array/multi_initializer_fail.leo b/asg/tests/fail/array/multi_initializer_fail.leo index 0bd76acffa..e38a8fdaee 100644 --- a/asg/tests/fail/array/multi_initializer_fail.leo +++ b/asg/tests/fail/array/multi_initializer_fail.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions + const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions } \ No newline at end of file diff --git a/asg/tests/fail/array/nested_3x2_value_fail.leo b/asg/tests/fail/array/nested_3x2_value_fail.leo index 35c8478cd1..a187a51991 100644 --- a/asg/tests/fail/array/nested_3x2_value_fail.leo +++ b/asg/tests/fail/array/nested_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } diff --git a/asg/tests/fail/array/tuple_3x2_value_fail.leo b/asg/tests/fail/array/tuple_3x2_value_fail.leo index 42e6f61500..78593ab696 100644 --- a/asg/tests/fail/array/tuple_3x2_value_fail.leo +++ b/asg/tests/fail/array/tuple_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } diff --git a/asg/tests/fail/array/type_fail.leo b/asg/tests/fail/array/type_fail.leo index 1402ceba4c..356bba976a 100644 --- a/asg/tests/fail/array/type_fail.leo +++ b/asg/tests/fail/array/type_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: [u8; -2] = [0u32; 2]; + const a: [u8; -2] = [0u32; 2]; } \ No newline at end of file diff --git a/asg/tests/fail/array/type_nested_value_nested_3x2_fail.leo b/asg/tests/fail/array/type_nested_value_nested_3x2_fail.leo index 4bd07f85db..56c8916fb0 100644 --- a/asg/tests/fail/array/type_nested_value_nested_3x2_fail.leo +++ b/asg/tests/fail/array/type_nested_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_nested_value_nested_4x3x2_fail.leo b/asg/tests/fail/array/type_nested_value_nested_4x3x2_fail.leo index 6479004d68..480327a91d 100644 --- a/asg/tests/fail/array/type_nested_value_nested_4x3x2_fail.leo +++ b/asg/tests/fail/array/type_nested_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_nested_value_tuple_3x2_fail.leo b/asg/tests/fail/array/type_nested_value_tuple_3x2_fail.leo index ba99b070c7..3bfb559615 100644 --- a/asg/tests/fail/array/type_nested_value_tuple_3x2_fail.leo +++ b/asg/tests/fail/array/type_nested_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_nested_value_tuple_4x3x2_fail.leo b/asg/tests/fail/array/type_nested_value_tuple_4x3x2_fail.leo index 95172bf329..ce1219a37b 100644 --- a/asg/tests/fail/array/type_nested_value_tuple_4x3x2_fail.leo +++ b/asg/tests/fail/array/type_nested_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_nested_3x2_fail.leo b/asg/tests/fail/array/type_tuple_value_nested_3x2_fail.leo index 9732cf26ef..e84f025a9f 100644 --- a/asg/tests/fail/array/type_tuple_value_nested_3x2_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_nested_3x2_swap_fail.leo b/asg/tests/fail/array/type_tuple_value_nested_3x2_swap_fail.leo index 6edfa83847..0b960c6b44 100644 --- a/asg/tests/fail/array/type_tuple_value_nested_3x2_swap_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_nested_3x2_swap_fail.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (2, 3)] = [[0; 3]; 2]; // initializer + const b: [u8; (2, 3)] = [[0; 3]; 2]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_nested_4x3x2_fail.leo b/asg/tests/fail/array/type_tuple_value_nested_4x3x2_fail.leo index b820c4d088..cbb7ccbf76 100644 --- a/asg/tests/fail/array/type_tuple_value_nested_4x3x2_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_tuple_3x2_fail.leo b/asg/tests/fail/array/type_tuple_value_tuple_3x2_fail.leo index 99487ccb7a..884a75db9d 100644 --- a/asg/tests/fail/array/type_tuple_value_tuple_3x2_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_tuple_3x2_swap_fail.leo b/asg/tests/fail/array/type_tuple_value_tuple_3x2_swap_fail.leo index 40f1ca9933..d742a544a7 100644 --- a/asg/tests/fail/array/type_tuple_value_tuple_3x2_swap_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_tuple_3x2_swap_fail.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (2, 3)] = [0; (2, 3)]; // initializer + const b: [u8; (2, 3)] = [0; (2, 3)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/fail/array/type_tuple_value_tuple_4x3x2_fail.leo b/asg/tests/fail/array/type_tuple_value_tuple_4x3x2_fail.leo index 824fd90bc6..31e2a5e552 100644 --- a/asg/tests/fail/array/type_tuple_value_tuple_4x3x2_fail.leo +++ b/asg/tests/fail/array/type_tuple_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) + const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) } \ No newline at end of file diff --git a/asg/tests/fail/boolean/true_and_u32.leo b/asg/tests/fail/boolean/true_and_u32.leo index e5b3a8c001..ad3ead9040 100644 --- a/asg/tests/fail/boolean/true_and_u32.leo +++ b/asg/tests/fail/boolean/true_and_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true && 1u32; + const a = true && 1u32; } \ No newline at end of file diff --git a/asg/tests/fail/boolean/true_or_u32.leo b/asg/tests/fail/boolean/true_or_u32.leo index 500b5f7bf4..38dab727b9 100644 --- a/asg/tests/fail/boolean/true_or_u32.leo +++ b/asg/tests/fail/boolean/true_or_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true || 1u32; + const a = true || 1u32; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/inline_fail.leo b/asg/tests/fail/circuits/inline_fail.leo index 52792a07e0..01597005fb 100644 --- a/asg/tests/fail/circuits/inline_fail.leo +++ b/asg/tests/fail/circuits/inline_fail.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { y: 0u32 }; + const a = Foo { y: 0u32 }; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/inline_undefined.leo b/asg/tests/fail/circuits/inline_undefined.leo index af070e01e9..40c4cf722c 100644 --- a/asg/tests/fail/circuits/inline_undefined.leo +++ b/asg/tests/fail/circuits/inline_undefined.leo @@ -1,3 +1,3 @@ function main() { - let a = Foo { }; + const a = Foo { }; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/member_function_fail.leo b/asg/tests/fail/circuits/member_function_fail.leo index 224b79cbf4..5a1c4100c5 100644 --- a/asg/tests/fail/circuits/member_function_fail.leo +++ b/asg/tests/fail/circuits/member_function_fail.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echoed(1u32); + const a = Foo { }; + const err = a.echoed(1u32); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/member_function_invalid.leo b/asg/tests/fail/circuits/member_function_invalid.leo index bb834e9562..aa689eb976 100644 --- a/asg/tests/fail/circuits/member_function_invalid.leo +++ b/asg/tests/fail/circuits/member_function_invalid.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echo(1u32); // echo is a static function and must be accessed using `::` + const a = Foo { }; + const err = a.echo(1u32); // echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/asg/tests/fail/circuits/member_static_function_invalid.leo b/asg/tests/fail/circuits/member_static_function_invalid.leo index 09fec386d9..7829b4b430 100644 --- a/asg/tests/fail/circuits/member_static_function_invalid.leo +++ b/asg/tests/fail/circuits/member_static_function_invalid.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` + const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/asg/tests/fail/circuits/member_static_function_undefined.leo b/asg/tests/fail/circuits/member_static_function_undefined.leo index cf9f98c7b4..ece1d00963 100644 --- a/asg/tests/fail/circuits/member_static_function_undefined.leo +++ b/asg/tests/fail/circuits/member_static_function_undefined.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo::echoed(1u32); + const err = Foo::echoed(1u32); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/member_variable_fail.leo b/asg/tests/fail/circuits/member_variable_fail.leo index 5780704ea2..fdf42068d5 100644 --- a/asg/tests/fail/circuits/member_variable_fail.leo +++ b/asg/tests/fail/circuits/member_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; - let err = a.y; + const err = a.y; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mod.rs b/asg/tests/fail/circuits/mod.rs index f88d9ec42d..38f1824755 100644 --- a/asg/tests/fail/circuits/mod.rs +++ b/asg/tests/fail/circuits/mod.rs @@ -60,7 +60,7 @@ fn test_mut_member_function_fail() { } function main() { - let a = Foo { }; + const a = Foo { }; console.assert(a.echo(1u32) == 1u32); }"#; diff --git a/asg/tests/fail/circuits/mut_function_fail.leo b/asg/tests/fail/circuits/mut_function_fail.leo index 3469f97627..1b87e2bfb1 100644 --- a/asg/tests/fail/circuits/mut_function_fail.leo +++ b/asg/tests/fail/circuits/mut_function_fail.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mut_self_function_fail.leo b/asg/tests/fail/circuits/mut_self_function_fail.leo index 8c9b99f6ae..58c8088ba1 100644 --- a/asg/tests/fail/circuits/mut_self_function_fail.leo +++ b/asg/tests/fail/circuits/mut_self_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mut_self_static_function_fail.leo b/asg/tests/fail/circuits/mut_self_static_function_fail.leo index 8c9b99f6ae..58c8088ba1 100644 --- a/asg/tests/fail/circuits/mut_self_static_function_fail.leo +++ b/asg/tests/fail/circuits/mut_self_static_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mut_self_variable_fail.leo b/asg/tests/fail/circuits/mut_self_variable_fail.leo index fdbb556bca..4db62a4d3e 100644 --- a/asg/tests/fail/circuits/mut_self_variable_fail.leo +++ b/asg/tests/fail/circuits/mut_self_variable_fail.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mut_static_function_fail.leo b/asg/tests/fail/circuits/mut_static_function_fail.leo index ed3092c656..fd873bd17b 100644 --- a/asg/tests/fail/circuits/mut_static_function_fail.leo +++ b/asg/tests/fail/circuits/mut_static_function_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/mut_variable_fail.leo b/asg/tests/fail/circuits/mut_variable_fail.leo index 4d58150c95..7ba4193074 100644 --- a/asg/tests/fail/circuits/mut_variable_fail.leo +++ b/asg/tests/fail/circuits/mut_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let f = Foo { a: 0u8 }; + const f = Foo { a: 0u8 }; f.a = 1u8; } \ No newline at end of file diff --git a/asg/tests/fail/circuits/self_member_invalid.leo b/asg/tests/fail/circuits/self_member_invalid.leo index 2e8b14f66c..163499d619 100644 --- a/asg/tests/fail/circuits/self_member_invalid.leo +++ b/asg/tests/fail/circuits/self_member_invalid.leo @@ -7,6 +7,6 @@ circuit Foo { } function main() -> u32 { - let foo = Foo { f: 1u32 }; - let err = foo.bar(); + const foo = Foo { f: 1u32 }; + const err = foo.bar(); } \ No newline at end of file diff --git a/asg/tests/fail/circuits/self_member_undefined.leo b/asg/tests/fail/circuits/self_member_undefined.leo index 471ffb973c..05a40905d7 100644 --- a/asg/tests/fail/circuits/self_member_undefined.leo +++ b/asg/tests/fail/circuits/self_member_undefined.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let foo = Foo { }; - let err = foo.bar(); + const foo = Foo { }; + const err = foo.bar(); } \ No newline at end of file diff --git a/asg/tests/fail/function/array_input.leo b/asg/tests/fail/function/array_input.leo index a70483cae7..899c0e4af6 100644 --- a/asg/tests/fail/function/array_input.leo +++ b/asg/tests/fail/function/array_input.leo @@ -1,6 +1,6 @@ function foo(a: [u8; 1]) {} function main() { - let a: [u16; 1] = [1; 1]; + const a: [u16; 1] = [1; 1]; foo(a); } \ No newline at end of file diff --git a/asg/tests/fail/function/multiple_returns_fail_conditional.leo b/asg/tests/fail/function/multiple_returns_fail_conditional.leo index 04ebb9e306..227fe5ce12 100644 --- a/asg/tests/fail/function/multiple_returns_fail_conditional.leo +++ b/asg/tests/fail/function/multiple_returns_fail_conditional.leo @@ -1,7 +1,7 @@ function main () -> u16 { if false { - let a = 1u16; - let b = a + 1u16; + const a = 1u16; + const b = a + 1u16; return b } else if false { return 0u16 diff --git a/asg/tests/fail/function/return_array_nested_fail.leo b/asg/tests/fail/function/return_array_nested_fail.leo index dca001d9cc..8eca684b8a 100644 --- a/asg/tests/fail/function/return_array_nested_fail.leo +++ b/asg/tests/fail/function/return_array_nested_fail.leo @@ -3,5 +3,5 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let b = array_3x2_tuple(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/asg/tests/fail/function/return_array_tuple_fail.leo b/asg/tests/fail/function/return_array_tuple_fail.leo index 4b7377e327..c960456ac1 100644 --- a/asg/tests/fail/function/return_array_tuple_fail.leo +++ b/asg/tests/fail/function/return_array_tuple_fail.leo @@ -3,5 +3,5 @@ function array_3x2_nested() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); + const a = array_3x2_nested(); } \ No newline at end of file diff --git a/asg/tests/fail/function/scope_fail.leo b/asg/tests/fail/function/scope_fail.leo index 773c2479d7..6f1d390541 100644 --- a/asg/tests/fail/function/scope_fail.leo +++ b/asg/tests/fail/function/scope_fail.leo @@ -3,6 +3,6 @@ function foo() -> field { } function main() { - let myGlobal = 42field; - let err = foo(); + const myGlobal = 42field; + const err = foo(); } \ No newline at end of file diff --git a/asg/tests/fail/group/both_sign_high.leo b/asg/tests/fail/group/both_sign_high.leo index a8217d6d40..4c93573e1e 100644 --- a/asg/tests/fail/group/both_sign_high.leo +++ b/asg/tests/fail/group/both_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, +)group; + const element = (+, +)group; } \ No newline at end of file diff --git a/asg/tests/fail/group/both_sign_inferred.leo b/asg/tests/fail/group/both_sign_inferred.leo index b3b8b512c3..0bbd360ba0 100644 --- a/asg/tests/fail/group/both_sign_inferred.leo +++ b/asg/tests/fail/group/both_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, _)group; + const element = (_, _)group; } \ No newline at end of file diff --git a/asg/tests/fail/group/both_sign_low.leo b/asg/tests/fail/group/both_sign_low.leo index 0519c6d17d..1cb4f46c55 100644 --- a/asg/tests/fail/group/both_sign_low.leo +++ b/asg/tests/fail/group/both_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, -)group; + const element = (-, -)group; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i128/max_fail.leo b/asg/tests/fail/integers/i128/max_fail.leo index 820eda8759..a9a46afd7f 100644 --- a/asg/tests/fail/integers/i128/max_fail.leo +++ b/asg/tests/fail/integers/i128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105728; + const a: i128 = 170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i128/min_fail.leo b/asg/tests/fail/integers/i128/min_fail.leo index 9035444fa9..918f0e439d 100644 --- a/asg/tests/fail/integers/i128/min_fail.leo +++ b/asg/tests/fail/integers/i128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105729; + const a: i128 = -170141183460469231731687303715884105729; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i128/negate_min.leo b/asg/tests/fail/integers/i128/negate_min.leo index cfbd308362..c9de272960 100644 --- a/asg/tests/fail/integers/i128/negate_min.leo +++ b/asg/tests/fail/integers/i128/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; - let b = -a; + const a: i128 = -170141183460469231731687303715884105728; + const b = -a; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i16/max_fail.leo b/asg/tests/fail/integers/i16/max_fail.leo index 8dd2b7f50a..209bcc6518 100644 --- a/asg/tests/fail/integers/i16/max_fail.leo +++ b/asg/tests/fail/integers/i16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32768; + const a: i16 = 32768; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i16/min_fail.leo b/asg/tests/fail/integers/i16/min_fail.leo index 380848381a..13d7c8b7f2 100644 --- a/asg/tests/fail/integers/i16/min_fail.leo +++ b/asg/tests/fail/integers/i16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32769; + const a: i16 = -32769; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i16/negate_min.leo b/asg/tests/fail/integers/i16/negate_min.leo index 2622f8d2a3..d52a356396 100644 --- a/asg/tests/fail/integers/i16/negate_min.leo +++ b/asg/tests/fail/integers/i16/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -32768i16; - let b = -a; + const a = -32768i16; + const b = -a; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i32/max_fail.leo b/asg/tests/fail/integers/i32/max_fail.leo index f3fd81815f..af2877ff5e 100644 --- a/asg/tests/fail/integers/i32/max_fail.leo +++ b/asg/tests/fail/integers/i32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483648; + const a: i32 = 2147483648; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i32/min_fail.leo b/asg/tests/fail/integers/i32/min_fail.leo index 1462d207e9..11a683b087 100644 --- a/asg/tests/fail/integers/i32/min_fail.leo +++ b/asg/tests/fail/integers/i32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483649; + const a: i32 = -2147483649; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i32/negate_min.leo b/asg/tests/fail/integers/i32/negate_min.leo index b3c10064e1..a96455d57a 100644 --- a/asg/tests/fail/integers/i32/negate_min.leo +++ b/asg/tests/fail/integers/i32/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -2147483648i32; - let b = -a; + const a = -2147483648i32; + const b = -a; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i64/max_fail.leo b/asg/tests/fail/integers/i64/max_fail.leo index 3e6603e4be..362b794a2c 100644 --- a/asg/tests/fail/integers/i64/max_fail.leo +++ b/asg/tests/fail/integers/i64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775808; + const a: i64 = 9223372036854775808; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i64/min_fail.leo b/asg/tests/fail/integers/i64/min_fail.leo index 11e43646b0..bb260ecc3f 100644 --- a/asg/tests/fail/integers/i64/min_fail.leo +++ b/asg/tests/fail/integers/i64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775809; + const a: i64 = -9223372036854775809; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i64/negate_min.leo b/asg/tests/fail/integers/i64/negate_min.leo index 4dd27778d0..daf694491b 100644 --- a/asg/tests/fail/integers/i64/negate_min.leo +++ b/asg/tests/fail/integers/i64/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i64 = -9223372036854775808; - let b = -a; + const a: i64 = -9223372036854775808; + const b = -a; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i8/max_fail.leo b/asg/tests/fail/integers/i8/max_fail.leo index 4892505915..9e1956024a 100644 --- a/asg/tests/fail/integers/i8/max_fail.leo +++ b/asg/tests/fail/integers/i8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 128; + const a: i8 = 128; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i8/min_fail.leo b/asg/tests/fail/integers/i8/min_fail.leo index 051468ea70..41170e9b93 100644 --- a/asg/tests/fail/integers/i8/min_fail.leo +++ b/asg/tests/fail/integers/i8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -129; + const a: i8 = -129; } \ No newline at end of file diff --git a/asg/tests/fail/integers/i8/negate_min.leo b/asg/tests/fail/integers/i8/negate_min.leo index 3959da615e..7f664a1b78 100644 --- a/asg/tests/fail/integers/i8/negate_min.leo +++ b/asg/tests/fail/integers/i8/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -128i8; - let b = -a; + const a = -128i8; + const b = -a; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u128/max_fail.leo b/asg/tests/fail/integers/u128/max_fail.leo index 40cdf7d2bb..f51c967925 100644 --- a/asg/tests/fail/integers/u128/max_fail.leo +++ b/asg/tests/fail/integers/u128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211456; + const a: u128 = 340282366920938463463374607431768211456; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u128/min_fail.leo b/asg/tests/fail/integers/u128/min_fail.leo index df2390c576..b0d17191ff 100644 --- a/asg/tests/fail/integers/u128/min_fail.leo +++ b/asg/tests/fail/integers/u128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = -1; + const a: u128 = -1; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u16/max_fail.leo b/asg/tests/fail/integers/u16/max_fail.leo index 68ff0481e0..bb703210e3 100644 --- a/asg/tests/fail/integers/u16/max_fail.leo +++ b/asg/tests/fail/integers/u16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65536; + const a: u16 = 65536; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u16/min_fail.leo b/asg/tests/fail/integers/u16/min_fail.leo index 99b7310362..0c61dd7ddf 100644 --- a/asg/tests/fail/integers/u16/min_fail.leo +++ b/asg/tests/fail/integers/u16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = -1; + const a: u16 = -1; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u32/max_fail.leo b/asg/tests/fail/integers/u32/max_fail.leo index 96c7e01657..6b1631876e 100644 --- a/asg/tests/fail/integers/u32/max_fail.leo +++ b/asg/tests/fail/integers/u32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967296; + const a: u32 = 4294967296; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u32/min_fail.leo b/asg/tests/fail/integers/u32/min_fail.leo index a8d41c475a..c3e3f33225 100644 --- a/asg/tests/fail/integers/u32/min_fail.leo +++ b/asg/tests/fail/integers/u32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = -1; + const a: u32 = -1; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u64/max_fail.leo b/asg/tests/fail/integers/u64/max_fail.leo index 0ca3f13895..d606c83585 100644 --- a/asg/tests/fail/integers/u64/max_fail.leo +++ b/asg/tests/fail/integers/u64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551616; + const a: u64 = 18446744073709551616; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u64/min_fail.leo b/asg/tests/fail/integers/u64/min_fail.leo index 81b90cc74a..e58f1897e6 100644 --- a/asg/tests/fail/integers/u64/min_fail.leo +++ b/asg/tests/fail/integers/u64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = -1; + const a: u64 = -1; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u8/max_fail.leo b/asg/tests/fail/integers/u8/max_fail.leo index f2b870096d..01bb544601 100644 --- a/asg/tests/fail/integers/u8/max_fail.leo +++ b/asg/tests/fail/integers/u8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 256; + const a: u8 = 256; } \ No newline at end of file diff --git a/asg/tests/fail/integers/u8/min_fail.leo b/asg/tests/fail/integers/u8/min_fail.leo index 7b91dc6e1a..3cd8d46de7 100644 --- a/asg/tests/fail/integers/u8/min_fail.leo +++ b/asg/tests/fail/integers/u8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = -1; + const a: u8 = -1; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/array.leo b/asg/tests/fail/mutability/array.leo index 1d51c15271..ea63baaad2 100644 --- a/asg/tests/fail/mutability/array.leo +++ b/asg/tests/fail/mutability/array.leo @@ -1,5 +1,5 @@ // Arrays are immutable by default. function main() { - let a = [1u32]; + const a = [1u32]; a[0] = 0; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/circuit.leo b/asg/tests/fail/mutability/circuit.leo index be1c568836..508595ef16 100644 --- a/asg/tests/fail/mutability/circuit.leo +++ b/asg/tests/fail/mutability/circuit.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let a = Foo { x: 1 }; + const a = Foo { x: 1 }; a.x = 0; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/circuit_function_mut.leo b/asg/tests/fail/mutability/circuit_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/asg/tests/fail/mutability/circuit_function_mut.leo +++ b/asg/tests/fail/mutability/circuit_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/circuit_static_function_mut.leo b/asg/tests/fail/mutability/circuit_static_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/asg/tests/fail/mutability/circuit_static_function_mut.leo +++ b/asg/tests/fail/mutability/circuit_static_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/const.leo b/asg/tests/fail/mutability/const.leo index d2a3a6ac2b..6201e7c5af 100644 --- a/asg/tests/fail/mutability/const.leo +++ b/asg/tests/fail/mutability/const.leo @@ -1,5 +1,5 @@ // Let variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/asg/tests/fail/mutability/let.leo b/asg/tests/fail/mutability/let.leo index 477e6b35f5..105730adb7 100644 --- a/asg/tests/fail/mutability/let.leo +++ b/asg/tests/fail/mutability/let.leo @@ -1,5 +1,5 @@ // Variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/asg/tests/fail/statements/const_declaration_fail.leo b/asg/tests/fail/statements/const_declaration_fail.leo deleted file mode 100644 index 1c7afb178a..0000000000 --- a/asg/tests/fail/statements/const_declaration_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const x = 1u32; -} \ No newline at end of file diff --git a/asg/tests/fail/statements/let_mut_declaration_fail.leo b/asg/tests/fail/statements/let_mut_declaration_fail.leo new file mode 100644 index 0000000000..ea80a7bc0d --- /dev/null +++ b/asg/tests/fail/statements/let_mut_declaration_fail.leo @@ -0,0 +1,3 @@ +function main() { + let mut x = 1u32; +} \ No newline at end of file diff --git a/asg/tests/fail/statements/mod.rs b/asg/tests/fail/statements/mod.rs index 6f6c3021dd..106af9dfe7 100644 --- a/asg/tests/fail/statements/mod.rs +++ b/asg/tests/fail/statements/mod.rs @@ -23,7 +23,7 @@ fn test_num_returns_fail() { } #[test] -fn test_const_declaration_fail() { - let program_string = include_str!("const_declaration_fail.leo"); +fn test_let_mut_declaration_fail() { + let program_string = include_str!("let_mut_declaration_fail.leo"); load_asg(program_string).err().unwrap(); } diff --git a/asg/tests/pass/address/console_assert_pass.leo b/asg/tests/pass/address/console_assert_pass.leo index 60ea4a79cd..f17d7d8c05 100644 --- a/asg/tests/pass/address/console_assert_pass.leo +++ b/asg/tests/pass/address/console_assert_pass.leo @@ -1,6 +1,6 @@ function main() { - let address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(address_1 == address_2); } \ No newline at end of file diff --git a/asg/tests/pass/address/implicit_invalid.leo b/asg/tests/pass/address/implicit_invalid.leo index 6f8eba5114..aadc38a6d8 100644 --- a/asg/tests/pass/address/implicit_invalid.leo +++ b/asg/tests/pass/address/implicit_invalid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/asg/tests/pass/address/implicit_valid.leo b/asg/tests/pass/address/implicit_valid.leo index df6ebf497d..75bcbaa8a1 100644 --- a/asg/tests/pass/address/implicit_valid.leo +++ b/asg/tests/pass/address/implicit_valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/asg/tests/pass/address/input.leo b/asg/tests/pass/address/input.leo index 795deac98b..29519f0334 100644 --- a/asg/tests/pass/address/input.leo +++ b/asg/tests/pass/address/input.leo @@ -1,5 +1,5 @@ function main(owner: address) { - let sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(owner == sender); } \ No newline at end of file diff --git a/asg/tests/pass/address/ternary.leo b/asg/tests/pass/address/ternary.leo index bdd88b9d92..dc87153d2d 100644 --- a/asg/tests/pass/address/ternary.leo +++ b/asg/tests/pass/address/ternary.leo @@ -1,8 +1,8 @@ function main(s: bool, c: address) { - let a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); + const a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); - let r = s? a: b; + const r = s? a: b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/address/valid.leo b/asg/tests/pass/address/valid.leo index f06aefdaa6..18f1682526 100644 --- a/asg/tests/pass/address/valid.leo +++ b/asg/tests/pass/address/valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); } \ No newline at end of file diff --git a/asg/tests/pass/array/implicit.leo b/asg/tests/pass/array/implicit.leo index a7077c8389..cfb4281e35 100644 --- a/asg/tests/pass/array/implicit.leo +++ b/asg/tests/pass/array/implicit.leo @@ -1,6 +1,6 @@ function main(){ - let a = [1u8, 2u8, 3u8, 4]; - let b = [1u8, 2u8, 3, 4u8]; - let c = [1u8, 2, 3u8, 4u8]; - let d = [1, 2u8, 3u8, 4u8]; + const a = [1u8, 2u8, 3u8, 4]; + const b = [1u8, 2u8, 3, 4u8]; + const c = [1u8, 2, 3u8, 4u8]; + const d = [1, 2u8, 3u8, 4u8]; } \ No newline at end of file diff --git a/asg/tests/pass/array/index_u8.leo b/asg/tests/pass/array/index_u8.leo index 7ad1c6a9ea..24d52ba82e 100644 --- a/asg/tests/pass/array/index_u8.leo +++ b/asg/tests/pass/array/index_u8.leo @@ -1,5 +1,5 @@ function main() { - let x = 0u8; - let a = [0u8; 4]; + const x = 0u8; + const a = [0u8; 4]; console.assert(a[x] == 0); } diff --git a/asg/tests/pass/array/multi_initializer.leo b/asg/tests/pass/array/multi_initializer.leo index 7257999ddf..6133542ef0 100644 --- a/asg/tests/pass/array/multi_initializer.leo +++ b/asg/tests/pass/array/multi_initializer.leo @@ -1,7 +1,7 @@ function main() { - let a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; + const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; - let b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; + const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/nested_3x2_value.leo b/asg/tests/pass/array/nested_3x2_value.leo index b69ddffb89..c5f64c997e 100644 --- a/asg/tests/pass/array/nested_3x2_value.leo +++ b/asg/tests/pass/array/nested_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/slice.leo b/asg/tests/pass/array/slice.leo index 296f5bd050..9ff83dbbb8 100644 --- a/asg/tests/pass/array/slice.leo +++ b/asg/tests/pass/array/slice.leo @@ -1,6 +1,6 @@ // `{from}..{to}` copies the elements of one array into another exclusively function main(a: [u8; 3]) { - let b = [1u8; 4]; + const b = [1u8; 4]; console.assert(a == b[0..3]); } diff --git a/asg/tests/pass/array/slice_i8.leo b/asg/tests/pass/array/slice_i8.leo index bc3d884cc6..18f090e6f0 100644 --- a/asg/tests/pass/array/slice_i8.leo +++ b/asg/tests/pass/array/slice_i8.leo @@ -1,6 +1,6 @@ // `{from}..{to}` copies the elements of one array into another exclusively function main(a: [u8; 3]) { - let b = [1u8; 4]; + const b = [1u8; 4]; console.assert(a == b[0u8..3i8]); } diff --git a/asg/tests/pass/array/slice_lower.leo b/asg/tests/pass/array/slice_lower.leo index dd669830ea..0af6fbd937 100644 --- a/asg/tests/pass/array/slice_lower.leo +++ b/asg/tests/pass/array/slice_lower.leo @@ -1,8 +1,8 @@ function main() { - let arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - let expected: [u32; 2] = [0, 1]; + const arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + const expected: [u32; 2] = [0, 1]; - let actual = arr[..2]; // Should produce [0, 1] + const actual = arr[..2]; // Should produce [0, 1] console.assert(expected == actual); } \ No newline at end of file diff --git a/asg/tests/pass/array/spread.leo b/asg/tests/pass/array/spread.leo index 962e92c923..8bd2861aae 100644 --- a/asg/tests/pass/array/spread.leo +++ b/asg/tests/pass/array/spread.leo @@ -1,7 +1,7 @@ // A spread operator `...` copies the elements of one array into another function main(a: [u8; 3]) { - let b = [1u8, 1u8]; - let c = [1u8, ...b]; + const b = [1u8, 1u8]; + const c = [1u8, ...b]; console.assert(a == c); } \ No newline at end of file diff --git a/asg/tests/pass/array/tuple_3x2_value.leo b/asg/tests/pass/array/tuple_3x2_value.leo index dc9128c51e..b6659539d5 100644 --- a/asg/tests/pass/array/tuple_3x2_value.leo +++ b/asg/tests/pass/array/tuple_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_input_3x2.leo b/asg/tests/pass/array/type_input_3x2.leo index 40781415c1..ea60a0cc24 100644 --- a/asg/tests/pass/array/type_input_3x2.leo +++ b/asg/tests/pass/array/type_input_3x2.leo @@ -1,5 +1,5 @@ function main(a: [[u8; 2]; 3]) { - let b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_input_4x3x2.leo b/asg/tests/pass/array/type_input_4x3x2.leo index bd75514904..2d9c4cff22 100644 --- a/asg/tests/pass/array/type_input_4x3x2.leo +++ b/asg/tests/pass/array/type_input_4x3x2.leo @@ -1,5 +1,5 @@ function main(a: [[[u8; 2]; 3]; 4]) { - let b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline diff --git a/asg/tests/pass/array/type_nested_value_nested_3x2.leo b/asg/tests/pass/array/type_nested_value_nested_3x2.leo index 341b9ead9c..bcf5bae674 100644 --- a/asg/tests/pass/array/type_nested_value_nested_3x2.leo +++ b/asg/tests/pass/array/type_nested_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer + const b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_nested_value_nested_4x3x2.leo b/asg/tests/pass/array/type_nested_value_nested_4x3x2.leo index 5ba24a381b..1691fa26c7 100644 --- a/asg/tests/pass/array/type_nested_value_nested_4x3x2.leo +++ b/asg/tests/pass/array/type_nested_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer + const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_nested_value_tuple_3x2.leo b/asg/tests/pass/array/type_nested_value_tuple_3x2.leo index c6fac9ec64..5f14084d55 100644 --- a/asg/tests/pass/array/type_nested_value_tuple_3x2.leo +++ b/asg/tests/pass/array/type_nested_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer + const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_nested_value_tuple_4x3x2.leo b/asg/tests/pass/array/type_nested_value_tuple_4x3x2.leo index 9be45de408..88a5143bd2 100644 --- a/asg/tests/pass/array/type_nested_value_tuple_4x3x2.leo +++ b/asg/tests/pass/array/type_nested_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer + const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_tuple_value_nested_3x2.leo b/asg/tests/pass/array/type_tuple_value_nested_3x2.leo index 4e061c4309..81195e03a1 100644 --- a/asg/tests/pass/array/type_tuple_value_nested_3x2.leo +++ b/asg/tests/pass/array/type_tuple_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_tuple_value_nested_4x3x2.leo b/asg/tests/pass/array/type_tuple_value_nested_4x3x2.leo index d9dc698784..322a6f7601 100644 --- a/asg/tests/pass/array/type_tuple_value_nested_4x3x2.leo +++ b/asg/tests/pass/array/type_tuple_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer + const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_tuple_value_tuple_3x2.leo b/asg/tests/pass/array/type_tuple_value_tuple_3x2.leo index b0693f7667..d451a9c1a8 100644 --- a/asg/tests/pass/array/type_tuple_value_tuple_3x2.leo +++ b/asg/tests/pass/array/type_tuple_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/array/type_tuple_value_tuple_4x3x2.leo b/asg/tests/pass/array/type_tuple_value_tuple_4x3x2.leo index cdc1bc961e..1205b1dc9c 100644 --- a/asg/tests/pass/array/type_tuple_value_tuple_4x3x2.leo +++ b/asg/tests/pass/array/type_tuple_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer + const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/all.leo b/asg/tests/pass/boolean/all.leo index 29a3815881..64fe8a795a 100644 --- a/asg/tests/pass/boolean/all.leo +++ b/asg/tests/pass/boolean/all.leo @@ -1,8 +1,8 @@ // !(true && (false || true)) function main() { - let a = true; - let b = false || a; - let c = !(true && b); + const a = true; + const b = false || a; + const c = !(true && b); console.assert(c == false); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/false_and_false.leo b/asg/tests/pass/boolean/false_and_false.leo index 70e4b0797b..03dfabab4d 100644 --- a/asg/tests/pass/boolean/false_and_false.leo +++ b/asg/tests/pass/boolean/false_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false && false; + const a = false && false; console.assert(a == false); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/false_or_false.leo b/asg/tests/pass/boolean/false_or_false.leo index 4ae820254e..7ea710802c 100644 --- a/asg/tests/pass/boolean/false_or_false.leo +++ b/asg/tests/pass/boolean/false_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false || false; + const a = false || false; console.assert(a == false); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/not_mutable.leo b/asg/tests/pass/boolean/not_mutable.leo index 91a6e5ff37..c621647ff9 100644 --- a/asg/tests/pass/boolean/not_mutable.leo +++ b/asg/tests/pass/boolean/not_mutable.leo @@ -1,4 +1,4 @@ function main () { - let mut b = false; - let a = !b; + let b = false; + const a = !b; } \ No newline at end of file diff --git a/asg/tests/pass/boolean/true_and_false.leo b/asg/tests/pass/boolean/true_and_false.leo index 3c7c484603..336dde7558 100644 --- a/asg/tests/pass/boolean/true_and_false.leo +++ b/asg/tests/pass/boolean/true_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true && false; + const a = true && false; console.assert(a == false); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/true_and_true.leo b/asg/tests/pass/boolean/true_and_true.leo index c378e50024..dae445dcf8 100644 --- a/asg/tests/pass/boolean/true_and_true.leo +++ b/asg/tests/pass/boolean/true_and_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true && true; + const a = true && true; console.assert(a == true); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/true_or_false.leo b/asg/tests/pass/boolean/true_or_false.leo index d643a96aa1..216e473cdb 100644 --- a/asg/tests/pass/boolean/true_or_false.leo +++ b/asg/tests/pass/boolean/true_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true || false; + const a = true || false; console.assert(a == true); } \ No newline at end of file diff --git a/asg/tests/pass/boolean/true_or_true.leo b/asg/tests/pass/boolean/true_or_true.leo index b8eaa91ff1..fea8628b9f 100644 --- a/asg/tests/pass/boolean/true_or_true.leo +++ b/asg/tests/pass/boolean/true_or_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true || true; + const a = true || true; console.assert(a == true); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/define_circuit_inside_circuit_function.leo b/asg/tests/pass/circuits/define_circuit_inside_circuit_function.leo index 8c25c1e9d9..cedabf2185 100644 --- a/asg/tests/pass/circuits/define_circuit_inside_circuit_function.leo +++ b/asg/tests/pass/circuits/define_circuit_inside_circuit_function.leo @@ -4,10 +4,10 @@ circuit Foo { circuit Bar { function bar() { - let f = Foo { a: 0u32 }; + const f = Foo { a: 0u32 }; } } function main() { - let b = Bar::bar(); + const b = Bar::bar(); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/inline.leo b/asg/tests/pass/circuits/inline.leo index 8e214c729a..9ba06f4191 100644 --- a/asg/tests/pass/circuits/inline.leo +++ b/asg/tests/pass/circuits/inline.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; } \ No newline at end of file diff --git a/asg/tests/pass/circuits/member_function.leo b/asg/tests/pass/circuits/member_function.leo index 3c9aa1aa60..4e50e97195 100644 --- a/asg/tests/pass/circuits/member_function.leo +++ b/asg/tests/pass/circuits/member_function.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let a = Foo { }; + const a = Foo { }; console.assert(a.echo(1u32) == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/member_function_nested.leo b/asg/tests/pass/circuits/member_function_nested.leo index 9e07cc9acf..e512c9df52 100644 --- a/asg/tests/pass/circuits/member_function_nested.leo +++ b/asg/tests/pass/circuits/member_function_nested.leo @@ -11,8 +11,8 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; - let b = a.add_x(1u32); + const a = Foo { x: 1u32 }; + const b = a.add_x(1u32); console.assert(b == 2u32); } diff --git a/asg/tests/pass/circuits/member_static_function.leo b/asg/tests/pass/circuits/member_static_function.leo index 4bf51190f0..9d53314f27 100644 --- a/asg/tests/pass/circuits/member_static_function.leo +++ b/asg/tests/pass/circuits/member_static_function.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let a = Foo::echo(1u32); + const a = Foo::echo(1u32); console.assert(a == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/member_variable.leo b/asg/tests/pass/circuits/member_variable.leo index 0dd35f2aec..a3f3fbe7e6 100644 --- a/asg/tests/pass/circuits/member_variable.leo +++ b/asg/tests/pass/circuits/member_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/member_variable_and_function.leo b/asg/tests/pass/circuits/member_variable_and_function.leo index 074feab7b8..3b90db7eaa 100644 --- a/asg/tests/pass/circuits/member_variable_and_function.leo +++ b/asg/tests/pass/circuits/member_variable_and_function.leo @@ -7,9 +7,9 @@ circuit Foo { } function main() { - let a = Foo { foo: 1 }; + const a = Foo { foo: 1 }; - let b = a.foo + Foo::bar(); + const b = a.foo + Foo::bar(); console.assert(b == 2u32); } diff --git a/asg/tests/pass/circuits/mod.rs b/asg/tests/pass/circuits/mod.rs index 811eedd2d4..ee2315b6f7 100644 --- a/asg/tests/pass/circuits/mod.rs +++ b/asg/tests/pass/circuits/mod.rs @@ -54,7 +54,7 @@ fn test_mut_member_function() { } function main() { - let mut a = Foo { }; + let a = Foo { }; console.assert(a.echo(1u32) == 1u32); }"#; diff --git a/asg/tests/pass/circuits/mut_self_variable.leo b/asg/tests/pass/circuits/mut_self_variable.leo index f5a35ec754..92bcca0050 100644 --- a/asg/tests/pass/circuits/mut_self_variable.leo +++ b/asg/tests/pass/circuits/mut_self_variable.leo @@ -8,7 +8,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/asg/tests/pass/circuits/mut_self_variable_conditional.leo b/asg/tests/pass/circuits/mut_self_variable_conditional.leo index 74345afcb4..61a5e354dc 100644 --- a/asg/tests/pass/circuits/mut_self_variable_conditional.leo +++ b/asg/tests/pass/circuits/mut_self_variable_conditional.leo @@ -1,5 +1,5 @@ function main() { - let mut f = Foo { a: 0u32 }; + let f = Foo { a: 0u32 }; f.bar(); } diff --git a/asg/tests/pass/circuits/mut_variable.leo b/asg/tests/pass/circuits/mut_variable.leo index 243d7a2cf2..151babb1cd 100644 --- a/asg/tests/pass/circuits/mut_variable.leo +++ b/asg/tests/pass/circuits/mut_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/asg/tests/pass/circuits/pedersen_mock.leo b/asg/tests/pass/circuits/pedersen_mock.leo index 559ebb7614..4abef65caa 100644 --- a/asg/tests/pass/circuits/pedersen_mock.leo +++ b/asg/tests/pass/circuits/pedersen_mock.leo @@ -6,9 +6,9 @@ circuit PedersenHash { } function hash(self, bits: [bool; 512]) -> u32 { - let mut digest: u32 = 0; + let digest: u32 = 0; for i in 0..512 { - let base = bits[i] ? self.parameters[i] : 0u32; + const base = bits[i] ? self.parameters[i] : 0u32; digest += base; } return digest @@ -17,11 +17,11 @@ circuit PedersenHash { // The 'pedersen_hash' main function. function main() { - let parameters = [0u32; 512]; - let pedersen = PedersenHash::new(parameters); - let hash_input: [bool; 512] = [true; 512]; + const parameters = [0u32; 512]; + const pedersen = PedersenHash::new(parameters); + const hash_input: [bool; 512] = [true; 512]; - let res = pedersen.hash(hash_input); + const res = pedersen.hash(hash_input); console.assert(res == 0u32); } diff --git a/asg/tests/pass/circuits/self_circuit.leo b/asg/tests/pass/circuits/self_circuit.leo index 5a1d6c63be..18329433f7 100644 --- a/asg/tests/pass/circuits/self_circuit.leo +++ b/asg/tests/pass/circuits/self_circuit.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let a = Foo::new(); + const a = Foo::new(); } \ No newline at end of file diff --git a/asg/tests/pass/circuits/self_member.leo b/asg/tests/pass/circuits/self_member.leo index 1bd978433d..2b3401a228 100644 --- a/asg/tests/pass/circuits/self_member.leo +++ b/asg/tests/pass/circuits/self_member.leo @@ -7,8 +7,8 @@ circuit Foo { } function main() { - let a = Foo { f: 1u32 }; - let b = a.bar(); + const a = Foo { f: 1u32 }; + const b = a.bar(); console.assert(b == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/core/blake2s_random.leo b/asg/tests/pass/core/blake2s_random.leo index 72aef44932..c9592fcbf8 100644 --- a/asg/tests/pass/core/blake2s_random.leo +++ b/asg/tests/pass/core/blake2s_random.leo @@ -1,7 +1,7 @@ import core.unstable.blake2s.Blake2s; function main(seed: [u8; 32], message: [u8; 32], expected: [u8; 32]) { - let actual = Blake2s::hash(seed, message); + const actual = Blake2s::hash(seed, message); console.assert(expected == actual); } diff --git a/asg/tests/pass/core/unstable_blake2s.leo b/asg/tests/pass/core/unstable_blake2s.leo index ca7db13892..c430d9a837 100644 --- a/asg/tests/pass/core/unstable_blake2s.leo +++ b/asg/tests/pass/core/unstable_blake2s.leo @@ -1,10 +1,10 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; - let message: [u8; 32] = [0; 32]; + const seed: [u8; 32] = [0; 32]; + const message: [u8; 32] = [0; 32]; - let result = Blake2s::hash(seed, message); + const result = Blake2s::hash(seed, message); console.log("Result: {}", result); } diff --git a/asg/tests/pass/field/ternary.leo b/asg/tests/pass/field/ternary.leo index f193ad82a3..05cb161b46 100644 --- a/asg/tests/pass/field/ternary.leo +++ b/asg/tests/pass/field/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: field, b: field, c: field) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/form_ast.rs b/asg/tests/pass/form_ast.rs index c59e055c1e..3a012d9e14 100644 --- a/asg/tests/pass/form_ast.rs +++ b/asg/tests/pass/form_ast.rs @@ -30,7 +30,7 @@ fn test_basic() { fn test_function_rename() { let program_string = r#" function iteration() -> u32 { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += 1; @@ -40,7 +40,7 @@ fn test_function_rename() { } function main() { - let total = iteration() + iteration(); + const total = iteration() + iteration(); console.assert(total == 20); } diff --git a/asg/tests/pass/function/array_input.leo b/asg/tests/pass/function/array_input.leo index a70483cae7..899c0e4af6 100644 --- a/asg/tests/pass/function/array_input.leo +++ b/asg/tests/pass/function/array_input.leo @@ -1,6 +1,6 @@ function foo(a: [u8; 1]) {} function main() { - let a: [u16; 1] = [1; 1]; + const a: [u16; 1] = [1; 1]; foo(a); } \ No newline at end of file diff --git a/asg/tests/pass/function/iteration.leo b/asg/tests/pass/function/iteration.leo index 19af4dd9cf..b1fcee6964 100644 --- a/asg/tests/pass/function/iteration.leo +++ b/asg/tests/pass/function/iteration.leo @@ -3,7 +3,7 @@ function one() -> u32 { } function main() { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += one(); diff --git a/asg/tests/pass/function/iteration_repeated.leo b/asg/tests/pass/function/iteration_repeated.leo index 3694b3594a..d76380a6b5 100644 --- a/asg/tests/pass/function/iteration_repeated.leo +++ b/asg/tests/pass/function/iteration_repeated.leo @@ -1,5 +1,5 @@ function iteration() -> u32 { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += 1; @@ -9,7 +9,7 @@ function iteration() -> u32 { } function main() { - let total = iteration() + iteration(); + const total = iteration() + iteration(); console.assert(total == 20); } \ No newline at end of file diff --git a/asg/tests/pass/function/mod.rs b/asg/tests/pass/function/mod.rs index abdbd93b7c..3ae7434608 100644 --- a/asg/tests/pass/function/mod.rs +++ b/asg/tests/pass/function/mod.rs @@ -36,7 +36,7 @@ fn test_const_args() { } function main() { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += one(i); @@ -56,8 +56,8 @@ fn test_const_args_used() { } function main() { - let mut a = 0u8; - let arr = [1u8, 2, 3]; + let a = 0u8; + const arr = [1u8, 2, 3]; for i in 0..3 { a += index(arr, i); @@ -77,8 +77,8 @@ fn test_const_args_fail() { } function main(x_value: u32) { - let mut a = 0u8; - let arr = [1u8, 2, 3]; + let a = 0u8; + const arr = [1u8, 2, 3]; a += index(arr, x_value); diff --git a/asg/tests/pass/function/multiple_returns.leo b/asg/tests/pass/function/multiple_returns.leo index ef00a4ef47..d927c51976 100644 --- a/asg/tests/pass/function/multiple_returns.leo +++ b/asg/tests/pass/function/multiple_returns.leo @@ -3,7 +3,7 @@ function tuple() -> (bool, bool) { } function main() { - let (a, b) = tuple(); + const (a, b) = tuple(); console.assert(a == true); console.assert(b == false); diff --git a/asg/tests/pass/function/repeated.leo b/asg/tests/pass/function/repeated.leo index a2d04d55f9..f83fa6098b 100644 --- a/asg/tests/pass/function/repeated.leo +++ b/asg/tests/pass/function/repeated.leo @@ -3,7 +3,7 @@ function one() -> bool { } function main() { - let a = one() && one(); + const a = one() && one(); console.assert(a == true); } \ No newline at end of file diff --git a/asg/tests/pass/function/return_array_nested_pass.leo b/asg/tests/pass/function/return_array_nested_pass.leo index dda5b4342b..bfbfc8fd29 100644 --- a/asg/tests/pass/function/return_array_nested_pass.leo +++ b/asg/tests/pass/function/return_array_nested_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/asg/tests/pass/function/return_array_tuple_pass.leo b/asg/tests/pass/function/return_array_tuple_pass.leo index a700bcabad..4199e31990 100644 --- a/asg/tests/pass/function/return_array_tuple_pass.leo +++ b/asg/tests/pass/function/return_array_tuple_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/asg/tests/pass/function/return_tuple.leo b/asg/tests/pass/function/return_tuple.leo index c459740a47..a3b1bbc36a 100644 --- a/asg/tests/pass/function/return_tuple.leo +++ b/asg/tests/pass/function/return_tuple.leo @@ -1,11 +1,11 @@ // Returns a tuple of tuples. function tuples() -> ((u8, u8), u32) { - let a: (u8, u8) = (1, 2); - let b: u32 = 3; + const a: (u8, u8) = (1, 2); + const b: u32 = 3; return (a, b) } function main() { - let t = tuples(); + const t = tuples(); } \ No newline at end of file diff --git a/asg/tests/pass/function/return_tuple_conditional.leo b/asg/tests/pass/function/return_tuple_conditional.leo index c63967f548..839081b2a4 100644 --- a/asg/tests/pass/function/return_tuple_conditional.leo +++ b/asg/tests/pass/function/return_tuple_conditional.leo @@ -11,5 +11,5 @@ function tuple_conditional () -> ( } function main() { - let t = tuple_conditional(); + const t = tuple_conditional(); } \ No newline at end of file diff --git a/asg/tests/pass/function/value_unchanged.leo b/asg/tests/pass/function/value_unchanged.leo index 32dcfa62d6..936ff2ddcc 100644 --- a/asg/tests/pass/function/value_unchanged.leo +++ b/asg/tests/pass/function/value_unchanged.leo @@ -12,7 +12,7 @@ function bad_mutate(mut x: u32) { } function main() { - let a = 1u32; + const a = 1u32; bad_mutate(a); console.assert(a == 1u32); // <- value `a` is still `1u32` diff --git a/asg/tests/pass/group/both_sign_high.leo b/asg/tests/pass/group/both_sign_high.leo index a8217d6d40..4c93573e1e 100644 --- a/asg/tests/pass/group/both_sign_high.leo +++ b/asg/tests/pass/group/both_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, +)group; + const element = (+, +)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/both_sign_inferred.leo b/asg/tests/pass/group/both_sign_inferred.leo index b3b8b512c3..0bbd360ba0 100644 --- a/asg/tests/pass/group/both_sign_inferred.leo +++ b/asg/tests/pass/group/both_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, _)group; + const element = (_, _)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/both_sign_low.leo b/asg/tests/pass/group/both_sign_low.leo index 0519c6d17d..1cb4f46c55 100644 --- a/asg/tests/pass/group/both_sign_low.leo +++ b/asg/tests/pass/group/both_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, -)group; + const element = (-, -)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/one.leo b/asg/tests/pass/group/one.leo index 7be0cbbc2c..510110150b 100644 --- a/asg/tests/pass/group/one.leo +++ b/asg/tests/pass/group/one.leo @@ -1,3 +1,3 @@ function main() { - let element = 1group; + const element = 1group; } \ No newline at end of file diff --git a/asg/tests/pass/group/point.leo b/asg/tests/pass/group/point.leo index 85eeb53b7b..5e68415a0d 100644 --- a/asg/tests/pass/group/point.leo +++ b/asg/tests/pass/group/point.leo @@ -1,3 +1,3 @@ function main() { - let point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + const point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/point_input.leo b/asg/tests/pass/group/point_input.leo index 68d8c458a3..a3a8e63bd3 100644 --- a/asg/tests/pass/group/point_input.leo +++ b/asg/tests/pass/group/point_input.leo @@ -1,3 +1,3 @@ function main(a: group) { - let b = a; + const b = a; } \ No newline at end of file diff --git a/asg/tests/pass/group/ternary.leo b/asg/tests/pass/group/ternary.leo index fb69b74521..97fba1f5b6 100644 --- a/asg/tests/pass/group/ternary.leo +++ b/asg/tests/pass/group/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: group, b: group, c: group) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/group/x_and_y.leo b/asg/tests/pass/group/x_and_y.leo index 1b64702db1..a350a7ad6b 100644 --- a/asg/tests/pass/group/x_and_y.leo +++ b/asg/tests/pass/group/x_and_y.leo @@ -1,3 +1,3 @@ function main(element: group) { - let b = element; + const b = element; } \ No newline at end of file diff --git a/asg/tests/pass/group/x_sign_high.leo b/asg/tests/pass/group/x_sign_high.leo index 1b8d397d02..f38b54ad9a 100644 --- a/asg/tests/pass/group/x_sign_high.leo +++ b/asg/tests/pass/group/x_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, +)group; + const element = (0, +)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/x_sign_inferred.leo b/asg/tests/pass/group/x_sign_inferred.leo index 9e9622a4a4..02c5ac988b 100644 --- a/asg/tests/pass/group/x_sign_inferred.leo +++ b/asg/tests/pass/group/x_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, _)group; + const element = (0, _)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/x_sign_low.leo b/asg/tests/pass/group/x_sign_low.leo index a5058bda52..ad74d18b64 100644 --- a/asg/tests/pass/group/x_sign_low.leo +++ b/asg/tests/pass/group/x_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, -)group; + const element = (0, -)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/y_sign_high.leo b/asg/tests/pass/group/y_sign_high.leo index fe16883b39..af2a20149d 100644 --- a/asg/tests/pass/group/y_sign_high.leo +++ b/asg/tests/pass/group/y_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, 1)group; + const element = (+, 1)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/y_sign_inferred.leo b/asg/tests/pass/group/y_sign_inferred.leo index 003c373cf2..a4efa6a982 100644 --- a/asg/tests/pass/group/y_sign_inferred.leo +++ b/asg/tests/pass/group/y_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, 1)group; + const element = (_, 1)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/y_sign_low.leo b/asg/tests/pass/group/y_sign_low.leo index 9e61bfd2bb..f557ed0d35 100644 --- a/asg/tests/pass/group/y_sign_low.leo +++ b/asg/tests/pass/group/y_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, 1)group; + const element = (-, 1)group; } \ No newline at end of file diff --git a/asg/tests/pass/group/zero.leo b/asg/tests/pass/group/zero.leo index e2c0283c21..6cdd4c960e 100644 --- a/asg/tests/pass/group/zero.leo +++ b/asg/tests/pass/group/zero.leo @@ -1,3 +1,3 @@ function main() { - let element = 0group; + const element = 0group; } \ No newline at end of file diff --git a/asg/tests/pass/import/many_import.leo b/asg/tests/pass/import/many_import.leo index 5e85f19778..08ae494c4f 100644 --- a/asg/tests/pass/import/many_import.leo +++ b/asg/tests/pass/import/many_import.leo @@ -12,15 +12,15 @@ import bar.( // imports directory import import car.Car; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let baz = Baz { z: 1u32 }; - let bazzar = Bazzar { a: 1u32 }; - let bat = Bat { t: 1u32 }; + const bar = Bar { r: 1u32 }; + const baz = Baz { z: 1u32 }; + const bazzar = Bazzar { a: 1u32 }; + const bat = Bat { t: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/import/many_import_star.leo b/asg/tests/pass/import/many_import_star.leo index 5145d0d05d..575487a929 100644 --- a/asg/tests/pass/import/many_import_star.leo +++ b/asg/tests/pass/import/many_import_star.leo @@ -6,14 +6,14 @@ import bar.bat.bat.*; // imports directory import import car.*; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let bat = Bat { t: 1u32 }; - let baz = Baz { z: 1u32 }; + const bar = Bar { r: 1u32 }; + const bat = Bat { t: 1u32 }; + const baz = Baz { z: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/import/multiple.leo b/asg/tests/pass/import/multiple.leo index 5c89aaee0c..4bd181c02d 100644 --- a/asg/tests/pass/import/multiple.leo +++ b/asg/tests/pass/import/multiple.leo @@ -4,7 +4,7 @@ import test-import.( ); function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/import/star.leo b/asg/tests/pass/import/star.leo index 9cd817686f..69d0791627 100644 --- a/asg/tests/pass/import/star.leo +++ b/asg/tests/pass/import/star.leo @@ -1,7 +1,7 @@ import test-import.*; function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(foo() == 1u32); } \ No newline at end of file diff --git a/asg/tests/pass/input_files/program_state/access_all.leo b/asg/tests/pass/input_files/program_state/access_all.leo index 4e7cba5776..2a60f218aa 100644 --- a/asg/tests/pass/input_files/program_state/access_all.leo +++ b/asg/tests/pass/input_files/program_state/access_all.leo @@ -1,7 +1,7 @@ function main(input) { console.assert(input.state.root == [0u8; 32]); - let expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; //console.assert(input.record.owner, expected); console.assert(input.state_leaf.network_id == 0u8); diff --git a/asg/tests/pass/integers/i128/max.leo b/asg/tests/pass/integers/i128/max.leo index 46c0a32599..5ba44213e1 100644 --- a/asg/tests/pass/integers/i128/max.leo +++ b/asg/tests/pass/integers/i128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105727; + const a: i128 = 170141183460469231731687303715884105727; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i128/min.leo b/asg/tests/pass/integers/i128/min.leo index 5f32e5add5..19509a3fb0 100644 --- a/asg/tests/pass/integers/i128/min.leo +++ b/asg/tests/pass/integers/i128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; + const a: i128 = -170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i128/negate_zero.leo b/asg/tests/pass/integers/i128/negate_zero.leo index 9fb0c11afe..e079baf393 100644 --- a/asg/tests/pass/integers/i128/negate_zero.leo +++ b/asg/tests/pass/integers/i128/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i128; + const a = 0i128; console.assert(-a == 0i128); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i128/ternary.leo b/asg/tests/pass/integers/i128/ternary.leo index a923c428e6..3783463b22 100644 --- a/asg/tests/pass/integers/i128/ternary.leo +++ b/asg/tests/pass/integers/i128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i128, b: i128, c: i128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i16/max.leo b/asg/tests/pass/integers/i16/max.leo index 084fe4969a..2b70b3cc56 100644 --- a/asg/tests/pass/integers/i16/max.leo +++ b/asg/tests/pass/integers/i16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32767; + const a: i16 = 32767; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i16/min.leo b/asg/tests/pass/integers/i16/min.leo index 3331281fcf..3d05bef95a 100644 --- a/asg/tests/pass/integers/i16/min.leo +++ b/asg/tests/pass/integers/i16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32768; + const a: i16 = -32768; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i16/negate_zero.leo b/asg/tests/pass/integers/i16/negate_zero.leo index 46340c3dc5..20f8a4fba7 100644 --- a/asg/tests/pass/integers/i16/negate_zero.leo +++ b/asg/tests/pass/integers/i16/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i16; + const a = 0i16; console.assert(-a == 0i16); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i16/ternary.leo b/asg/tests/pass/integers/i16/ternary.leo index 4586b87bb4..d66c73cb93 100644 --- a/asg/tests/pass/integers/i16/ternary.leo +++ b/asg/tests/pass/integers/i16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i16, b: i16, c: i16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i32/max.leo b/asg/tests/pass/integers/i32/max.leo index a9c707eb7f..074c75f1a6 100644 --- a/asg/tests/pass/integers/i32/max.leo +++ b/asg/tests/pass/integers/i32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483647; + const a: i32 = 2147483647; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i32/min.leo b/asg/tests/pass/integers/i32/min.leo index a29d591029..8436268ce6 100644 --- a/asg/tests/pass/integers/i32/min.leo +++ b/asg/tests/pass/integers/i32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483648; + const a: i32 = -2147483648; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i32/negate_zero.leo b/asg/tests/pass/integers/i32/negate_zero.leo index 5533f575a6..a3807b1f8a 100644 --- a/asg/tests/pass/integers/i32/negate_zero.leo +++ b/asg/tests/pass/integers/i32/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i32; + const a = 0i32; console.assert(-a == 0i32); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i32/ternary.leo b/asg/tests/pass/integers/i32/ternary.leo index 7927c2998b..790769d62f 100644 --- a/asg/tests/pass/integers/i32/ternary.leo +++ b/asg/tests/pass/integers/i32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i32, b: i32, c: i32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i64/max.leo b/asg/tests/pass/integers/i64/max.leo index e0d19881e6..593f91e110 100644 --- a/asg/tests/pass/integers/i64/max.leo +++ b/asg/tests/pass/integers/i64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775807; + const a: i64 = 9223372036854775807; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i64/min.leo b/asg/tests/pass/integers/i64/min.leo index d7e99a87f8..794d8fbfac 100644 --- a/asg/tests/pass/integers/i64/min.leo +++ b/asg/tests/pass/integers/i64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775808; + const a: i64 = -9223372036854775808; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i64/negate_zero.leo b/asg/tests/pass/integers/i64/negate_zero.leo index 6badfe4dc7..81f09c19a3 100644 --- a/asg/tests/pass/integers/i64/negate_zero.leo +++ b/asg/tests/pass/integers/i64/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i64; + const a = 0i64; console.assert(-a == 0i64); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i64/ternary.leo b/asg/tests/pass/integers/i64/ternary.leo index 1a2d03a77f..df63b3ad6a 100644 --- a/asg/tests/pass/integers/i64/ternary.leo +++ b/asg/tests/pass/integers/i64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i64, b: i64, c: i64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i8/max.leo b/asg/tests/pass/integers/i8/max.leo index b51126da59..f20d59ddf4 100644 --- a/asg/tests/pass/integers/i8/max.leo +++ b/asg/tests/pass/integers/i8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 127; + const a: i8 = 127; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i8/min.leo b/asg/tests/pass/integers/i8/min.leo index d3c1bff5e4..7b6db025ea 100644 --- a/asg/tests/pass/integers/i8/min.leo +++ b/asg/tests/pass/integers/i8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -128; + const a: i8 = -128; } \ No newline at end of file diff --git a/asg/tests/pass/integers/i8/negate_zero.leo b/asg/tests/pass/integers/i8/negate_zero.leo index 21fbbab675..cc3f4a0828 100644 --- a/asg/tests/pass/integers/i8/negate_zero.leo +++ b/asg/tests/pass/integers/i8/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i8; + const a = 0i8; console.assert(-a == 0i8); } \ No newline at end of file diff --git a/asg/tests/pass/integers/i8/ternary.leo b/asg/tests/pass/integers/i8/ternary.leo index e1ec1943c9..0956a9cd39 100644 --- a/asg/tests/pass/integers/i8/ternary.leo +++ b/asg/tests/pass/integers/i8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i8, b: i8, c: i8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/u128/max.leo b/asg/tests/pass/integers/u128/max.leo index 6da59dd058..b166ede06b 100644 --- a/asg/tests/pass/integers/u128/max.leo +++ b/asg/tests/pass/integers/u128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211455; + const a: u128 = 340282366920938463463374607431768211455; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u128/min.leo b/asg/tests/pass/integers/u128/min.leo index 044bda9e1c..41fbf1a2fe 100644 --- a/asg/tests/pass/integers/u128/min.leo +++ b/asg/tests/pass/integers/u128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 0; + const a: u128 = 0; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u128/ternary.leo b/asg/tests/pass/integers/u128/ternary.leo index 22e2e67058..99a6b997e0 100644 --- a/asg/tests/pass/integers/u128/ternary.leo +++ b/asg/tests/pass/integers/u128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u128, b: u128, c: u128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/u16/max.leo b/asg/tests/pass/integers/u16/max.leo index a707df9af8..56cb2af18d 100644 --- a/asg/tests/pass/integers/u16/max.leo +++ b/asg/tests/pass/integers/u16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65535; + const a: u16 = 65535; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u16/min.leo b/asg/tests/pass/integers/u16/min.leo index ab1bd7db48..4dee94a1a4 100644 --- a/asg/tests/pass/integers/u16/min.leo +++ b/asg/tests/pass/integers/u16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 0; + const a: u16 = 0; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u16/ternary.leo b/asg/tests/pass/integers/u16/ternary.leo index 11d836570d..d6131f9f4f 100644 --- a/asg/tests/pass/integers/u16/ternary.leo +++ b/asg/tests/pass/integers/u16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u16, b: u16, c: u16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/u32/max.leo b/asg/tests/pass/integers/u32/max.leo index 2950164a08..4a07281b5d 100644 --- a/asg/tests/pass/integers/u32/max.leo +++ b/asg/tests/pass/integers/u32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967295; + const a: u32 = 4294967295; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u32/min.leo b/asg/tests/pass/integers/u32/min.leo index 0f1c080938..8077e0ec02 100644 --- a/asg/tests/pass/integers/u32/min.leo +++ b/asg/tests/pass/integers/u32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 0; + const a: u32 = 0; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u32/ternary.leo b/asg/tests/pass/integers/u32/ternary.leo index 3c96a7236c..f32ffc29fe 100644 --- a/asg/tests/pass/integers/u32/ternary.leo +++ b/asg/tests/pass/integers/u32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u32, b: u32, c: u32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/u64/max.leo b/asg/tests/pass/integers/u64/max.leo index 985897c006..f14ac7ce64 100644 --- a/asg/tests/pass/integers/u64/max.leo +++ b/asg/tests/pass/integers/u64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551615; + const a: u64 = 18446744073709551615; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u64/min.leo b/asg/tests/pass/integers/u64/min.leo index aa9b72fc8a..b1da40b14c 100644 --- a/asg/tests/pass/integers/u64/min.leo +++ b/asg/tests/pass/integers/u64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 0; + const a: u64 = 0; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u64/ternary.leo b/asg/tests/pass/integers/u64/ternary.leo index 4c4ddd8e0c..4427cd0466 100644 --- a/asg/tests/pass/integers/u64/ternary.leo +++ b/asg/tests/pass/integers/u64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u64, b: u64, c: u64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/integers/u8/max.leo b/asg/tests/pass/integers/u8/max.leo index 684bdfba10..03e82c9a5e 100644 --- a/asg/tests/pass/integers/u8/max.leo +++ b/asg/tests/pass/integers/u8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 255; + const a: u8 = 255; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u8/min.leo b/asg/tests/pass/integers/u8/min.leo index a88e33c5a6..1db08a07b5 100644 --- a/asg/tests/pass/integers/u8/min.leo +++ b/asg/tests/pass/integers/u8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 0; + const a: u8 = 0; } \ No newline at end of file diff --git a/asg/tests/pass/integers/u8/ternary.leo b/asg/tests/pass/integers/u8/ternary.leo index 1b436aa054..5123a511cd 100644 --- a/asg/tests/pass/integers/u8/ternary.leo +++ b/asg/tests/pass/integers/u8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u8, b: u8, c: u8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/asg/tests/pass/mutability/array_mut.leo b/asg/tests/pass/mutability/array_mut.leo index 1b86bac80f..5d4db3b68a 100644 --- a/asg/tests/pass/mutability/array_mut.leo +++ b/asg/tests/pass/mutability/array_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32]; + let a = [1u32]; a[0] = 0; console.assert(a[0] == 0u32); diff --git a/asg/tests/pass/mutability/array_splice_mut.leo b/asg/tests/pass/mutability/array_splice_mut.leo index 57cc67e872..d13216600a 100644 --- a/asg/tests/pass/mutability/array_splice_mut.leo +++ b/asg/tests/pass/mutability/array_splice_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32, 2u32, 3u32]; + let a = [1u32, 2u32, 3u32]; a[0u32..2u32] = [4u32, 5u32]; console.assert(a[0] == 4u32); diff --git a/asg/tests/pass/mutability/array_tuple_mut.leo b/asg/tests/pass/mutability/array_tuple_mut.leo index e0096bd7ac..ed323d46da 100644 --- a/asg/tests/pass/mutability/array_tuple_mut.leo +++ b/asg/tests/pass/mutability/array_tuple_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [(1u32, 2u32)]; + let a = [(1u32, 2u32)]; a[0u32].1 = 3u32; console.assert(a[0u32].0 == 1u32); diff --git a/asg/tests/pass/mutability/circuit_mut.leo b/asg/tests/pass/mutability/circuit_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/asg/tests/pass/mutability/circuit_mut.leo +++ b/asg/tests/pass/mutability/circuit_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/asg/tests/pass/mutability/circuit_variable_mut.leo b/asg/tests/pass/mutability/circuit_variable_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/asg/tests/pass/mutability/circuit_variable_mut.leo +++ b/asg/tests/pass/mutability/circuit_variable_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/asg/tests/pass/mutability/let_mut.leo b/asg/tests/pass/mutability/let_mut.leo index 5766d144d3..cd1060d0d2 100644 --- a/asg/tests/pass/mutability/let_mut.leo +++ b/asg/tests/pass/mutability/let_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes a variable mutable. function main() { - let mut a = 1u32; + let a = 1u32; a = 0; console.assert(a == 0u32); diff --git a/asg/tests/pass/mutability/let_mut_nested.leo b/asg/tests/pass/mutability/let_mut_nested.leo index 27121f6e48..93236ef4c6 100644 --- a/asg/tests/pass/mutability/let_mut_nested.leo +++ b/asg/tests/pass/mutability/let_mut_nested.leo @@ -1,5 +1,5 @@ function main () { - let mut x = 2u8; - let mut y = x; - let z = y / 2u8; + let x = 2u8; + let y = x; + const z = y / 2u8; } \ No newline at end of file diff --git a/asg/tests/pass/mutability/swap.leo b/asg/tests/pass/mutability/swap.leo index 0a209149ee..b2a795e826 100644 --- a/asg/tests/pass/mutability/swap.leo +++ b/asg/tests/pass/mutability/swap.leo @@ -1,17 +1,17 @@ // Swap two elements of an array. function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { - let t = a[i]; + const t = a[i]; a[i] = a[j]; a[j] = t; return a } function main() { - let mut arr: [u32; 2] = [0, 1]; - let expected: [u32; 2] = [1, 0]; + let arr: [u32; 2] = [0, 1]; + const expected: [u32; 2] = [1, 0]; // Do swap. - let actual = swap(arr, 0, 1); + const actual = swap(arr, 0, 1); // Check result. for i in 0..2 { diff --git a/asg/tests/pass/statements/block.leo b/asg/tests/pass/statements/block.leo index 8650808041..ca8da645ec 100644 --- a/asg/tests/pass/statements/block.leo +++ b/asg/tests/pass/statements/block.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; { x = 5u32; diff --git a/asg/tests/pass/statements/conditional/chain.leo b/asg/tests/pass/statements/conditional/chain.leo index dbc0e1f38c..44d4e86243 100644 --- a/asg/tests/pass/statements/conditional/chain.leo +++ b/asg/tests/pass/statements/conditional/chain.leo @@ -1,5 +1,5 @@ function main(a: u32, b: u32) { - let mut c = 0u32; + let c = 0u32; if a == 1 { c = 1; diff --git a/asg/tests/pass/statements/conditional/for_loop.leo b/asg/tests/pass/statements/conditional/for_loop.leo index 2dca076858..db307f3c36 100644 --- a/asg/tests/pass/statements/conditional/for_loop.leo +++ b/asg/tests/pass/statements/conditional/for_loop.leo @@ -1,5 +1,5 @@ function main(a: bool) { - let mut b = 0u32; + let b = 0u32; if a { for i in 0..4 { @@ -7,7 +7,7 @@ function main(a: bool) { } } - let r: u32 = a ? 6 : 0; + const r: u32 = a ? 6 : 0; console.assert(r == b); } diff --git a/asg/tests/pass/statements/conditional/mutate.leo b/asg/tests/pass/statements/conditional/mutate.leo index 458d3d0d60..9bb124eefd 100644 --- a/asg/tests/pass/statements/conditional/mutate.leo +++ b/asg/tests/pass/statements/conditional/mutate.leo @@ -1,5 +1,5 @@ function main(a: u32) { - let mut b = 5u32; + let b = 5u32; if a == 1 { b = 1; diff --git a/asg/tests/pass/statements/conditional/nested.leo b/asg/tests/pass/statements/conditional/nested.leo index 3596f889d1..1849c2a339 100644 --- a/asg/tests/pass/statements/conditional/nested.leo +++ b/asg/tests/pass/statements/conditional/nested.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool, c: u32) { - let mut d = 0u32; + let d = 0u32; if a { d += 1; diff --git a/asg/tests/pass/statements/iteration_basic.leo b/asg/tests/pass/statements/iteration_basic.leo index 103c9abb9e..5d74e69a1f 100644 --- a/asg/tests/pass/statements/iteration_basic.leo +++ b/asg/tests/pass/statements/iteration_basic.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; for i in 0..3 { x -= 1; } diff --git a/asg/tests/pass/statements/ternary_basic.leo b/asg/tests/pass/statements/ternary_basic.leo index 675b681fa9..38359004a9 100644 --- a/asg/tests/pass/statements/ternary_basic.leo +++ b/asg/tests/pass/statements/ternary_basic.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool) { - let c = a ? true : false; + const c = a ? true : false; - let d = c == b; + const d = c == b; } \ No newline at end of file diff --git a/asg/tests/pass/tuples/access.leo b/asg/tests/pass/tuples/access.leo index 196e9d058c..9277f4ecc5 100644 --- a/asg/tests/pass/tuples/access.leo +++ b/asg/tests/pass/tuples/access.leo @@ -1,5 +1,5 @@ function main() { - let a = (true, false); + const a = (true, false); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/asg/tests/pass/tuples/basic.leo b/asg/tests/pass/tuples/basic.leo index 37c728611c..2e777f2797 100644 --- a/asg/tests/pass/tuples/basic.leo +++ b/asg/tests/pass/tuples/basic.leo @@ -1,3 +1,3 @@ function main() { - let a = (true, false); + const a = (true, false); } \ No newline at end of file diff --git a/asg/tests/pass/tuples/function.leo b/asg/tests/pass/tuples/function.leo index b318348813..4222b858cb 100644 --- a/asg/tests/pass/tuples/function.leo +++ b/asg/tests/pass/tuples/function.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a = foo(); + const a = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/asg/tests/pass/tuples/function_multiple.leo b/asg/tests/pass/tuples/function_multiple.leo index 39848377c6..73fbe277ae 100644 --- a/asg/tests/pass/tuples/function_multiple.leo +++ b/asg/tests/pass/tuples/function_multiple.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let (a, b) = foo(); + const (a, b) = foo(); console.assert(a == true); console.assert(b == false); diff --git a/asg/tests/pass/tuples/function_typed.leo b/asg/tests/pass/tuples/function_typed.leo index 8af2c907ca..f89e7a3273 100644 --- a/asg/tests/pass/tuples/function_typed.leo +++ b/asg/tests/pass/tuples/function_typed.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a: (bool, bool) = foo(); + const a: (bool, bool) = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/asg/tests/pass/tuples/multiple.leo b/asg/tests/pass/tuples/multiple.leo index b7627dad2a..2cb003b0e1 100644 --- a/asg/tests/pass/tuples/multiple.leo +++ b/asg/tests/pass/tuples/multiple.leo @@ -1,5 +1,5 @@ function main() { - let (a, b) = (true, false); + const (a, b) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/asg/tests/pass/tuples/multiple_typed.leo b/asg/tests/pass/tuples/multiple_typed.leo index 29fc7ef877..bbe4a01858 100644 --- a/asg/tests/pass/tuples/multiple_typed.leo +++ b/asg/tests/pass/tuples/multiple_typed.leo @@ -1,5 +1,5 @@ function main() { - let (a, b): (bool, bool) = (true, false); + const (a, b): (bool, bool) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/asg/tests/pass/tuples/nested.leo b/asg/tests/pass/tuples/nested.leo index a9599b360c..bbdb2394a8 100644 --- a/asg/tests/pass/tuples/nested.leo +++ b/asg/tests/pass/tuples/nested.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); } \ No newline at end of file diff --git a/asg/tests/pass/tuples/nested_access.leo b/asg/tests/pass/tuples/nested_access.leo index 5edba64e24..f21fa59bba 100644 --- a/asg/tests/pass/tuples/nested_access.leo +++ b/asg/tests/pass/tuples/nested_access.leo @@ -1,6 +1,6 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); console.assert(b.0 == true); console.assert(b.1.0 == true); diff --git a/asg/tests/pass/tuples/nested_typed.leo b/asg/tests/pass/tuples/nested_typed.leo index 2e68117a2b..44a10b2a3e 100644 --- a/asg/tests/pass/tuples/nested_typed.leo +++ b/asg/tests/pass/tuples/nested_typed.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b: (bool, (bool, bool)) = (true, a); + const a = (true, false); + const b: (bool, (bool, bool)) = (true, a); } \ No newline at end of file diff --git a/asg/tests/pass/tuples/typed.leo b/asg/tests/pass/tuples/typed.leo index 8cd2ed79db..8f623fc148 100644 --- a/asg/tests/pass/tuples/typed.leo +++ b/asg/tests/pass/tuples/typed.leo @@ -1,3 +1,3 @@ function main() { - let a: (bool, bool) = (true, false); + const a: (bool, bool) = (true, false); } \ No newline at end of file diff --git a/compiler/tests/address/console_assert_fail.leo b/compiler/tests/address/console_assert_fail.leo index 3e7a5f106d..17849256ca 100644 --- a/compiler/tests/address/console_assert_fail.leo +++ b/compiler/tests/address/console_assert_fail.leo @@ -1,6 +1,6 @@ function main() { - let address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9); + const address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9); console.assert(address_1 == address_2); } \ No newline at end of file diff --git a/compiler/tests/address/console_assert_pass.leo b/compiler/tests/address/console_assert_pass.leo index 60ea4a79cd..f17d7d8c05 100644 --- a/compiler/tests/address/console_assert_pass.leo +++ b/compiler/tests/address/console_assert_pass.leo @@ -1,6 +1,6 @@ function main() { - let address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(address_1 == address_2); } \ No newline at end of file diff --git a/compiler/tests/address/empty.leo b/compiler/tests/address/empty.leo index e5c06d0def..305a77de5b 100644 --- a/compiler/tests/address/empty.leo +++ b/compiler/tests/address/empty.leo @@ -1,3 +1,3 @@ function main() { - let owner = address(); + const owner = address(); } \ No newline at end of file diff --git a/compiler/tests/address/implicit_invalid.leo b/compiler/tests/address/implicit_invalid.leo index 6f8eba5114..aadc38a6d8 100644 --- a/compiler/tests/address/implicit_invalid.leo +++ b/compiler/tests/address/implicit_invalid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/compiler/tests/address/implicit_valid.leo b/compiler/tests/address/implicit_valid.leo index df6ebf497d..75bcbaa8a1 100644 --- a/compiler/tests/address/implicit_valid.leo +++ b/compiler/tests/address/implicit_valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/compiler/tests/address/input.leo b/compiler/tests/address/input.leo index 795deac98b..29519f0334 100644 --- a/compiler/tests/address/input.leo +++ b/compiler/tests/address/input.leo @@ -1,5 +1,5 @@ function main(owner: address) { - let sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(owner == sender); } \ No newline at end of file diff --git a/compiler/tests/address/invalid_length.leo b/compiler/tests/address/invalid_length.leo index c1b7f719be..ae1defecaf 100644 --- a/compiler/tests/address/invalid_length.leo +++ b/compiler/tests/address/invalid_length.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j88); + const public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j88); } \ No newline at end of file diff --git a/compiler/tests/address/invalid_prefix.leo b/compiler/tests/address/invalid_prefix.leo index 81959d2fa6..cd87e404a4 100644 --- a/compiler/tests/address/invalid_prefix.leo +++ b/compiler/tests/address/invalid_prefix.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const public_key_string = address(zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); } \ No newline at end of file diff --git a/compiler/tests/address/ternary.leo b/compiler/tests/address/ternary.leo index bdd88b9d92..dc87153d2d 100644 --- a/compiler/tests/address/ternary.leo +++ b/compiler/tests/address/ternary.leo @@ -1,8 +1,8 @@ function main(s: bool, c: address) { - let a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); + const a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); - let r = s? a: b; + const r = s? a: b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/address/valid.leo b/compiler/tests/address/valid.leo index f06aefdaa6..18f1682526 100644 --- a/compiler/tests/address/valid.leo +++ b/compiler/tests/address/valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); } \ No newline at end of file diff --git a/compiler/tests/array/input/inline_fail.leo b/compiler/tests/array/input/inline_fail.leo index 1e380be10d..72fd3be66c 100644 --- a/compiler/tests/array/input/inline_fail.leo +++ b/compiler/tests/array/input/inline_fail.leo @@ -1,3 +1,3 @@ function main() { - let a = [1u8, bool]; + const a = [1u8, bool]; } diff --git a/compiler/tests/array/multi_fail_initializer.leo b/compiler/tests/array/multi_fail_initializer.leo index 258750b327..be1ab315bd 100644 --- a/compiler/tests/array/multi_fail_initializer.leo +++ b/compiler/tests/array/multi_fail_initializer.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions + const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions } \ No newline at end of file diff --git a/compiler/tests/array/multi_fail_inline.leo b/compiler/tests/array/multi_fail_inline.leo index 50a06c09b2..49c9296798 100644 --- a/compiler/tests/array/multi_fail_inline.leo +++ b/compiler/tests/array/multi_fail_inline.leo @@ -1,4 +1,4 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8, 1u8], + const arr: [u8; (2, 2)] = [[1u8, 1u8], [1u8]]; // incorrect dimensions } \ No newline at end of file diff --git a/compiler/tests/array/multi_initializer.leo b/compiler/tests/array/multi_initializer.leo index 7257999ddf..6133542ef0 100644 --- a/compiler/tests/array/multi_initializer.leo +++ b/compiler/tests/array/multi_initializer.leo @@ -1,7 +1,7 @@ function main() { - let a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; + const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; - let b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; + const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/multi_initializer_fail.leo b/compiler/tests/array/multi_initializer_fail.leo index 0bd76acffa..e38a8fdaee 100644 --- a/compiler/tests/array/multi_initializer_fail.leo +++ b/compiler/tests/array/multi_initializer_fail.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions + const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions } \ No newline at end of file diff --git a/compiler/tests/array/nested.leo b/compiler/tests/array/nested.leo index c557758b05..80fc5511bf 100644 --- a/compiler/tests/array/nested.leo +++ b/compiler/tests/array/nested.leo @@ -1,4 +1,4 @@ function main () { - let x = [false; (2, 2)]; - let y: bool = x[0][0]; + const x = [false; (2, 2)]; + const y: bool = x[0][0]; } diff --git a/compiler/tests/array/nested_3x2_value.leo b/compiler/tests/array/nested_3x2_value.leo index b69ddffb89..c5f64c997e 100644 --- a/compiler/tests/array/nested_3x2_value.leo +++ b/compiler/tests/array/nested_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/nested_3x2_value_fail.leo b/compiler/tests/array/nested_3x2_value_fail.leo index 35c8478cd1..a187a51991 100644 --- a/compiler/tests/array/nested_3x2_value_fail.leo +++ b/compiler/tests/array/nested_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } diff --git a/compiler/tests/array/slice.leo b/compiler/tests/array/slice.leo index 296f5bd050..9ff83dbbb8 100644 --- a/compiler/tests/array/slice.leo +++ b/compiler/tests/array/slice.leo @@ -1,6 +1,6 @@ // `{from}..{to}` copies the elements of one array into another exclusively function main(a: [u8; 3]) { - let b = [1u8; 4]; + const b = [1u8; 4]; console.assert(a == b[0..3]); } diff --git a/compiler/tests/array/slice_lower.leo b/compiler/tests/array/slice_lower.leo index dd669830ea..0af6fbd937 100644 --- a/compiler/tests/array/slice_lower.leo +++ b/compiler/tests/array/slice_lower.leo @@ -1,8 +1,8 @@ function main() { - let arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - let expected: [u32; 2] = [0, 1]; + const arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + const expected: [u32; 2] = [0, 1]; - let actual = arr[..2]; // Should produce [0, 1] + const actual = arr[..2]; // Should produce [0, 1] console.assert(expected == actual); } \ No newline at end of file diff --git a/compiler/tests/array/spread.leo b/compiler/tests/array/spread.leo index 962e92c923..8bd2861aae 100644 --- a/compiler/tests/array/spread.leo +++ b/compiler/tests/array/spread.leo @@ -1,7 +1,7 @@ // A spread operator `...` copies the elements of one array into another function main(a: [u8; 3]) { - let b = [1u8, 1u8]; - let c = [1u8, ...b]; + const b = [1u8, 1u8]; + const c = [1u8, ...b]; console.assert(a == c); } \ No newline at end of file diff --git a/compiler/tests/array/tuple_3x2_value.leo b/compiler/tests/array/tuple_3x2_value.leo index dc9128c51e..b6659539d5 100644 --- a/compiler/tests/array/tuple_3x2_value.leo +++ b/compiler/tests/array/tuple_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/tuple_3x2_value_fail.leo b/compiler/tests/array/tuple_3x2_value_fail.leo index 42e6f61500..78593ab696 100644 --- a/compiler/tests/array/tuple_3x2_value_fail.leo +++ b/compiler/tests/array/tuple_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } diff --git a/compiler/tests/array/type_fail.leo b/compiler/tests/array/type_fail.leo index 1402ceba4c..356bba976a 100644 --- a/compiler/tests/array/type_fail.leo +++ b/compiler/tests/array/type_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: [u8; -2] = [0u32; 2]; + const a: [u8; -2] = [0u32; 2]; } \ No newline at end of file diff --git a/compiler/tests/array/type_input_3x2.leo b/compiler/tests/array/type_input_3x2.leo index 40781415c1..ea60a0cc24 100644 --- a/compiler/tests/array/type_input_3x2.leo +++ b/compiler/tests/array/type_input_3x2.leo @@ -1,5 +1,5 @@ function main(a: [[u8; 2]; 3]) { - let b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_input_4x3x2.leo b/compiler/tests/array/type_input_4x3x2.leo index bd75514904..2d9c4cff22 100644 --- a/compiler/tests/array/type_input_4x3x2.leo +++ b/compiler/tests/array/type_input_4x3x2.leo @@ -1,5 +1,5 @@ function main(a: [[[u8; 2]; 3]; 4]) { - let b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline diff --git a/compiler/tests/array/type_nested_value_nested_3x2.leo b/compiler/tests/array/type_nested_value_nested_3x2.leo index 341b9ead9c..bcf5bae674 100644 --- a/compiler/tests/array/type_nested_value_nested_3x2.leo +++ b/compiler/tests/array/type_nested_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer + const b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_nested_3x2_fail.leo b/compiler/tests/array/type_nested_value_nested_3x2_fail.leo index 4bd07f85db..56c8916fb0 100644 --- a/compiler/tests/array/type_nested_value_nested_3x2_fail.leo +++ b/compiler/tests/array/type_nested_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_nested_4x3x2.leo b/compiler/tests/array/type_nested_value_nested_4x3x2.leo index 5ba24a381b..1691fa26c7 100644 --- a/compiler/tests/array/type_nested_value_nested_4x3x2.leo +++ b/compiler/tests/array/type_nested_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer + const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_nested_4x3x2_fail.leo b/compiler/tests/array/type_nested_value_nested_4x3x2_fail.leo index 6479004d68..480327a91d 100644 --- a/compiler/tests/array/type_nested_value_nested_4x3x2_fail.leo +++ b/compiler/tests/array/type_nested_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_tuple_3x2.leo b/compiler/tests/array/type_nested_value_tuple_3x2.leo index c6fac9ec64..5f14084d55 100644 --- a/compiler/tests/array/type_nested_value_tuple_3x2.leo +++ b/compiler/tests/array/type_nested_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer + const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_tuple_3x2_fail.leo b/compiler/tests/array/type_nested_value_tuple_3x2_fail.leo index ba99b070c7..3bfb559615 100644 --- a/compiler/tests/array/type_nested_value_tuple_3x2_fail.leo +++ b/compiler/tests/array/type_nested_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_tuple_4x3x2.leo b/compiler/tests/array/type_nested_value_tuple_4x3x2.leo index 9be45de408..88a5143bd2 100644 --- a/compiler/tests/array/type_nested_value_tuple_4x3x2.leo +++ b/compiler/tests/array/type_nested_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer + const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_nested_value_tuple_4x3x2_fail.leo b/compiler/tests/array/type_nested_value_tuple_4x3x2_fail.leo index 95172bf329..ce1219a37b 100644 --- a/compiler/tests/array/type_nested_value_tuple_4x3x2_fail.leo +++ b/compiler/tests/array/type_nested_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_nested_3x2.leo b/compiler/tests/array/type_tuple_value_nested_3x2.leo index 4e061c4309..81195e03a1 100644 --- a/compiler/tests/array/type_tuple_value_nested_3x2.leo +++ b/compiler/tests/array/type_tuple_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_nested_3x2_fail.leo b/compiler/tests/array/type_tuple_value_nested_3x2_fail.leo index 9732cf26ef..e84f025a9f 100644 --- a/compiler/tests/array/type_tuple_value_nested_3x2_fail.leo +++ b/compiler/tests/array/type_tuple_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_nested_4x3x2.leo b/compiler/tests/array/type_tuple_value_nested_4x3x2.leo index d9dc698784..322a6f7601 100644 --- a/compiler/tests/array/type_tuple_value_nested_4x3x2.leo +++ b/compiler/tests/array/type_tuple_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer + const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_nested_4x3x2_fail.leo b/compiler/tests/array/type_tuple_value_nested_4x3x2_fail.leo index b820c4d088..cbb7ccbf76 100644 --- a/compiler/tests/array/type_tuple_value_nested_4x3x2_fail.leo +++ b/compiler/tests/array/type_tuple_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_tuple_3x2.leo b/compiler/tests/array/type_tuple_value_tuple_3x2.leo index b0693f7667..d451a9c1a8 100644 --- a/compiler/tests/array/type_tuple_value_tuple_3x2.leo +++ b/compiler/tests/array/type_tuple_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_tuple_3x2_fail.leo b/compiler/tests/array/type_tuple_value_tuple_3x2_fail.leo index 99487ccb7a..884a75db9d 100644 --- a/compiler/tests/array/type_tuple_value_tuple_3x2_fail.leo +++ b/compiler/tests/array/type_tuple_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_tuple_4x3x2.leo b/compiler/tests/array/type_tuple_value_tuple_4x3x2.leo index cdc1bc961e..1205b1dc9c 100644 --- a/compiler/tests/array/type_tuple_value_tuple_4x3x2.leo +++ b/compiler/tests/array/type_tuple_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer + const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/compiler/tests/array/type_tuple_value_tuple_4x3x2_fail.leo b/compiler/tests/array/type_tuple_value_tuple_4x3x2_fail.leo index 824fd90bc6..31e2a5e552 100644 --- a/compiler/tests/array/type_tuple_value_tuple_4x3x2_fail.leo +++ b/compiler/tests/array/type_tuple_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) + const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) } \ No newline at end of file diff --git a/compiler/tests/array/variable_slice_fail.leo b/compiler/tests/array/variable_slice_fail.leo index edb04caacf..e79d64112f 100644 --- a/compiler/tests/array/variable_slice_fail.leo +++ b/compiler/tests/array/variable_slice_fail.leo @@ -1,7 +1,7 @@ function main() { - let a = [1u8; 10]; + const a = [1u8; 10]; for i in 0..10 { - let x = a[i..10]; + const x = a[i..10]; console.debug("{}", x); } } \ No newline at end of file diff --git a/compiler/tests/boolean/all.leo b/compiler/tests/boolean/all.leo index 29a3815881..64fe8a795a 100644 --- a/compiler/tests/boolean/all.leo +++ b/compiler/tests/boolean/all.leo @@ -1,8 +1,8 @@ // !(true && (false || true)) function main() { - let a = true; - let b = false || a; - let c = !(true && b); + const a = true; + const b = false || a; + const c = !(true && b); console.assert(c == false); } \ No newline at end of file diff --git a/compiler/tests/boolean/conditional_mut.leo b/compiler/tests/boolean/conditional_mut.leo index e6716cb05a..cebf82ab00 100644 --- a/compiler/tests/boolean/conditional_mut.leo +++ b/compiler/tests/boolean/conditional_mut.leo @@ -1,6 +1,6 @@ function main () { - let mut x = true; + let x = true; if x { - let y = 0u8; + const y = 0u8; } } \ No newline at end of file diff --git a/compiler/tests/boolean/false_and_false.leo b/compiler/tests/boolean/false_and_false.leo index 70e4b0797b..03dfabab4d 100644 --- a/compiler/tests/boolean/false_and_false.leo +++ b/compiler/tests/boolean/false_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false && false; + const a = false && false; console.assert(a == false); } \ No newline at end of file diff --git a/compiler/tests/boolean/false_or_false.leo b/compiler/tests/boolean/false_or_false.leo index 4ae820254e..7ea710802c 100644 --- a/compiler/tests/boolean/false_or_false.leo +++ b/compiler/tests/boolean/false_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false || false; + const a = false || false; console.assert(a == false); } \ No newline at end of file diff --git a/compiler/tests/boolean/not_mutable.leo b/compiler/tests/boolean/not_mutable.leo index 91a6e5ff37..c621647ff9 100644 --- a/compiler/tests/boolean/not_mutable.leo +++ b/compiler/tests/boolean/not_mutable.leo @@ -1,4 +1,4 @@ function main () { - let mut b = false; - let a = !b; + let b = false; + const a = !b; } \ No newline at end of file diff --git a/compiler/tests/boolean/true_and_false.leo b/compiler/tests/boolean/true_and_false.leo index 3c7c484603..336dde7558 100644 --- a/compiler/tests/boolean/true_and_false.leo +++ b/compiler/tests/boolean/true_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true && false; + const a = true && false; console.assert(a == false); } \ No newline at end of file diff --git a/compiler/tests/boolean/true_and_true.leo b/compiler/tests/boolean/true_and_true.leo index c378e50024..dae445dcf8 100644 --- a/compiler/tests/boolean/true_and_true.leo +++ b/compiler/tests/boolean/true_and_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true && true; + const a = true && true; console.assert(a == true); } \ No newline at end of file diff --git a/compiler/tests/boolean/true_and_u32.leo b/compiler/tests/boolean/true_and_u32.leo index e5b3a8c001..ad3ead9040 100644 --- a/compiler/tests/boolean/true_and_u32.leo +++ b/compiler/tests/boolean/true_and_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true && 1u32; + const a = true && 1u32; } \ No newline at end of file diff --git a/compiler/tests/boolean/true_or_false.leo b/compiler/tests/boolean/true_or_false.leo index d643a96aa1..216e473cdb 100644 --- a/compiler/tests/boolean/true_or_false.leo +++ b/compiler/tests/boolean/true_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true || false; + const a = true || false; console.assert(a == true); } \ No newline at end of file diff --git a/compiler/tests/boolean/true_or_true.leo b/compiler/tests/boolean/true_or_true.leo index b8eaa91ff1..fea8628b9f 100644 --- a/compiler/tests/boolean/true_or_true.leo +++ b/compiler/tests/boolean/true_or_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true || true; + const a = true || true; console.assert(a == true); } \ No newline at end of file diff --git a/compiler/tests/boolean/true_or_u32.leo b/compiler/tests/boolean/true_or_u32.leo index 500b5f7bf4..38dab727b9 100644 --- a/compiler/tests/boolean/true_or_u32.leo +++ b/compiler/tests/boolean/true_or_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true || 1u32; + const a = true || 1u32; } \ No newline at end of file diff --git a/compiler/tests/circuits/define_circuit_inside_circuit_function.leo b/compiler/tests/circuits/define_circuit_inside_circuit_function.leo index 8c25c1e9d9..cedabf2185 100644 --- a/compiler/tests/circuits/define_circuit_inside_circuit_function.leo +++ b/compiler/tests/circuits/define_circuit_inside_circuit_function.leo @@ -4,10 +4,10 @@ circuit Foo { circuit Bar { function bar() { - let f = Foo { a: 0u32 }; + const f = Foo { a: 0u32 }; } } function main() { - let b = Bar::bar(); + const b = Bar::bar(); } \ No newline at end of file diff --git a/compiler/tests/circuits/duplicate_name_context.leo b/compiler/tests/circuits/duplicate_name_context.leo index 98ff42d8f0..66640e75a2 100644 --- a/compiler/tests/circuits/duplicate_name_context.leo +++ b/compiler/tests/circuits/duplicate_name_context.leo @@ -7,7 +7,7 @@ circuit Bar { } function main () { - let Bar = 66u32; - let k1 = Bar{ b2: 30u32 }; - let k2 = Bar::add_five(55u32); + const Bar = 66u32; + const k1 = Bar{ b2: 30u32 }; + const k2 = Bar::add_five(55u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/inline.leo b/compiler/tests/circuits/inline.leo index 8e214c729a..9ba06f4191 100644 --- a/compiler/tests/circuits/inline.leo +++ b/compiler/tests/circuits/inline.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; } \ No newline at end of file diff --git a/compiler/tests/circuits/inline_fail.leo b/compiler/tests/circuits/inline_fail.leo index 52792a07e0..01597005fb 100644 --- a/compiler/tests/circuits/inline_fail.leo +++ b/compiler/tests/circuits/inline_fail.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { y: 0u32 }; + const a = Foo { y: 0u32 }; } \ No newline at end of file diff --git a/compiler/tests/circuits/inline_member_fail.leo b/compiler/tests/circuits/inline_member_fail.leo index 7f0b8f7889..59f6d7992b 100644 --- a/compiler/tests/circuits/inline_member_fail.leo +++ b/compiler/tests/circuits/inline_member_fail.leo @@ -3,6 +3,6 @@ circuit Foo { } function main() { - let y: u8 = 1; - let a = Foo { y }; + const y: u8 = 1; + const a = Foo { y }; } \ No newline at end of file diff --git a/compiler/tests/circuits/inline_member_pass.leo b/compiler/tests/circuits/inline_member_pass.leo index 5541a65638..8e58e4935a 100644 --- a/compiler/tests/circuits/inline_member_pass.leo +++ b/compiler/tests/circuits/inline_member_pass.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let x: u8 = 1; - let a = Foo { x }; - let b = Foo::new(x); + const x: u8 = 1; + const a = Foo { x }; + const b = Foo::new(x); } \ No newline at end of file diff --git a/compiler/tests/circuits/inline_undefined.leo b/compiler/tests/circuits/inline_undefined.leo index af070e01e9..40c4cf722c 100644 --- a/compiler/tests/circuits/inline_undefined.leo +++ b/compiler/tests/circuits/inline_undefined.leo @@ -1,3 +1,3 @@ function main() { - let a = Foo { }; + const a = Foo { }; } \ No newline at end of file diff --git a/compiler/tests/circuits/member_function.leo b/compiler/tests/circuits/member_function.leo index e40603dffb..258b6c675e 100644 --- a/compiler/tests/circuits/member_function.leo +++ b/compiler/tests/circuits/member_function.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; console.assert(a.echo() == 1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/member_function_fail.leo b/compiler/tests/circuits/member_function_fail.leo index 224b79cbf4..5a1c4100c5 100644 --- a/compiler/tests/circuits/member_function_fail.leo +++ b/compiler/tests/circuits/member_function_fail.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echoed(1u32); + const a = Foo { }; + const err = a.echoed(1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/member_function_invalid.leo b/compiler/tests/circuits/member_function_invalid.leo index bb834e9562..aa689eb976 100644 --- a/compiler/tests/circuits/member_function_invalid.leo +++ b/compiler/tests/circuits/member_function_invalid.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echo(1u32); // echo is a static function and must be accessed using `::` + const a = Foo { }; + const err = a.echo(1u32); // echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/compiler/tests/circuits/member_function_nested.leo b/compiler/tests/circuits/member_function_nested.leo index 9e07cc9acf..e512c9df52 100644 --- a/compiler/tests/circuits/member_function_nested.leo +++ b/compiler/tests/circuits/member_function_nested.leo @@ -11,8 +11,8 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; - let b = a.add_x(1u32); + const a = Foo { x: 1u32 }; + const b = a.add_x(1u32); console.assert(b == 2u32); } diff --git a/compiler/tests/circuits/member_static_function.leo b/compiler/tests/circuits/member_static_function.leo index 4bf51190f0..9d53314f27 100644 --- a/compiler/tests/circuits/member_static_function.leo +++ b/compiler/tests/circuits/member_static_function.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let a = Foo::echo(1u32); + const a = Foo::echo(1u32); console.assert(a == 1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/member_static_function_invalid.leo b/compiler/tests/circuits/member_static_function_invalid.leo index 09fec386d9..7829b4b430 100644 --- a/compiler/tests/circuits/member_static_function_invalid.leo +++ b/compiler/tests/circuits/member_static_function_invalid.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` + const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/compiler/tests/circuits/member_static_function_undefined.leo b/compiler/tests/circuits/member_static_function_undefined.leo index cf9f98c7b4..ece1d00963 100644 --- a/compiler/tests/circuits/member_static_function_undefined.leo +++ b/compiler/tests/circuits/member_static_function_undefined.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo::echoed(1u32); + const err = Foo::echoed(1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/member_variable.leo b/compiler/tests/circuits/member_variable.leo index 0dd35f2aec..a3f3fbe7e6 100644 --- a/compiler/tests/circuits/member_variable.leo +++ b/compiler/tests/circuits/member_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/member_variable_and_function.leo b/compiler/tests/circuits/member_variable_and_function.leo index 074feab7b8..3b90db7eaa 100644 --- a/compiler/tests/circuits/member_variable_and_function.leo +++ b/compiler/tests/circuits/member_variable_and_function.leo @@ -7,9 +7,9 @@ circuit Foo { } function main() { - let a = Foo { foo: 1 }; + const a = Foo { foo: 1 }; - let b = a.foo + Foo::bar(); + const b = a.foo + Foo::bar(); console.assert(b == 2u32); } diff --git a/compiler/tests/circuits/member_variable_fail.leo b/compiler/tests/circuits/member_variable_fail.leo index 5780704ea2..fdf42068d5 100644 --- a/compiler/tests/circuits/member_variable_fail.leo +++ b/compiler/tests/circuits/member_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; - let err = a.y; + const err = a.y; } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_function_fail.leo b/compiler/tests/circuits/mut_function_fail.leo index 3469f97627..44583810dd 100644 --- a/compiler/tests/circuits/mut_function_fail.leo +++ b/compiler/tests/circuits/mut_function_fail.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_self_function_fail.leo b/compiler/tests/circuits/mut_self_function_fail.leo index 8c9b99f6ae..b81b18e743 100644 --- a/compiler/tests/circuits/mut_self_function_fail.leo +++ b/compiler/tests/circuits/mut_self_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_self_static_function_fail.leo b/compiler/tests/circuits/mut_self_static_function_fail.leo index 8c9b99f6ae..b81b18e743 100644 --- a/compiler/tests/circuits/mut_self_static_function_fail.leo +++ b/compiler/tests/circuits/mut_self_static_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_self_variable.leo b/compiler/tests/circuits/mut_self_variable.leo index f5a35ec754..dc2047d872 100644 --- a/compiler/tests/circuits/mut_self_variable.leo +++ b/compiler/tests/circuits/mut_self_variable.leo @@ -8,7 +8,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/compiler/tests/circuits/mut_self_variable_branch.leo b/compiler/tests/circuits/mut_self_variable_branch.leo index e47f9b85df..1c2f126f08 100644 --- a/compiler/tests/circuits/mut_self_variable_branch.leo +++ b/compiler/tests/circuits/mut_self_variable_branch.leo @@ -10,7 +10,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/compiler/tests/circuits/mut_self_variable_conditional.leo b/compiler/tests/circuits/mut_self_variable_conditional.leo index 74345afcb4..61a5e354dc 100644 --- a/compiler/tests/circuits/mut_self_variable_conditional.leo +++ b/compiler/tests/circuits/mut_self_variable_conditional.leo @@ -1,5 +1,5 @@ function main() { - let mut f = Foo { a: 0u32 }; + let f = Foo { a: 0u32 }; f.bar(); } diff --git a/compiler/tests/circuits/mut_self_variable_fail.leo b/compiler/tests/circuits/mut_self_variable_fail.leo index fdbb556bca..4db62a4d3e 100644 --- a/compiler/tests/circuits/mut_self_variable_fail.leo +++ b/compiler/tests/circuits/mut_self_variable_fail.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_static_function_fail.leo b/compiler/tests/circuits/mut_static_function_fail.leo index ed3092c656..e7db3a1df9 100644 --- a/compiler/tests/circuits/mut_static_function_fail.leo +++ b/compiler/tests/circuits/mut_static_function_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/compiler/tests/circuits/mut_variable.leo b/compiler/tests/circuits/mut_variable.leo index 243d7a2cf2..ddc7412038 100644 --- a/compiler/tests/circuits/mut_variable.leo +++ b/compiler/tests/circuits/mut_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/compiler/tests/circuits/mut_variable_fail.leo b/compiler/tests/circuits/mut_variable_fail.leo index 4d58150c95..e116b33d5c 100644 --- a/compiler/tests/circuits/mut_variable_fail.leo +++ b/compiler/tests/circuits/mut_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let f = Foo { a: 0u8 }; + const f = Foo { a: 0u8 }; f.a = 1u8; } \ No newline at end of file diff --git a/compiler/tests/circuits/pedersen_mock.leo b/compiler/tests/circuits/pedersen_mock.leo index 559ebb7614..4abef65caa 100644 --- a/compiler/tests/circuits/pedersen_mock.leo +++ b/compiler/tests/circuits/pedersen_mock.leo @@ -6,9 +6,9 @@ circuit PedersenHash { } function hash(self, bits: [bool; 512]) -> u32 { - let mut digest: u32 = 0; + let digest: u32 = 0; for i in 0..512 { - let base = bits[i] ? self.parameters[i] : 0u32; + const base = bits[i] ? self.parameters[i] : 0u32; digest += base; } return digest @@ -17,11 +17,11 @@ circuit PedersenHash { // The 'pedersen_hash' main function. function main() { - let parameters = [0u32; 512]; - let pedersen = PedersenHash::new(parameters); - let hash_input: [bool; 512] = [true; 512]; + const parameters = [0u32; 512]; + const pedersen = PedersenHash::new(parameters); + const hash_input: [bool; 512] = [true; 512]; - let res = pedersen.hash(hash_input); + const res = pedersen.hash(hash_input); console.assert(res == 0u32); } diff --git a/compiler/tests/circuits/self_circuit.leo b/compiler/tests/circuits/self_circuit.leo index 5a1d6c63be..18329433f7 100644 --- a/compiler/tests/circuits/self_circuit.leo +++ b/compiler/tests/circuits/self_circuit.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let a = Foo::new(); + const a = Foo::new(); } \ No newline at end of file diff --git a/compiler/tests/circuits/self_member.leo b/compiler/tests/circuits/self_member.leo index 1bd978433d..2b3401a228 100644 --- a/compiler/tests/circuits/self_member.leo +++ b/compiler/tests/circuits/self_member.leo @@ -7,8 +7,8 @@ circuit Foo { } function main() { - let a = Foo { f: 1u32 }; - let b = a.bar(); + const a = Foo { f: 1u32 }; + const b = a.bar(); console.assert(b == 1u32); } \ No newline at end of file diff --git a/compiler/tests/circuits/self_member_invalid.leo b/compiler/tests/circuits/self_member_invalid.leo index 2e8b14f66c..163499d619 100644 --- a/compiler/tests/circuits/self_member_invalid.leo +++ b/compiler/tests/circuits/self_member_invalid.leo @@ -7,6 +7,6 @@ circuit Foo { } function main() -> u32 { - let foo = Foo { f: 1u32 }; - let err = foo.bar(); + const foo = Foo { f: 1u32 }; + const err = foo.bar(); } \ No newline at end of file diff --git a/compiler/tests/circuits/self_member_undefined.leo b/compiler/tests/circuits/self_member_undefined.leo index 471ffb973c..05a40905d7 100644 --- a/compiler/tests/circuits/self_member_undefined.leo +++ b/compiler/tests/circuits/self_member_undefined.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let foo = Foo { }; - let err = foo.bar(); + const foo = Foo { }; + const err = foo.bar(); } \ No newline at end of file diff --git a/compiler/tests/compiler/main.leo b/compiler/tests/compiler/main.leo index f5ddfb4e7f..ed25576751 100644 --- a/compiler/tests/compiler/main.leo +++ b/compiler/tests/compiler/main.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 1 + 2; + const a: u32 = 1 + 2; } \ No newline at end of file diff --git a/compiler/tests/core/packages/unstable/blake2s/arguments_length_fail.leo b/compiler/tests/core/packages/unstable/blake2s/arguments_length_fail.leo index ccdd4c5af9..614490432d 100644 --- a/compiler/tests/core/packages/unstable/blake2s/arguments_length_fail.leo +++ b/compiler/tests/core/packages/unstable/blake2s/arguments_length_fail.leo @@ -1,9 +1,9 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; + const seed: [u8; 32] = [0; 32]; - let result = Blake2s::hash(seed); // function `hash` takes 2 arguments + const result = Blake2s::hash(seed); // function `hash` takes 2 arguments console.log("Result: {}", result); } diff --git a/compiler/tests/core/packages/unstable/blake2s/arguments_type_fail.leo b/compiler/tests/core/packages/unstable/blake2s/arguments_type_fail.leo index 13c7e9735e..f80e7b0205 100644 --- a/compiler/tests/core/packages/unstable/blake2s/arguments_type_fail.leo +++ b/compiler/tests/core/packages/unstable/blake2s/arguments_type_fail.leo @@ -1,10 +1,10 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; - let message: [u16; 32] = [0; 32]; // message should be type [u8; 32] + const seed: [u8; 32] = [0; 32]; + const message: [u16; 32] = [0; 32]; // message should be type [u8; 32] - let result = Blake2s::hash(seed, message); + const result = Blake2s::hash(seed, message); console.log("Result: {}", result); } diff --git a/compiler/tests/core/packages/unstable/blake2s/blake2s_random.leo b/compiler/tests/core/packages/unstable/blake2s/blake2s_random.leo index 72aef44932..c9592fcbf8 100644 --- a/compiler/tests/core/packages/unstable/blake2s/blake2s_random.leo +++ b/compiler/tests/core/packages/unstable/blake2s/blake2s_random.leo @@ -1,7 +1,7 @@ import core.unstable.blake2s.Blake2s; function main(seed: [u8; 32], message: [u8; 32], expected: [u8; 32]) { - let actual = Blake2s::hash(seed, message); + const actual = Blake2s::hash(seed, message); console.assert(expected == actual); } diff --git a/compiler/tests/core/unstable_blake2s.leo b/compiler/tests/core/unstable_blake2s.leo index ca7db13892..c430d9a837 100644 --- a/compiler/tests/core/unstable_blake2s.leo +++ b/compiler/tests/core/unstable_blake2s.leo @@ -1,10 +1,10 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; - let message: [u8; 32] = [0; 32]; + const seed: [u8; 32] = [0; 32]; + const message: [u8; 32] = [0; 32]; - let result = Blake2s::hash(seed, message); + const result = Blake2s::hash(seed, message); console.log("Result: {}", result); } diff --git a/compiler/tests/field/field.leo b/compiler/tests/field/field.leo index 3f109881ad..5d5732e906 100644 --- a/compiler/tests/field/field.leo +++ b/compiler/tests/field/field.leo @@ -1,4 +1,4 @@ function main() { - let negOneField: field = -1field; - let oneField = 1field; + const negOneField: field = -1field; + const oneField = 1field; } \ No newline at end of file diff --git a/compiler/tests/field/ternary.leo b/compiler/tests/field/ternary.leo index f193ad82a3..05cb161b46 100644 --- a/compiler/tests/field/ternary.leo +++ b/compiler/tests/field/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: field, b: field, c: field) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/function/array_input.leo b/compiler/tests/function/array_input.leo index a70483cae7..899c0e4af6 100644 --- a/compiler/tests/function/array_input.leo +++ b/compiler/tests/function/array_input.leo @@ -1,6 +1,6 @@ function foo(a: [u8; 1]) {} function main() { - let a: [u16; 1] = [1; 1]; + const a: [u16; 1] = [1; 1]; foo(a); } \ No newline at end of file diff --git a/compiler/tests/function/array_params_direct_call.leo b/compiler/tests/function/array_params_direct_call.leo index 9305b0958d..8ded724bc4 100644 --- a/compiler/tests/function/array_params_direct_call.leo +++ b/compiler/tests/function/array_params_direct_call.leo @@ -1,7 +1,7 @@ function do_nothing(arr: [u32; 2]) {} function main() { - let arr: [u32; 2] = [0; 2]; + const arr: [u32; 2] = [0; 2]; do_nothing(arr); do_nothing([...arr]); diff --git a/compiler/tests/function/iteration.leo b/compiler/tests/function/iteration.leo index 19af4dd9cf..b1fcee6964 100644 --- a/compiler/tests/function/iteration.leo +++ b/compiler/tests/function/iteration.leo @@ -3,7 +3,7 @@ function one() -> u32 { } function main() { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += one(); diff --git a/compiler/tests/function/iteration_repeated.leo b/compiler/tests/function/iteration_repeated.leo index 3694b3594a..d76380a6b5 100644 --- a/compiler/tests/function/iteration_repeated.leo +++ b/compiler/tests/function/iteration_repeated.leo @@ -1,5 +1,5 @@ function iteration() -> u32 { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += 1; @@ -9,7 +9,7 @@ function iteration() -> u32 { } function main() { - let total = iteration() + iteration(); + const total = iteration() + iteration(); console.assert(total == 20); } \ No newline at end of file diff --git a/compiler/tests/function/multiple_returns.leo b/compiler/tests/function/multiple_returns.leo index ef00a4ef47..d927c51976 100644 --- a/compiler/tests/function/multiple_returns.leo +++ b/compiler/tests/function/multiple_returns.leo @@ -3,7 +3,7 @@ function tuple() -> (bool, bool) { } function main() { - let (a, b) = tuple(); + const (a, b) = tuple(); console.assert(a == true); console.assert(b == false); diff --git a/compiler/tests/function/multiple_returns_fail_conditional.leo b/compiler/tests/function/multiple_returns_fail_conditional.leo index 04ebb9e306..227fe5ce12 100644 --- a/compiler/tests/function/multiple_returns_fail_conditional.leo +++ b/compiler/tests/function/multiple_returns_fail_conditional.leo @@ -1,7 +1,7 @@ function main () -> u16 { if false { - let a = 1u16; - let b = a + 1u16; + const a = 1u16; + const b = a + 1u16; return b } else if false { return 0u16 diff --git a/compiler/tests/function/repeated.leo b/compiler/tests/function/repeated.leo index a2d04d55f9..f83fa6098b 100644 --- a/compiler/tests/function/repeated.leo +++ b/compiler/tests/function/repeated.leo @@ -3,7 +3,7 @@ function one() -> bool { } function main() { - let a = one() && one(); + const a = one() && one(); console.assert(a == true); } \ No newline at end of file diff --git a/compiler/tests/function/return_array_nested_fail.leo b/compiler/tests/function/return_array_nested_fail.leo index dca001d9cc..8eca684b8a 100644 --- a/compiler/tests/function/return_array_nested_fail.leo +++ b/compiler/tests/function/return_array_nested_fail.leo @@ -3,5 +3,5 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let b = array_3x2_tuple(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/compiler/tests/function/return_array_nested_pass.leo b/compiler/tests/function/return_array_nested_pass.leo index dda5b4342b..bfbfc8fd29 100644 --- a/compiler/tests/function/return_array_nested_pass.leo +++ b/compiler/tests/function/return_array_nested_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/compiler/tests/function/return_array_tuple_fail.leo b/compiler/tests/function/return_array_tuple_fail.leo index 4b7377e327..c960456ac1 100644 --- a/compiler/tests/function/return_array_tuple_fail.leo +++ b/compiler/tests/function/return_array_tuple_fail.leo @@ -3,5 +3,5 @@ function array_3x2_nested() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); + const a = array_3x2_nested(); } \ No newline at end of file diff --git a/compiler/tests/function/return_array_tuple_pass.leo b/compiler/tests/function/return_array_tuple_pass.leo index a700bcabad..4199e31990 100644 --- a/compiler/tests/function/return_array_tuple_pass.leo +++ b/compiler/tests/function/return_array_tuple_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/compiler/tests/function/return_tuple.leo b/compiler/tests/function/return_tuple.leo index c459740a47..a3b1bbc36a 100644 --- a/compiler/tests/function/return_tuple.leo +++ b/compiler/tests/function/return_tuple.leo @@ -1,11 +1,11 @@ // Returns a tuple of tuples. function tuples() -> ((u8, u8), u32) { - let a: (u8, u8) = (1, 2); - let b: u32 = 3; + const a: (u8, u8) = (1, 2); + const b: u32 = 3; return (a, b) } function main() { - let t = tuples(); + const t = tuples(); } \ No newline at end of file diff --git a/compiler/tests/function/return_tuple_conditional.leo b/compiler/tests/function/return_tuple_conditional.leo index c63967f548..839081b2a4 100644 --- a/compiler/tests/function/return_tuple_conditional.leo +++ b/compiler/tests/function/return_tuple_conditional.leo @@ -11,5 +11,5 @@ function tuple_conditional () -> ( } function main() { - let t = tuple_conditional(); + const t = tuple_conditional(); } \ No newline at end of file diff --git a/compiler/tests/function/scope_fail.leo b/compiler/tests/function/scope_fail.leo index 773c2479d7..6f1d390541 100644 --- a/compiler/tests/function/scope_fail.leo +++ b/compiler/tests/function/scope_fail.leo @@ -3,6 +3,6 @@ function foo() -> field { } function main() { - let myGlobal = 42field; - let err = foo(); + const myGlobal = 42field; + const err = foo(); } \ No newline at end of file diff --git a/compiler/tests/function/value_unchanged.leo b/compiler/tests/function/value_unchanged.leo index 32dcfa62d6..936ff2ddcc 100644 --- a/compiler/tests/function/value_unchanged.leo +++ b/compiler/tests/function/value_unchanged.leo @@ -12,7 +12,7 @@ function bad_mutate(mut x: u32) { } function main() { - let a = 1u32; + const a = 1u32; bad_mutate(a); console.assert(a == 1u32); // <- value `a` is still `1u32` diff --git a/compiler/tests/group/both_sign_high.leo b/compiler/tests/group/both_sign_high.leo index a8217d6d40..4c93573e1e 100644 --- a/compiler/tests/group/both_sign_high.leo +++ b/compiler/tests/group/both_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, +)group; + const element = (+, +)group; } \ No newline at end of file diff --git a/compiler/tests/group/both_sign_inferred.leo b/compiler/tests/group/both_sign_inferred.leo index b3b8b512c3..0bbd360ba0 100644 --- a/compiler/tests/group/both_sign_inferred.leo +++ b/compiler/tests/group/both_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, _)group; + const element = (_, _)group; } \ No newline at end of file diff --git a/compiler/tests/group/both_sign_low.leo b/compiler/tests/group/both_sign_low.leo index 0519c6d17d..1cb4f46c55 100644 --- a/compiler/tests/group/both_sign_low.leo +++ b/compiler/tests/group/both_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, -)group; + const element = (-, -)group; } \ No newline at end of file diff --git a/compiler/tests/group/one.leo b/compiler/tests/group/one.leo index 7be0cbbc2c..510110150b 100644 --- a/compiler/tests/group/one.leo +++ b/compiler/tests/group/one.leo @@ -1,3 +1,3 @@ function main() { - let element = 1group; + const element = 1group; } \ No newline at end of file diff --git a/compiler/tests/group/point.leo b/compiler/tests/group/point.leo index 85eeb53b7b..5e68415a0d 100644 --- a/compiler/tests/group/point.leo +++ b/compiler/tests/group/point.leo @@ -1,3 +1,3 @@ function main() { - let point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + const point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; } \ No newline at end of file diff --git a/compiler/tests/group/point_input.leo b/compiler/tests/group/point_input.leo index 68d8c458a3..a3a8e63bd3 100644 --- a/compiler/tests/group/point_input.leo +++ b/compiler/tests/group/point_input.leo @@ -1,3 +1,3 @@ function main(a: group) { - let b = a; + const b = a; } \ No newline at end of file diff --git a/compiler/tests/group/positive_and_negative.leo b/compiler/tests/group/positive_and_negative.leo index fdf9b892be..5d29e36ef2 100644 --- a/compiler/tests/group/positive_and_negative.leo +++ b/compiler/tests/group/positive_and_negative.leo @@ -1,10 +1,10 @@ function main() { - let pos_element = 1group; - let neg_element = -1group; + const pos_element = 1group; + const neg_element = -1group; - let pair_x_pos = (1, _)group; - let pair_x_neg = (-1, _)group; + const pair_x_pos = (1, _)group; + const pair_x_neg = (-1, _)group; - let pair_y_pos = (_, 1)group; - let pair_y_neg = (_, -1)group; + const pair_y_pos = (_, 1)group; + const pair_y_neg = (_, -1)group; } \ No newline at end of file diff --git a/compiler/tests/group/ternary.leo b/compiler/tests/group/ternary.leo index fb69b74521..97fba1f5b6 100644 --- a/compiler/tests/group/ternary.leo +++ b/compiler/tests/group/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: group, b: group, c: group) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/group/x_and_y.leo b/compiler/tests/group/x_and_y.leo index 1b64702db1..a350a7ad6b 100644 --- a/compiler/tests/group/x_and_y.leo +++ b/compiler/tests/group/x_and_y.leo @@ -1,3 +1,3 @@ function main(element: group) { - let b = element; + const b = element; } \ No newline at end of file diff --git a/compiler/tests/group/x_sign_high.leo b/compiler/tests/group/x_sign_high.leo index 1b8d397d02..f38b54ad9a 100644 --- a/compiler/tests/group/x_sign_high.leo +++ b/compiler/tests/group/x_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, +)group; + const element = (0, +)group; } \ No newline at end of file diff --git a/compiler/tests/group/x_sign_inferred.leo b/compiler/tests/group/x_sign_inferred.leo index 9e9622a4a4..02c5ac988b 100644 --- a/compiler/tests/group/x_sign_inferred.leo +++ b/compiler/tests/group/x_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, _)group; + const element = (0, _)group; } \ No newline at end of file diff --git a/compiler/tests/group/x_sign_low.leo b/compiler/tests/group/x_sign_low.leo index a5058bda52..ad74d18b64 100644 --- a/compiler/tests/group/x_sign_low.leo +++ b/compiler/tests/group/x_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, -)group; + const element = (0, -)group; } \ No newline at end of file diff --git a/compiler/tests/group/y_sign_high.leo b/compiler/tests/group/y_sign_high.leo index fe16883b39..af2a20149d 100644 --- a/compiler/tests/group/y_sign_high.leo +++ b/compiler/tests/group/y_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, 1)group; + const element = (+, 1)group; } \ No newline at end of file diff --git a/compiler/tests/group/y_sign_inferred.leo b/compiler/tests/group/y_sign_inferred.leo index 003c373cf2..a4efa6a982 100644 --- a/compiler/tests/group/y_sign_inferred.leo +++ b/compiler/tests/group/y_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, 1)group; + const element = (_, 1)group; } \ No newline at end of file diff --git a/compiler/tests/group/y_sign_low.leo b/compiler/tests/group/y_sign_low.leo index 9e61bfd2bb..f557ed0d35 100644 --- a/compiler/tests/group/y_sign_low.leo +++ b/compiler/tests/group/y_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, 1)group; + const element = (-, 1)group; } \ No newline at end of file diff --git a/compiler/tests/group/zero.leo b/compiler/tests/group/zero.leo index e2c0283c21..6cdd4c960e 100644 --- a/compiler/tests/group/zero.leo +++ b/compiler/tests/group/zero.leo @@ -1,3 +1,3 @@ function main() { - let element = 0group; + const element = 0group; } \ No newline at end of file diff --git a/compiler/tests/import/many_import.leo b/compiler/tests/import/many_import.leo index 5e85f19778..08ae494c4f 100644 --- a/compiler/tests/import/many_import.leo +++ b/compiler/tests/import/many_import.leo @@ -12,15 +12,15 @@ import bar.( // imports directory import import car.Car; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let baz = Baz { z: 1u32 }; - let bazzar = Bazzar { a: 1u32 }; - let bat = Bat { t: 1u32 }; + const bar = Bar { r: 1u32 }; + const baz = Baz { z: 1u32 }; + const bazzar = Bazzar { a: 1u32 }; + const bat = Bat { t: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/compiler/tests/import/many_import_star.leo b/compiler/tests/import/many_import_star.leo index 5145d0d05d..575487a929 100644 --- a/compiler/tests/import/many_import_star.leo +++ b/compiler/tests/import/many_import_star.leo @@ -6,14 +6,14 @@ import bar.bat.bat.*; // imports directory import import car.*; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let bat = Bat { t: 1u32 }; - let baz = Baz { z: 1u32 }; + const bar = Bar { r: 1u32 }; + const bat = Bat { t: 1u32 }; + const baz = Baz { z: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/compiler/tests/import/multiple.leo b/compiler/tests/import/multiple.leo index 5c89aaee0c..4bd181c02d 100644 --- a/compiler/tests/import/multiple.leo +++ b/compiler/tests/import/multiple.leo @@ -4,7 +4,7 @@ import test-import.( ); function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/compiler/tests/import/star.leo b/compiler/tests/import/star.leo index 9cd817686f..69d0791627 100644 --- a/compiler/tests/import/star.leo +++ b/compiler/tests/import/star.leo @@ -1,7 +1,7 @@ import test-import.*; function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(foo() == 1u32); } \ No newline at end of file diff --git a/compiler/tests/input_files/program_input/main_multi_dimension_array.leo b/compiler/tests/input_files/program_input/main_multi_dimension_array.leo index 6e523c5fe2..7c89cc1082 100644 --- a/compiler/tests/input_files/program_input/main_multi_dimension_array.leo +++ b/compiler/tests/input_files/program_input/main_multi_dimension_array.leo @@ -1,7 +1,7 @@ function main(x: [i16; (2, 2, 3)]){ console.log("x: {}", x); - let y: [i16; (2, 2, 3)] = [0i16; (2, 2, 3)]; + const y: [i16; (2, 2, 3)] = [0i16; (2, 2, 3)]; console.log("y: {}", y); console.assert(x[0][0][0] == y[0][0][0]); diff --git a/compiler/tests/input_files/program_state/access_all.leo b/compiler/tests/input_files/program_state/access_all.leo index 4e7cba5776..2a60f218aa 100644 --- a/compiler/tests/input_files/program_state/access_all.leo +++ b/compiler/tests/input_files/program_state/access_all.leo @@ -1,7 +1,7 @@ function main(input) { console.assert(input.state.root == [0u8; 32]); - let expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const expected: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; //console.assert(input.record.owner, expected); console.assert(input.state_leaf.network_id == 0u8); diff --git a/compiler/tests/integers/i128/max.leo b/compiler/tests/integers/i128/max.leo index 46c0a32599..5ba44213e1 100644 --- a/compiler/tests/integers/i128/max.leo +++ b/compiler/tests/integers/i128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105727; + const a: i128 = 170141183460469231731687303715884105727; } \ No newline at end of file diff --git a/compiler/tests/integers/i128/max_fail.leo b/compiler/tests/integers/i128/max_fail.leo index 820eda8759..a9a46afd7f 100644 --- a/compiler/tests/integers/i128/max_fail.leo +++ b/compiler/tests/integers/i128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105728; + const a: i128 = 170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/compiler/tests/integers/i128/min.leo b/compiler/tests/integers/i128/min.leo index 5f32e5add5..19509a3fb0 100644 --- a/compiler/tests/integers/i128/min.leo +++ b/compiler/tests/integers/i128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; + const a: i128 = -170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/compiler/tests/integers/i128/min_fail.leo b/compiler/tests/integers/i128/min_fail.leo index 9035444fa9..918f0e439d 100644 --- a/compiler/tests/integers/i128/min_fail.leo +++ b/compiler/tests/integers/i128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105729; + const a: i128 = -170141183460469231731687303715884105729; } \ No newline at end of file diff --git a/compiler/tests/integers/i128/negate_min.leo b/compiler/tests/integers/i128/negate_min.leo index cfbd308362..c9de272960 100644 --- a/compiler/tests/integers/i128/negate_min.leo +++ b/compiler/tests/integers/i128/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; - let b = -a; + const a: i128 = -170141183460469231731687303715884105728; + const b = -a; } \ No newline at end of file diff --git a/compiler/tests/integers/i128/negate_zero.leo b/compiler/tests/integers/i128/negate_zero.leo index 9fb0c11afe..e079baf393 100644 --- a/compiler/tests/integers/i128/negate_zero.leo +++ b/compiler/tests/integers/i128/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i128; + const a = 0i128; console.assert(-a == 0i128); } \ No newline at end of file diff --git a/compiler/tests/integers/i128/ternary.leo b/compiler/tests/integers/i128/ternary.leo index a923c428e6..3783463b22 100644 --- a/compiler/tests/integers/i128/ternary.leo +++ b/compiler/tests/integers/i128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i128, b: i128, c: i128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/i16/max.leo b/compiler/tests/integers/i16/max.leo index 084fe4969a..2b70b3cc56 100644 --- a/compiler/tests/integers/i16/max.leo +++ b/compiler/tests/integers/i16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32767; + const a: i16 = 32767; } \ No newline at end of file diff --git a/compiler/tests/integers/i16/max_fail.leo b/compiler/tests/integers/i16/max_fail.leo index 8dd2b7f50a..209bcc6518 100644 --- a/compiler/tests/integers/i16/max_fail.leo +++ b/compiler/tests/integers/i16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32768; + const a: i16 = 32768; } \ No newline at end of file diff --git a/compiler/tests/integers/i16/min.leo b/compiler/tests/integers/i16/min.leo index 3331281fcf..3d05bef95a 100644 --- a/compiler/tests/integers/i16/min.leo +++ b/compiler/tests/integers/i16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32768; + const a: i16 = -32768; } \ No newline at end of file diff --git a/compiler/tests/integers/i16/min_fail.leo b/compiler/tests/integers/i16/min_fail.leo index 380848381a..13d7c8b7f2 100644 --- a/compiler/tests/integers/i16/min_fail.leo +++ b/compiler/tests/integers/i16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32769; + const a: i16 = -32769; } \ No newline at end of file diff --git a/compiler/tests/integers/i16/negate_min.leo b/compiler/tests/integers/i16/negate_min.leo index 2622f8d2a3..d52a356396 100644 --- a/compiler/tests/integers/i16/negate_min.leo +++ b/compiler/tests/integers/i16/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -32768i16; - let b = -a; + const a = -32768i16; + const b = -a; } \ No newline at end of file diff --git a/compiler/tests/integers/i16/negate_zero.leo b/compiler/tests/integers/i16/negate_zero.leo index 46340c3dc5..20f8a4fba7 100644 --- a/compiler/tests/integers/i16/negate_zero.leo +++ b/compiler/tests/integers/i16/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i16; + const a = 0i16; console.assert(-a == 0i16); } \ No newline at end of file diff --git a/compiler/tests/integers/i16/ternary.leo b/compiler/tests/integers/i16/ternary.leo index 4586b87bb4..d66c73cb93 100644 --- a/compiler/tests/integers/i16/ternary.leo +++ b/compiler/tests/integers/i16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i16, b: i16, c: i16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/i32/max.leo b/compiler/tests/integers/i32/max.leo index a9c707eb7f..074c75f1a6 100644 --- a/compiler/tests/integers/i32/max.leo +++ b/compiler/tests/integers/i32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483647; + const a: i32 = 2147483647; } \ No newline at end of file diff --git a/compiler/tests/integers/i32/max_fail.leo b/compiler/tests/integers/i32/max_fail.leo index f3fd81815f..af2877ff5e 100644 --- a/compiler/tests/integers/i32/max_fail.leo +++ b/compiler/tests/integers/i32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483648; + const a: i32 = 2147483648; } \ No newline at end of file diff --git a/compiler/tests/integers/i32/min.leo b/compiler/tests/integers/i32/min.leo index a29d591029..8436268ce6 100644 --- a/compiler/tests/integers/i32/min.leo +++ b/compiler/tests/integers/i32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483648; + const a: i32 = -2147483648; } \ No newline at end of file diff --git a/compiler/tests/integers/i32/min_fail.leo b/compiler/tests/integers/i32/min_fail.leo index 1462d207e9..11a683b087 100644 --- a/compiler/tests/integers/i32/min_fail.leo +++ b/compiler/tests/integers/i32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483649; + const a: i32 = -2147483649; } \ No newline at end of file diff --git a/compiler/tests/integers/i32/negate_min.leo b/compiler/tests/integers/i32/negate_min.leo index b3c10064e1..a96455d57a 100644 --- a/compiler/tests/integers/i32/negate_min.leo +++ b/compiler/tests/integers/i32/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -2147483648i32; - let b = -a; + const a = -2147483648i32; + const b = -a; } \ No newline at end of file diff --git a/compiler/tests/integers/i32/negate_zero.leo b/compiler/tests/integers/i32/negate_zero.leo index 5533f575a6..a3807b1f8a 100644 --- a/compiler/tests/integers/i32/negate_zero.leo +++ b/compiler/tests/integers/i32/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i32; + const a = 0i32; console.assert(-a == 0i32); } \ No newline at end of file diff --git a/compiler/tests/integers/i32/ternary.leo b/compiler/tests/integers/i32/ternary.leo index 7927c2998b..790769d62f 100644 --- a/compiler/tests/integers/i32/ternary.leo +++ b/compiler/tests/integers/i32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i32, b: i32, c: i32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/i64/max.leo b/compiler/tests/integers/i64/max.leo index e0d19881e6..593f91e110 100644 --- a/compiler/tests/integers/i64/max.leo +++ b/compiler/tests/integers/i64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775807; + const a: i64 = 9223372036854775807; } \ No newline at end of file diff --git a/compiler/tests/integers/i64/max_fail.leo b/compiler/tests/integers/i64/max_fail.leo index 3e6603e4be..362b794a2c 100644 --- a/compiler/tests/integers/i64/max_fail.leo +++ b/compiler/tests/integers/i64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775808; + const a: i64 = 9223372036854775808; } \ No newline at end of file diff --git a/compiler/tests/integers/i64/min.leo b/compiler/tests/integers/i64/min.leo index d7e99a87f8..794d8fbfac 100644 --- a/compiler/tests/integers/i64/min.leo +++ b/compiler/tests/integers/i64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775808; + const a: i64 = -9223372036854775808; } \ No newline at end of file diff --git a/compiler/tests/integers/i64/min_fail.leo b/compiler/tests/integers/i64/min_fail.leo index 11e43646b0..bb260ecc3f 100644 --- a/compiler/tests/integers/i64/min_fail.leo +++ b/compiler/tests/integers/i64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775809; + const a: i64 = -9223372036854775809; } \ No newline at end of file diff --git a/compiler/tests/integers/i64/negate_min.leo b/compiler/tests/integers/i64/negate_min.leo index 4dd27778d0..daf694491b 100644 --- a/compiler/tests/integers/i64/negate_min.leo +++ b/compiler/tests/integers/i64/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i64 = -9223372036854775808; - let b = -a; + const a: i64 = -9223372036854775808; + const b = -a; } \ No newline at end of file diff --git a/compiler/tests/integers/i64/negate_zero.leo b/compiler/tests/integers/i64/negate_zero.leo index 6badfe4dc7..81f09c19a3 100644 --- a/compiler/tests/integers/i64/negate_zero.leo +++ b/compiler/tests/integers/i64/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i64; + const a = 0i64; console.assert(-a == 0i64); } \ No newline at end of file diff --git a/compiler/tests/integers/i64/ternary.leo b/compiler/tests/integers/i64/ternary.leo index 1a2d03a77f..df63b3ad6a 100644 --- a/compiler/tests/integers/i64/ternary.leo +++ b/compiler/tests/integers/i64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i64, b: i64, c: i64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/i8/max.leo b/compiler/tests/integers/i8/max.leo index b51126da59..f20d59ddf4 100644 --- a/compiler/tests/integers/i8/max.leo +++ b/compiler/tests/integers/i8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 127; + const a: i8 = 127; } \ No newline at end of file diff --git a/compiler/tests/integers/i8/max_fail.leo b/compiler/tests/integers/i8/max_fail.leo index 4892505915..9e1956024a 100644 --- a/compiler/tests/integers/i8/max_fail.leo +++ b/compiler/tests/integers/i8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 128; + const a: i8 = 128; } \ No newline at end of file diff --git a/compiler/tests/integers/i8/min.leo b/compiler/tests/integers/i8/min.leo index d3c1bff5e4..7b6db025ea 100644 --- a/compiler/tests/integers/i8/min.leo +++ b/compiler/tests/integers/i8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -128; + const a: i8 = -128; } \ No newline at end of file diff --git a/compiler/tests/integers/i8/min_fail.leo b/compiler/tests/integers/i8/min_fail.leo index 051468ea70..41170e9b93 100644 --- a/compiler/tests/integers/i8/min_fail.leo +++ b/compiler/tests/integers/i8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -129; + const a: i8 = -129; } \ No newline at end of file diff --git a/compiler/tests/integers/i8/negate_min.leo b/compiler/tests/integers/i8/negate_min.leo index 3959da615e..7f664a1b78 100644 --- a/compiler/tests/integers/i8/negate_min.leo +++ b/compiler/tests/integers/i8/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -128i8; - let b = -a; + const a = -128i8; + const b = -a; } \ No newline at end of file diff --git a/compiler/tests/integers/i8/negate_zero.leo b/compiler/tests/integers/i8/negate_zero.leo index 21fbbab675..cc3f4a0828 100644 --- a/compiler/tests/integers/i8/negate_zero.leo +++ b/compiler/tests/integers/i8/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i8; + const a = 0i8; console.assert(-a == 0i8); } \ No newline at end of file diff --git a/compiler/tests/integers/i8/ternary.leo b/compiler/tests/integers/i8/ternary.leo index e1ec1943c9..0956a9cd39 100644 --- a/compiler/tests/integers/i8/ternary.leo +++ b/compiler/tests/integers/i8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i8, b: i8, c: i8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/u128/max.leo b/compiler/tests/integers/u128/max.leo index 6da59dd058..b166ede06b 100644 --- a/compiler/tests/integers/u128/max.leo +++ b/compiler/tests/integers/u128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211455; + const a: u128 = 340282366920938463463374607431768211455; } \ No newline at end of file diff --git a/compiler/tests/integers/u128/max_fail.leo b/compiler/tests/integers/u128/max_fail.leo index 40cdf7d2bb..f51c967925 100644 --- a/compiler/tests/integers/u128/max_fail.leo +++ b/compiler/tests/integers/u128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211456; + const a: u128 = 340282366920938463463374607431768211456; } \ No newline at end of file diff --git a/compiler/tests/integers/u128/min.leo b/compiler/tests/integers/u128/min.leo index 044bda9e1c..41fbf1a2fe 100644 --- a/compiler/tests/integers/u128/min.leo +++ b/compiler/tests/integers/u128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 0; + const a: u128 = 0; } \ No newline at end of file diff --git a/compiler/tests/integers/u128/min_fail.leo b/compiler/tests/integers/u128/min_fail.leo index df2390c576..b0d17191ff 100644 --- a/compiler/tests/integers/u128/min_fail.leo +++ b/compiler/tests/integers/u128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = -1; + const a: u128 = -1; } \ No newline at end of file diff --git a/compiler/tests/integers/u128/ternary.leo b/compiler/tests/integers/u128/ternary.leo index 22e2e67058..99a6b997e0 100644 --- a/compiler/tests/integers/u128/ternary.leo +++ b/compiler/tests/integers/u128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u128, b: u128, c: u128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/u16/max.leo b/compiler/tests/integers/u16/max.leo index a707df9af8..56cb2af18d 100644 --- a/compiler/tests/integers/u16/max.leo +++ b/compiler/tests/integers/u16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65535; + const a: u16 = 65535; } \ No newline at end of file diff --git a/compiler/tests/integers/u16/max_fail.leo b/compiler/tests/integers/u16/max_fail.leo index 68ff0481e0..bb703210e3 100644 --- a/compiler/tests/integers/u16/max_fail.leo +++ b/compiler/tests/integers/u16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65536; + const a: u16 = 65536; } \ No newline at end of file diff --git a/compiler/tests/integers/u16/min.leo b/compiler/tests/integers/u16/min.leo index ab1bd7db48..4dee94a1a4 100644 --- a/compiler/tests/integers/u16/min.leo +++ b/compiler/tests/integers/u16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 0; + const a: u16 = 0; } \ No newline at end of file diff --git a/compiler/tests/integers/u16/min_fail.leo b/compiler/tests/integers/u16/min_fail.leo index 99b7310362..0c61dd7ddf 100644 --- a/compiler/tests/integers/u16/min_fail.leo +++ b/compiler/tests/integers/u16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = -1; + const a: u16 = -1; } \ No newline at end of file diff --git a/compiler/tests/integers/u16/ternary.leo b/compiler/tests/integers/u16/ternary.leo index 11d836570d..d6131f9f4f 100644 --- a/compiler/tests/integers/u16/ternary.leo +++ b/compiler/tests/integers/u16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u16, b: u16, c: u16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/u32/max.leo b/compiler/tests/integers/u32/max.leo index 2950164a08..4a07281b5d 100644 --- a/compiler/tests/integers/u32/max.leo +++ b/compiler/tests/integers/u32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967295; + const a: u32 = 4294967295; } \ No newline at end of file diff --git a/compiler/tests/integers/u32/max_fail.leo b/compiler/tests/integers/u32/max_fail.leo index 96c7e01657..6b1631876e 100644 --- a/compiler/tests/integers/u32/max_fail.leo +++ b/compiler/tests/integers/u32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967296; + const a: u32 = 4294967296; } \ No newline at end of file diff --git a/compiler/tests/integers/u32/min.leo b/compiler/tests/integers/u32/min.leo index 0f1c080938..8077e0ec02 100644 --- a/compiler/tests/integers/u32/min.leo +++ b/compiler/tests/integers/u32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 0; + const a: u32 = 0; } \ No newline at end of file diff --git a/compiler/tests/integers/u32/min_fail.leo b/compiler/tests/integers/u32/min_fail.leo index a8d41c475a..c3e3f33225 100644 --- a/compiler/tests/integers/u32/min_fail.leo +++ b/compiler/tests/integers/u32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = -1; + const a: u32 = -1; } \ No newline at end of file diff --git a/compiler/tests/integers/u32/ternary.leo b/compiler/tests/integers/u32/ternary.leo index 3c96a7236c..f32ffc29fe 100644 --- a/compiler/tests/integers/u32/ternary.leo +++ b/compiler/tests/integers/u32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u32, b: u32, c: u32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/u64/max.leo b/compiler/tests/integers/u64/max.leo index 985897c006..f14ac7ce64 100644 --- a/compiler/tests/integers/u64/max.leo +++ b/compiler/tests/integers/u64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551615; + const a: u64 = 18446744073709551615; } \ No newline at end of file diff --git a/compiler/tests/integers/u64/max_fail.leo b/compiler/tests/integers/u64/max_fail.leo index 0ca3f13895..d606c83585 100644 --- a/compiler/tests/integers/u64/max_fail.leo +++ b/compiler/tests/integers/u64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551616; + const a: u64 = 18446744073709551616; } \ No newline at end of file diff --git a/compiler/tests/integers/u64/min.leo b/compiler/tests/integers/u64/min.leo index aa9b72fc8a..b1da40b14c 100644 --- a/compiler/tests/integers/u64/min.leo +++ b/compiler/tests/integers/u64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 0; + const a: u64 = 0; } \ No newline at end of file diff --git a/compiler/tests/integers/u64/min_fail.leo b/compiler/tests/integers/u64/min_fail.leo index 81b90cc74a..e58f1897e6 100644 --- a/compiler/tests/integers/u64/min_fail.leo +++ b/compiler/tests/integers/u64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = -1; + const a: u64 = -1; } \ No newline at end of file diff --git a/compiler/tests/integers/u64/ternary.leo b/compiler/tests/integers/u64/ternary.leo index 4c4ddd8e0c..4427cd0466 100644 --- a/compiler/tests/integers/u64/ternary.leo +++ b/compiler/tests/integers/u64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u64, b: u64, c: u64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/integers/u8/max.leo b/compiler/tests/integers/u8/max.leo index 684bdfba10..03e82c9a5e 100644 --- a/compiler/tests/integers/u8/max.leo +++ b/compiler/tests/integers/u8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 255; + const a: u8 = 255; } \ No newline at end of file diff --git a/compiler/tests/integers/u8/max_fail.leo b/compiler/tests/integers/u8/max_fail.leo index f2b870096d..01bb544601 100644 --- a/compiler/tests/integers/u8/max_fail.leo +++ b/compiler/tests/integers/u8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 256; + const a: u8 = 256; } \ No newline at end of file diff --git a/compiler/tests/integers/u8/min.leo b/compiler/tests/integers/u8/min.leo index a88e33c5a6..1db08a07b5 100644 --- a/compiler/tests/integers/u8/min.leo +++ b/compiler/tests/integers/u8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 0; + const a: u8 = 0; } \ No newline at end of file diff --git a/compiler/tests/integers/u8/min_fail.leo b/compiler/tests/integers/u8/min_fail.leo index 7b91dc6e1a..3cd8d46de7 100644 --- a/compiler/tests/integers/u8/min_fail.leo +++ b/compiler/tests/integers/u8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = -1; + const a: u8 = -1; } \ No newline at end of file diff --git a/compiler/tests/integers/u8/ternary.leo b/compiler/tests/integers/u8/ternary.leo index 1b436aa054..5123a511cd 100644 --- a/compiler/tests/integers/u8/ternary.leo +++ b/compiler/tests/integers/u8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u8, b: u8, c: u8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/compiler/tests/mutability/array.leo b/compiler/tests/mutability/array.leo index 1d51c15271..ea63baaad2 100644 --- a/compiler/tests/mutability/array.leo +++ b/compiler/tests/mutability/array.leo @@ -1,5 +1,5 @@ // Arrays are immutable by default. function main() { - let a = [1u32]; + const a = [1u32]; a[0] = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/array_mut.leo b/compiler/tests/mutability/array_mut.leo index 1b86bac80f..5d4db3b68a 100644 --- a/compiler/tests/mutability/array_mut.leo +++ b/compiler/tests/mutability/array_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32]; + let a = [1u32]; a[0] = 0; console.assert(a[0] == 0u32); diff --git a/compiler/tests/mutability/array_splice_mut.leo b/compiler/tests/mutability/array_splice_mut.leo index 57cc67e872..d13216600a 100644 --- a/compiler/tests/mutability/array_splice_mut.leo +++ b/compiler/tests/mutability/array_splice_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32, 2u32, 3u32]; + let a = [1u32, 2u32, 3u32]; a[0u32..2u32] = [4u32, 5u32]; console.assert(a[0] == 4u32); diff --git a/compiler/tests/mutability/array_tuple_mut.leo b/compiler/tests/mutability/array_tuple_mut.leo index e0096bd7ac..ed323d46da 100644 --- a/compiler/tests/mutability/array_tuple_mut.leo +++ b/compiler/tests/mutability/array_tuple_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [(1u32, 2u32)]; + let a = [(1u32, 2u32)]; a[0u32].1 = 3u32; console.assert(a[0u32].0 == 1u32); diff --git a/compiler/tests/mutability/circuit.leo b/compiler/tests/mutability/circuit.leo index be1c568836..508595ef16 100644 --- a/compiler/tests/mutability/circuit.leo +++ b/compiler/tests/mutability/circuit.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let a = Foo { x: 1 }; + const a = Foo { x: 1 }; a.x = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/circuit_function_mut.leo b/compiler/tests/mutability/circuit_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/compiler/tests/mutability/circuit_function_mut.leo +++ b/compiler/tests/mutability/circuit_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/circuit_mut.leo b/compiler/tests/mutability/circuit_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/compiler/tests/mutability/circuit_mut.leo +++ b/compiler/tests/mutability/circuit_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/compiler/tests/mutability/circuit_static_function_mut.leo b/compiler/tests/mutability/circuit_static_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/compiler/tests/mutability/circuit_static_function_mut.leo +++ b/compiler/tests/mutability/circuit_static_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/circuit_variable_mut.leo b/compiler/tests/mutability/circuit_variable_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/compiler/tests/mutability/circuit_variable_mut.leo +++ b/compiler/tests/mutability/circuit_variable_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/compiler/tests/mutability/const.leo b/compiler/tests/mutability/const.leo index d2a3a6ac2b..6201e7c5af 100644 --- a/compiler/tests/mutability/const.leo +++ b/compiler/tests/mutability/const.leo @@ -1,5 +1,5 @@ // Let variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/let.leo b/compiler/tests/mutability/let.leo index 477e6b35f5..105730adb7 100644 --- a/compiler/tests/mutability/let.leo +++ b/compiler/tests/mutability/let.leo @@ -1,5 +1,5 @@ // Variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/compiler/tests/mutability/let_mut.leo b/compiler/tests/mutability/let_mut.leo index 5766d144d3..cd1060d0d2 100644 --- a/compiler/tests/mutability/let_mut.leo +++ b/compiler/tests/mutability/let_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes a variable mutable. function main() { - let mut a = 1u32; + let a = 1u32; a = 0; console.assert(a == 0u32); diff --git a/compiler/tests/mutability/let_mut_nested.leo b/compiler/tests/mutability/let_mut_nested.leo index 27121f6e48..93236ef4c6 100644 --- a/compiler/tests/mutability/let_mut_nested.leo +++ b/compiler/tests/mutability/let_mut_nested.leo @@ -1,5 +1,5 @@ function main () { - let mut x = 2u8; - let mut y = x; - let z = y / 2u8; + let x = 2u8; + let y = x; + const z = y / 2u8; } \ No newline at end of file diff --git a/compiler/tests/mutability/swap.leo b/compiler/tests/mutability/swap.leo index 0a209149ee..b2a795e826 100644 --- a/compiler/tests/mutability/swap.leo +++ b/compiler/tests/mutability/swap.leo @@ -1,17 +1,17 @@ // Swap two elements of an array. function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { - let t = a[i]; + const t = a[i]; a[i] = a[j]; a[j] = t; return a } function main() { - let mut arr: [u32; 2] = [0, 1]; - let expected: [u32; 2] = [1, 0]; + let arr: [u32; 2] = [0, 1]; + const expected: [u32; 2] = [1, 0]; // Do swap. - let actual = swap(arr, 0, 1); + const actual = swap(arr, 0, 1); // Check result. for i in 0..2 { diff --git a/compiler/tests/statements/block.leo b/compiler/tests/statements/block.leo index 8650808041..ca8da645ec 100644 --- a/compiler/tests/statements/block.leo +++ b/compiler/tests/statements/block.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; { x = 5u32; diff --git a/compiler/tests/statements/conditional/chain.leo b/compiler/tests/statements/conditional/chain.leo index dbc0e1f38c..44d4e86243 100644 --- a/compiler/tests/statements/conditional/chain.leo +++ b/compiler/tests/statements/conditional/chain.leo @@ -1,5 +1,5 @@ function main(a: u32, b: u32) { - let mut c = 0u32; + let c = 0u32; if a == 1 { c = 1; diff --git a/compiler/tests/statements/conditional/for_loop.leo b/compiler/tests/statements/conditional/for_loop.leo index 2dca076858..db307f3c36 100644 --- a/compiler/tests/statements/conditional/for_loop.leo +++ b/compiler/tests/statements/conditional/for_loop.leo @@ -1,5 +1,5 @@ function main(a: bool) { - let mut b = 0u32; + let b = 0u32; if a { for i in 0..4 { @@ -7,7 +7,7 @@ function main(a: bool) { } } - let r: u32 = a ? 6 : 0; + const r: u32 = a ? 6 : 0; console.assert(r == b); } diff --git a/compiler/tests/statements/conditional/mutate.leo b/compiler/tests/statements/conditional/mutate.leo index 458d3d0d60..9bb124eefd 100644 --- a/compiler/tests/statements/conditional/mutate.leo +++ b/compiler/tests/statements/conditional/mutate.leo @@ -1,5 +1,5 @@ function main(a: u32) { - let mut b = 5u32; + let b = 5u32; if a == 1 { b = 1; diff --git a/compiler/tests/statements/conditional/nested.leo b/compiler/tests/statements/conditional/nested.leo index 3596f889d1..1849c2a339 100644 --- a/compiler/tests/statements/conditional/nested.leo +++ b/compiler/tests/statements/conditional/nested.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool, c: u32) { - let mut d = 0u32; + let d = 0u32; if a { d += 1; diff --git a/compiler/tests/statements/iteration_basic.leo b/compiler/tests/statements/iteration_basic.leo index 103c9abb9e..5d74e69a1f 100644 --- a/compiler/tests/statements/iteration_basic.leo +++ b/compiler/tests/statements/iteration_basic.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; for i in 0..3 { x -= 1; } diff --git a/compiler/tests/statements/ternary_basic.leo b/compiler/tests/statements/ternary_basic.leo index 675b681fa9..38359004a9 100644 --- a/compiler/tests/statements/ternary_basic.leo +++ b/compiler/tests/statements/ternary_basic.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool) { - let c = a ? true : false; + const c = a ? true : false; - let d = c == b; + const d = c == b; } \ No newline at end of file diff --git a/compiler/tests/syntax/compare_mismatched_types.leo b/compiler/tests/syntax/compare_mismatched_types.leo index 8cf6327cb3..1ac81ab098 100644 --- a/compiler/tests/syntax/compare_mismatched_types.leo +++ b/compiler/tests/syntax/compare_mismatched_types.leo @@ -1,3 +1,3 @@ function main() { - let a = -5i8 > 342u32; + const a = -5i8 > 342u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/address_fail.leo b/compiler/tests/syntax/identifiers/address_fail.leo index 4eb12c7743..b39ea75df6 100644 --- a/compiler/tests/syntax/identifiers/address_fail.leo +++ b/compiler/tests/syntax/identifiers/address_fail.leo @@ -1,3 +1,3 @@ function main() { - let address = 0u32; + const address = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/console_fail.leo b/compiler/tests/syntax/identifiers/console_fail.leo index 6ee932a66b..c0229dd624 100644 --- a/compiler/tests/syntax/identifiers/console_fail.leo +++ b/compiler/tests/syntax/identifiers/console_fail.leo @@ -1,3 +1,3 @@ function main() { - let console = 0u32; + const console = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/field_fail.leo b/compiler/tests/syntax/identifiers/field_fail.leo index a1f85dc6ea..33bb3118d8 100644 --- a/compiler/tests/syntax/identifiers/field_fail.leo +++ b/compiler/tests/syntax/identifiers/field_fail.leo @@ -1,3 +1,3 @@ function main() { - let field = 0u32; + const field = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/group_fail.leo b/compiler/tests/syntax/identifiers/group_fail.leo index 322997ea50..db71c8a792 100644 --- a/compiler/tests/syntax/identifiers/group_fail.leo +++ b/compiler/tests/syntax/identifiers/group_fail.leo @@ -1,3 +1,3 @@ function main() { - let group = 0u32; + const group = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/i8_fail.leo b/compiler/tests/syntax/identifiers/i8_fail.leo index 596a9056ab..a2d868f9f5 100644 --- a/compiler/tests/syntax/identifiers/i8_fail.leo +++ b/compiler/tests/syntax/identifiers/i8_fail.leo @@ -1,3 +1,3 @@ function main() { - let i8 = 0u32; + const i8 = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/input_fail.leo b/compiler/tests/syntax/identifiers/input_fail.leo index e1b466d6d4..0053565a6f 100644 --- a/compiler/tests/syntax/identifiers/input_fail.leo +++ b/compiler/tests/syntax/identifiers/input_fail.leo @@ -1,3 +1,3 @@ function main() { - let input = 0u32; + const input = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/self_keyword_fail.leo b/compiler/tests/syntax/identifiers/self_keyword_fail.leo index 28b899ccd4..79bc4d6e96 100644 --- a/compiler/tests/syntax/identifiers/self_keyword_fail.leo +++ b/compiler/tests/syntax/identifiers/self_keyword_fail.leo @@ -1,3 +1,3 @@ function main() { - let Self = 0u32; + const Self = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/self_type_fail.leo b/compiler/tests/syntax/identifiers/self_type_fail.leo index 28b899ccd4..79bc4d6e96 100644 --- a/compiler/tests/syntax/identifiers/self_type_fail.leo +++ b/compiler/tests/syntax/identifiers/self_type_fail.leo @@ -1,3 +1,3 @@ function main() { - let Self = 0u32; + const Self = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/true_fail.leo b/compiler/tests/syntax/identifiers/true_fail.leo index 4eb12c7743..b39ea75df6 100644 --- a/compiler/tests/syntax/identifiers/true_fail.leo +++ b/compiler/tests/syntax/identifiers/true_fail.leo @@ -1,3 +1,3 @@ function main() { - let address = 0u32; + const address = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/identifiers/u8_fail.leo b/compiler/tests/syntax/identifiers/u8_fail.leo index 77687f5ff2..4a48780a29 100644 --- a/compiler/tests/syntax/identifiers/u8_fail.leo +++ b/compiler/tests/syntax/identifiers/u8_fail.leo @@ -1,3 +1,3 @@ function main() { - let u8 = 0u32; + const u8 = 0u32; } \ No newline at end of file diff --git a/compiler/tests/syntax/semicolon.leo b/compiler/tests/syntax/semicolon.leo index 68cfa7cbe0..f1deb29e37 100644 --- a/compiler/tests/syntax/semicolon.leo +++ b/compiler/tests/syntax/semicolon.leo @@ -1,3 +1,3 @@ function main() { - let a = 0 + const a = 0 } \ No newline at end of file diff --git a/compiler/tests/tuples/access.leo b/compiler/tests/tuples/access.leo index 196e9d058c..9277f4ecc5 100644 --- a/compiler/tests/tuples/access.leo +++ b/compiler/tests/tuples/access.leo @@ -1,5 +1,5 @@ function main() { - let a = (true, false); + const a = (true, false); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/compiler/tests/tuples/basic.leo b/compiler/tests/tuples/basic.leo index 37c728611c..2e777f2797 100644 --- a/compiler/tests/tuples/basic.leo +++ b/compiler/tests/tuples/basic.leo @@ -1,3 +1,3 @@ function main() { - let a = (true, false); + const a = (true, false); } \ No newline at end of file diff --git a/compiler/tests/tuples/function.leo b/compiler/tests/tuples/function.leo index b318348813..4222b858cb 100644 --- a/compiler/tests/tuples/function.leo +++ b/compiler/tests/tuples/function.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a = foo(); + const a = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/compiler/tests/tuples/function_multiple.leo b/compiler/tests/tuples/function_multiple.leo index 39848377c6..73fbe277ae 100644 --- a/compiler/tests/tuples/function_multiple.leo +++ b/compiler/tests/tuples/function_multiple.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let (a, b) = foo(); + const (a, b) = foo(); console.assert(a == true); console.assert(b == false); diff --git a/compiler/tests/tuples/function_typed.leo b/compiler/tests/tuples/function_typed.leo index 8af2c907ca..f89e7a3273 100644 --- a/compiler/tests/tuples/function_typed.leo +++ b/compiler/tests/tuples/function_typed.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a: (bool, bool) = foo(); + const a: (bool, bool) = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/compiler/tests/tuples/multiple.leo b/compiler/tests/tuples/multiple.leo index b7627dad2a..2cb003b0e1 100644 --- a/compiler/tests/tuples/multiple.leo +++ b/compiler/tests/tuples/multiple.leo @@ -1,5 +1,5 @@ function main() { - let (a, b) = (true, false); + const (a, b) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/compiler/tests/tuples/multiple_typed.leo b/compiler/tests/tuples/multiple_typed.leo index 29fc7ef877..bbe4a01858 100644 --- a/compiler/tests/tuples/multiple_typed.leo +++ b/compiler/tests/tuples/multiple_typed.leo @@ -1,5 +1,5 @@ function main() { - let (a, b): (bool, bool) = (true, false); + const (a, b): (bool, bool) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/compiler/tests/tuples/nested.leo b/compiler/tests/tuples/nested.leo index a9599b360c..bbdb2394a8 100644 --- a/compiler/tests/tuples/nested.leo +++ b/compiler/tests/tuples/nested.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); } \ No newline at end of file diff --git a/compiler/tests/tuples/nested_access.leo b/compiler/tests/tuples/nested_access.leo index 5edba64e24..f21fa59bba 100644 --- a/compiler/tests/tuples/nested_access.leo +++ b/compiler/tests/tuples/nested_access.leo @@ -1,6 +1,6 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); console.assert(b.0 == true); console.assert(b.1.0 == true); diff --git a/compiler/tests/tuples/nested_typed.leo b/compiler/tests/tuples/nested_typed.leo index 2e68117a2b..44a10b2a3e 100644 --- a/compiler/tests/tuples/nested_typed.leo +++ b/compiler/tests/tuples/nested_typed.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b: (bool, (bool, bool)) = (true, a); + const a = (true, false); + const b: (bool, (bool, bool)) = (true, a); } \ No newline at end of file diff --git a/compiler/tests/tuples/typed.leo b/compiler/tests/tuples/typed.leo index 8cd2ed79db..8f623fc148 100644 --- a/compiler/tests/tuples/typed.leo +++ b/compiler/tests/tuples/typed.leo @@ -1,3 +1,3 @@ function main() { - let a: (bool, bool) = (true, false); + const a: (bool, bool) = (true, false); } \ No newline at end of file diff --git a/examples/hello-world/src/main.leo b/examples/hello-world/src/main.leo index 5cd23178f9..f78b77e855 100644 --- a/examples/hello-world/src/main.leo +++ b/examples/hello-world/src/main.leo @@ -1,5 +1,5 @@ // The 'hello-world' main function. function main(a: u32, b: u32) -> u32 { - let c: u32 = a + b; + const c: u32 = a + b; return c } diff --git a/examples/pedersen-hash/src/main.leo b/examples/pedersen-hash/src/main.leo index e0adfecaec..f1f142e731 100644 --- a/examples/pedersen-hash/src/main.leo +++ b/examples/pedersen-hash/src/main.leo @@ -7,7 +7,7 @@ circuit PedersenHash { } function hash(self, bits: [bool; 256]) -> group { - let mut digest: group = 0group; + let digest: group = 0group; for i in 0..256 { if bits[i] { digest += self.parameters[i]; @@ -19,9 +19,9 @@ circuit PedersenHash { // The 'pedersen-hash' main function. function main() -> group { - let parameters = [1group; 256]; - let pedersen = PedersenHash::new(parameters); - let hash_input: [bool; 256] = [true; 256]; + const parameters = [1group; 256]; + const pedersen = PedersenHash::new(parameters); + const hash_input: [bool; 256] = [true; 256]; return pedersen.hash(hash_input) } diff --git a/parser/benches/big_circuit.leo b/parser/benches/big_circuit.leo index 32011551c0..01d10c2daa 100644 --- a/parser/benches/big_circuit.leo +++ b/parser/benches/big_circuit.leo @@ -1,6 +1,6 @@ function main() { - let foo = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 }; - let bar = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 }; + const foo = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 }; + const bar = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 }; return foo.x0 + bar.x255 } diff --git a/parser/benches/big_if_else.leo b/parser/benches/big_if_else.leo index 6c974f12a3..db0d5f45e8 100644 --- a/parser/benches/big_if_else.leo +++ b/parser/benches/big_if_else.leo @@ -1,5 +1,5 @@ function main() { - let x: u8 = 191; + const x: u8 = 191; if x == 0 { return x diff --git a/parser/benches/big_ternary.leo b/parser/benches/big_ternary.leo index 6b16291dca..46e9cd6aed 100644 --- a/parser/benches/big_ternary.leo +++ b/parser/benches/big_ternary.leo @@ -1,5 +1,5 @@ function main() { - let x: u8 = 255; + const x: u8 = 255; return x == 0 ? x : (x == 1 ? x : (x == 2 ? x : (x == 3 ? x : (x == 4 ? x : (x == 5 ? x : (x == 6 ? x : (x == 7 ? x : (x == 8 ? x : (x == 9 ? x : (x == 10 ? x : (x == 11 ? x : (x == 12 ? x : (x == 13 ? x : (x == 14 ? x : (x == 15 ? x : (x == 16 ? x : (x == 17 ? x : (x == 18 ? x : (x == 19 ? x : (x == 20 ? x : (x == 21 ? x : (x == 22 ? x : (x == 23 ? x : (x == 24 ? x : (x == 25 ? x : (x == 26 ? x : (x == 27 ? x : (x == 28 ? x : (x == 29 ? x : (x == 30 ? x : (x == 31 ? x : (x == 32 ? x : (x == 33 ? x : (x == 34 ? x : (x == 35 ? x : (x == 36 ? x : (x == 37 ? x : (x == 38 ? x : (x == 39 ? x : (x == 40 ? x : (x == 41 ? x : (x == 42 ? x : (x == 43 ? x : (x == 44 ? x : (x == 45 ? x : (x == 46 ? x : (x == 47 ? x : (x == 48 ? x : (x == 49 ? x : (x == 50 ? x : (x == 51 ? x : (x == 52 ? x : (x == 53 ? x : (x == 54 ? x : (x == 55 ? x : (x == 56 ? x : (x == 57 ? x : (x == 58 ? x : (x == 59 ? x : (x == 60 ? x : (x == 61 ? x : (x == 62 ? x : (x == 63 ? x : (x == 64 ? x : (x == 65 ? x : (x == 66 ? x : (x == 67 ? x : (x == 68 ? x : (x == 69 ? x : (x == 70 ? x : (x == 71 ? x : (x == 72 ? x : (x == 73 ? x : (x == 74 ? x : (x == 75 ? x : (x == 76 ? x : (x == 77 ? x : (x == 78 ? x : (x == 79 ? x : (x == 80 ? x : (x == 81 ? x : (x == 82 ? x : (x == 83 ? x : (x == 84 ? x : (x == 85 ? x : (x == 86 ? x : (x == 87 ? x : (x == 88 ? x : (x == 89 ? x : (x == 90 ? x : (x == 91 ? x : (x == 92 ? x : (x == 93 ? x : (x == 94 ? x : (x == 95 ? x : (x == 96 ? x : (x == 97 ? x : (x == 98 ? x : (x == 99 ? x : (x == 100 ? x : (x == 101 ? x : (x == 102 ? x : (x == 103 ? x : (x == 104 ? x : (x == 105 ? x : (x == 106 ? x : (x == 107 ? x : (x == 108 ? x : (x == 109 ? x : (x == 110 ? x : (x == 111 ? x : (x == 112 ? x : (x == 113 ? x : (x == 114 ? x : (x == 115 ? x : (x == 116 ? x : (x == 117 ? x : (x == 118 ? x : (x == 119 ? x : (x == 120 ? x : (x == 121 ? x : (x == 122 ? x : (x == 123 ? x : (x == 124 ? x : (x == 125 ? x : (x == 126 ? x : (x == 127 ? x : (x == 128 ? x : (x == 129 ? x : (x == 130 ? x : (x == 131 ? x : (x == 132 ? x : (x == 133 ? x : (x == 134 ? x : (x == 135 ? x : (x == 136 ? x : (x == 137 ? x : (x == 138 ? x : (x == 139 ? x : (x == 140 ? x : (x == 141 ? x : (x == 142 ? x : (x == 143 ? x : (x == 144 ? x : (x == 145 ? x : (x == 146 ? x : (x == 147 ? x : (x == 148 ? x : (x == 149 ? x : (x == 150 ? x : (x == 151 ? x : (x == 152 ? x : (x == 153 ? x : (x == 154 ? x : (x == 155 ? x : (x == 156 ? x : (x == 157 ? x : (x == 158 ? x : (x == 159 ? x : (x == 160 ? x : (x == 161 ? x : (x == 162 ? x : (x == 163 ? x : (x == 164 ? x : (x == 165 ? x : (x == 166 ? x : (x == 167 ? x : (x == 168 ? x : (x == 169 ? x : (x == 170 ? x : (x == 171 ? x : (x == 172 ? x : (x == 173 ? x : (x == 174 ? x : (x == 175 ? x : (x == 176 ? x : (x == 177 ? x : (x == 178 ? x : (x == 179 ? x : (x == 180 ? x : (x == 181 ? x : (x == 182 ? x : (x == 183 ? x : (x == 184 ? x : (x == 185 ? x : (x == 186 ? x : (x == 187 ? x : (x == 188 ? x : (x == 189 ? x : (x == 190 ? x : (x == 191 ? x : (x == 192 ? x : (x == 193 ? x : (x == 194 ? x : (x == 195 ? x : (x == 196 ? x : (x == 197 ? x : (x == 198 ? x : (x == 199 ? x : (x == 200 ? x : (x == 201 ? x : (x == 202 ? x : (x == 203 ? x : (x == 204 ? x : (x == 205 ? x : (x == 206 ? x : (x == 207 ? x : (x == 208 ? x : (x == 209 ? x : (x == 210 ? x : (x == 211 ? x : (x == 212 ? x : (x == 213 ? x : (x == 214 ? x : (x == 215 ? x : (x == 216 ? x : (x == 217 ? x : (x == 218 ? x : (x == 219 ? x : (x == 220 ? x : (x == 221 ? x : (x == 222 ? x : (x == 223 ? x : (x == 224 ? x : (x == 225 ? x : (x == 226 ? x : (x == 227 ? x : (x == 228 ? x : (x == 229 ? x : (x == 230 ? x : (x == 231 ? x : (x == 232 ? x : (x == 233 ? x : (x == 234 ? x : (x == 235 ? x : (x == 236 ? x : (x == 237 ? x : (x == 238 ? x : (x == 239 ? x : (x == 240 ? x : (x == 241 ? x : (x == 242 ? x : (x == 243 ? x : (x == 244 ? x : (x == 245 ? x : (x == 246 ? x : (x == 247 ? x : (x == 248 ? x : (x == 249 ? x : (x == 250 ? x : (x == 251 ? x : (x == 252 ? x : (x == 253 ? x : (x == 254 ? x : (x == 255 ? x : 0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) } \ No newline at end of file diff --git a/parser/benches/long_array.leo b/parser/benches/long_array.leo index 282feb66d0..48094244b6 100644 --- a/parser/benches/long_array.leo +++ b/parser/benches/long_array.leo @@ -1,5 +1,5 @@ function main() { - let arr1: [u8; (32, 32)] = [ + const arr1: [u8; (32, 32)] = [ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], @@ -34,7 +34,7 @@ function main() { [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31] ]; - let arr2: [u8; (16, 32)] = [ + const arr2: [u8; (16, 32)] = [ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31], diff --git a/parser/benches/long_expr.leo b/parser/benches/long_expr.leo index 8cbfb99939..31cf1e0641 100644 --- a/parser/benches/long_expr.leo +++ b/parser/benches/long_expr.leo @@ -1,9 +1,9 @@ function main() { - let a = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; - let b = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; - let c = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; - let d = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; - let e = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; + const a = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; + const b = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; + const c = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; + const d = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; + const e = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; return a + b + c + d + e } diff --git a/parser/benches/many_assigns.leo b/parser/benches/many_assigns.leo index 8f174abc4b..202bbf0da4 100644 --- a/parser/benches/many_assigns.leo +++ b/parser/benches/many_assigns.leo @@ -1,388 +1,388 @@ function main() { - let x0: u8 = 0; - let x1: u8 = x0; - let x2: u8 = x1; - let x3: u8 = x2; - let x4: u8 = x3; - let x5: u8 = x4; - let x6: u8 = x5; - let x7: u8 = x6; - let x8: u8 = x7; - let x9: u8 = x8; - let x10: u8 = x9; - let x11: u8 = x10; - let x12: u8 = x11; - let x13: u8 = x12; - let x14: u8 = x13; - let x15: u8 = x14; - let x16: u8 = x15; - let x17: u8 = x16; - let x18: u8 = x17; - let x19: u8 = x18; - let x20: u8 = x19; - let x21: u8 = x20; - let x22: u8 = x21; - let x23: u8 = x22; - let x24: u8 = x23; - let x25: u8 = x24; - let x26: u8 = x25; - let x27: u8 = x26; - let x28: u8 = x27; - let x29: u8 = x28; - let x30: u8 = x29; - let x31: u8 = x30; - let x32: u8 = x31; - let x33: u8 = x32; - let x34: u8 = x33; - let x35: u8 = x34; - let x36: u8 = x35; - let x37: u8 = x36; - let x38: u8 = x37; - let x39: u8 = x38; - let x40: u8 = x39; - let x41: u8 = x40; - let x42: u8 = x41; - let x43: u8 = x42; - let x44: u8 = x43; - let x45: u8 = x44; - let x46: u8 = x45; - let x47: u8 = x46; - let x48: u8 = x47; - let x49: u8 = x48; - let x50: u8 = x49; - let x51: u8 = x50; - let x52: u8 = x51; - let x53: u8 = x52; - let x54: u8 = x53; - let x55: u8 = x54; - let x56: u8 = x55; - let x57: u8 = x56; - let x58: u8 = x57; - let x59: u8 = x58; - let x60: u8 = x59; - let x61: u8 = x60; - let x62: u8 = x61; - let x63: u8 = x62; - let x64: u8 = x63; - let x65: u8 = x64; - let x66: u8 = x65; - let x67: u8 = x66; - let x68: u8 = x67; - let x69: u8 = x68; - let x70: u8 = x69; - let x71: u8 = x70; - let x72: u8 = x71; - let x73: u8 = x72; - let x74: u8 = x73; - let x75: u8 = x74; - let x76: u8 = x75; - let x77: u8 = x76; - let x78: u8 = x77; - let x79: u8 = x78; - let x80: u8 = x79; - let x81: u8 = x80; - let x82: u8 = x81; - let x83: u8 = x82; - let x84: u8 = x83; - let x85: u8 = x84; - let x86: u8 = x85; - let x87: u8 = x86; - let x88: u8 = x87; - let x89: u8 = x88; - let x90: u8 = x89; - let x91: u8 = x90; - let x92: u8 = x91; - let x93: u8 = x92; - let x94: u8 = x93; - let x95: u8 = x94; - let x96: u8 = x95; - let x97: u8 = x96; - let x98: u8 = x97; - let x99: u8 = x98; - let x100: u8 = x99; - let x101: u8 = x100; - let x102: u8 = x101; - let x103: u8 = x102; - let x104: u8 = x103; - let x105: u8 = x104; - let x106: u8 = x105; - let x107: u8 = x106; - let x108: u8 = x107; - let x109: u8 = x108; - let x110: u8 = x109; - let x111: u8 = x110; - let x112: u8 = x111; - let x113: u8 = x112; - let x114: u8 = x113; - let x115: u8 = x114; - let x116: u8 = x115; - let x117: u8 = x116; - let x118: u8 = x117; - let x119: u8 = x118; - let x120: u8 = x119; - let x121: u8 = x120; - let x122: u8 = x121; - let x123: u8 = x122; - let x124: u8 = x123; - let x125: u8 = x124; - let x126: u8 = x125; - let x127: u8 = x126; - let x128: u8 = x127; - let x129: u8 = x128; - let x130: u8 = x129; - let x131: u8 = x130; - let x132: u8 = x131; - let x133: u8 = x132; - let x134: u8 = x133; - let x135: u8 = x134; - let x136: u8 = x135; - let x137: u8 = x136; - let x138: u8 = x137; - let x139: u8 = x138; - let x140: u8 = x139; - let x141: u8 = x140; - let x142: u8 = x141; - let x143: u8 = x142; - let x144: u8 = x143; - let x145: u8 = x144; - let x146: u8 = x145; - let x147: u8 = x146; - let x148: u8 = x147; - let x149: u8 = x148; - let x150: u8 = x149; - let x151: u8 = x150; - let x152: u8 = x151; - let x153: u8 = x152; - let x154: u8 = x153; - let x155: u8 = x154; - let x156: u8 = x155; - let x157: u8 = x156; - let x158: u8 = x157; - let x159: u8 = x158; - let x160: u8 = x159; - let x161: u8 = x160; - let x162: u8 = x161; - let x163: u8 = x162; - let x164: u8 = x163; - let x165: u8 = x164; - let x166: u8 = x165; - let x167: u8 = x166; - let x168: u8 = x167; - let x169: u8 = x168; - let x170: u8 = x169; - let x171: u8 = x170; - let x172: u8 = x171; - let x173: u8 = x172; - let x174: u8 = x173; - let x175: u8 = x174; - let x176: u8 = x175; - let x177: u8 = x176; - let x178: u8 = x177; - let x179: u8 = x178; - let x180: u8 = x179; - let x181: u8 = x180; - let x182: u8 = x181; - let x183: u8 = x182; - let x184: u8 = x183; - let x185: u8 = x184; - let x186: u8 = x185; - let x187: u8 = x186; - let x188: u8 = x187; - let x189: u8 = x188; - let x190: u8 = x189; - let x191: u8 = x190; - let x192: u8 = x191; - let x193: u8 = x192; - let x194: u8 = x193; - let x195: u8 = x194; - let x196: u8 = x195; - let x197: u8 = x196; - let x198: u8 = x197; - let x199: u8 = x198; - let x200: u8 = x199; - let x201: u8 = x200; - let x202: u8 = x201; - let x203: u8 = x202; - let x204: u8 = x203; - let x205: u8 = x204; - let x206: u8 = x205; - let x207: u8 = x206; - let x208: u8 = x207; - let x209: u8 = x208; - let x210: u8 = x209; - let x211: u8 = x210; - let x212: u8 = x211; - let x213: u8 = x212; - let x214: u8 = x213; - let x215: u8 = x214; - let x216: u8 = x215; - let x217: u8 = x216; - let x218: u8 = x217; - let x219: u8 = x218; - let x220: u8 = x219; - let x221: u8 = x220; - let x222: u8 = x221; - let x223: u8 = x222; - let x224: u8 = x223; - let x225: u8 = x224; - let x226: u8 = x225; - let x227: u8 = x226; - let x228: u8 = x227; - let x229: u8 = x228; - let x230: u8 = x229; - let x231: u8 = x230; - let x232: u8 = x231; - let x233: u8 = x232; - let x234: u8 = x233; - let x235: u8 = x234; - let x236: u8 = x235; - let x237: u8 = x236; - let x238: u8 = x237; - let x239: u8 = x238; - let x240: u8 = x239; - let x241: u8 = x240; - let x242: u8 = x241; - let x243: u8 = x242; - let x244: u8 = x243; - let x245: u8 = x244; - let x246: u8 = x245; - let x247: u8 = x246; - let x248: u8 = x247; - let x249: u8 = x248; - let x250: u8 = x249; - let x251: u8 = x250; - let x252: u8 = x251; - let x253: u8 = x252; - let x254: u8 = x253; - let x255: u8 = x254; - let x256: u8 = x255; - let x257: u8 = x256; - let x258: u8 = x257; - let x259: u8 = x258; - let x260: u8 = x259; - let x261: u8 = x260; - let x262: u8 = x261; - let x263: u8 = x262; - let x264: u8 = x263; - let x265: u8 = x264; - let x266: u8 = x265; - let x267: u8 = x266; - let x268: u8 = x267; - let x269: u8 = x268; - let x270: u8 = x269; - let x271: u8 = x270; - let x272: u8 = x271; - let x273: u8 = x272; - let x274: u8 = x273; - let x275: u8 = x274; - let x276: u8 = x275; - let x277: u8 = x276; - let x278: u8 = x277; - let x279: u8 = x278; - let x280: u8 = x279; - let x281: u8 = x280; - let x282: u8 = x281; - let x283: u8 = x282; - let x284: u8 = x283; - let x285: u8 = x284; - let x286: u8 = x285; - let x287: u8 = x286; - let x288: u8 = x287; - let x289: u8 = x288; - let x290: u8 = x289; - let x291: u8 = x290; - let x292: u8 = x291; - let x293: u8 = x292; - let x294: u8 = x293; - let x295: u8 = x294; - let x296: u8 = x295; - let x297: u8 = x296; - let x298: u8 = x297; - let x299: u8 = x298; - let x300: u8 = x299; - let x301: u8 = x300; - let x302: u8 = x301; - let x303: u8 = x302; - let x304: u8 = x303; - let x305: u8 = x304; - let x306: u8 = x305; - let x307: u8 = x306; - let x308: u8 = x307; - let x309: u8 = x308; - let x310: u8 = x309; - let x311: u8 = x310; - let x312: u8 = x311; - let x313: u8 = x312; - let x314: u8 = x313; - let x315: u8 = x314; - let x316: u8 = x315; - let x317: u8 = x316; - let x318: u8 = x317; - let x319: u8 = x318; - let x320: u8 = x319; - let x321: u8 = x320; - let x322: u8 = x321; - let x323: u8 = x322; - let x324: u8 = x323; - let x325: u8 = x324; - let x326: u8 = x325; - let x327: u8 = x326; - let x328: u8 = x327; - let x329: u8 = x328; - let x330: u8 = x329; - let x331: u8 = x330; - let x332: u8 = x331; - let x333: u8 = x332; - let x334: u8 = x333; - let x335: u8 = x334; - let x336: u8 = x335; - let x337: u8 = x336; - let x338: u8 = x337; - let x339: u8 = x338; - let x340: u8 = x339; - let x341: u8 = x340; - let x342: u8 = x341; - let x343: u8 = x342; - let x344: u8 = x343; - let x345: u8 = x344; - let x346: u8 = x345; - let x347: u8 = x346; - let x348: u8 = x347; - let x349: u8 = x348; - let x350: u8 = x349; - let x351: u8 = x350; - let x352: u8 = x351; - let x353: u8 = x352; - let x354: u8 = x353; - let x355: u8 = x354; - let x356: u8 = x355; - let x357: u8 = x356; - let x358: u8 = x357; - let x359: u8 = x358; - let x360: u8 = x359; - let x361: u8 = x360; - let x362: u8 = x361; - let x363: u8 = x362; - let x364: u8 = x363; - let x365: u8 = x364; - let x366: u8 = x365; - let x367: u8 = x366; - let x368: u8 = x367; - let x369: u8 = x368; - let x370: u8 = x369; - let x371: u8 = x370; - let x372: u8 = x371; - let x373: u8 = x372; - let x374: u8 = x373; - let x375: u8 = x374; - let x376: u8 = x375; - let x377: u8 = x376; - let x378: u8 = x377; - let x379: u8 = x378; - let x380: u8 = x379; - let x381: u8 = x380; - let x382: u8 = x381; - let x383: u8 = x382; + const x0: u8 = 0; + const x1: u8 = x0; + const x2: u8 = x1; + const x3: u8 = x2; + const x4: u8 = x3; + const x5: u8 = x4; + const x6: u8 = x5; + const x7: u8 = x6; + const x8: u8 = x7; + const x9: u8 = x8; + const x10: u8 = x9; + const x11: u8 = x10; + const x12: u8 = x11; + const x13: u8 = x12; + const x14: u8 = x13; + const x15: u8 = x14; + const x16: u8 = x15; + const x17: u8 = x16; + const x18: u8 = x17; + const x19: u8 = x18; + const x20: u8 = x19; + const x21: u8 = x20; + const x22: u8 = x21; + const x23: u8 = x22; + const x24: u8 = x23; + const x25: u8 = x24; + const x26: u8 = x25; + const x27: u8 = x26; + const x28: u8 = x27; + const x29: u8 = x28; + const x30: u8 = x29; + const x31: u8 = x30; + const x32: u8 = x31; + const x33: u8 = x32; + const x34: u8 = x33; + const x35: u8 = x34; + const x36: u8 = x35; + const x37: u8 = x36; + const x38: u8 = x37; + const x39: u8 = x38; + const x40: u8 = x39; + const x41: u8 = x40; + const x42: u8 = x41; + const x43: u8 = x42; + const x44: u8 = x43; + const x45: u8 = x44; + const x46: u8 = x45; + const x47: u8 = x46; + const x48: u8 = x47; + const x49: u8 = x48; + const x50: u8 = x49; + const x51: u8 = x50; + const x52: u8 = x51; + const x53: u8 = x52; + const x54: u8 = x53; + const x55: u8 = x54; + const x56: u8 = x55; + const x57: u8 = x56; + const x58: u8 = x57; + const x59: u8 = x58; + const x60: u8 = x59; + const x61: u8 = x60; + const x62: u8 = x61; + const x63: u8 = x62; + const x64: u8 = x63; + const x65: u8 = x64; + const x66: u8 = x65; + const x67: u8 = x66; + const x68: u8 = x67; + const x69: u8 = x68; + const x70: u8 = x69; + const x71: u8 = x70; + const x72: u8 = x71; + const x73: u8 = x72; + const x74: u8 = x73; + const x75: u8 = x74; + const x76: u8 = x75; + const x77: u8 = x76; + const x78: u8 = x77; + const x79: u8 = x78; + const x80: u8 = x79; + const x81: u8 = x80; + const x82: u8 = x81; + const x83: u8 = x82; + const x84: u8 = x83; + const x85: u8 = x84; + const x86: u8 = x85; + const x87: u8 = x86; + const x88: u8 = x87; + const x89: u8 = x88; + const x90: u8 = x89; + const x91: u8 = x90; + const x92: u8 = x91; + const x93: u8 = x92; + const x94: u8 = x93; + const x95: u8 = x94; + const x96: u8 = x95; + const x97: u8 = x96; + const x98: u8 = x97; + const x99: u8 = x98; + const x100: u8 = x99; + const x101: u8 = x100; + const x102: u8 = x101; + const x103: u8 = x102; + const x104: u8 = x103; + const x105: u8 = x104; + const x106: u8 = x105; + const x107: u8 = x106; + const x108: u8 = x107; + const x109: u8 = x108; + const x110: u8 = x109; + const x111: u8 = x110; + const x112: u8 = x111; + const x113: u8 = x112; + const x114: u8 = x113; + const x115: u8 = x114; + const x116: u8 = x115; + const x117: u8 = x116; + const x118: u8 = x117; + const x119: u8 = x118; + const x120: u8 = x119; + const x121: u8 = x120; + const x122: u8 = x121; + const x123: u8 = x122; + const x124: u8 = x123; + const x125: u8 = x124; + const x126: u8 = x125; + const x127: u8 = x126; + const x128: u8 = x127; + const x129: u8 = x128; + const x130: u8 = x129; + const x131: u8 = x130; + const x132: u8 = x131; + const x133: u8 = x132; + const x134: u8 = x133; + const x135: u8 = x134; + const x136: u8 = x135; + const x137: u8 = x136; + const x138: u8 = x137; + const x139: u8 = x138; + const x140: u8 = x139; + const x141: u8 = x140; + const x142: u8 = x141; + const x143: u8 = x142; + const x144: u8 = x143; + const x145: u8 = x144; + const x146: u8 = x145; + const x147: u8 = x146; + const x148: u8 = x147; + const x149: u8 = x148; + const x150: u8 = x149; + const x151: u8 = x150; + const x152: u8 = x151; + const x153: u8 = x152; + const x154: u8 = x153; + const x155: u8 = x154; + const x156: u8 = x155; + const x157: u8 = x156; + const x158: u8 = x157; + const x159: u8 = x158; + const x160: u8 = x159; + const x161: u8 = x160; + const x162: u8 = x161; + const x163: u8 = x162; + const x164: u8 = x163; + const x165: u8 = x164; + const x166: u8 = x165; + const x167: u8 = x166; + const x168: u8 = x167; + const x169: u8 = x168; + const x170: u8 = x169; + const x171: u8 = x170; + const x172: u8 = x171; + const x173: u8 = x172; + const x174: u8 = x173; + const x175: u8 = x174; + const x176: u8 = x175; + const x177: u8 = x176; + const x178: u8 = x177; + const x179: u8 = x178; + const x180: u8 = x179; + const x181: u8 = x180; + const x182: u8 = x181; + const x183: u8 = x182; + const x184: u8 = x183; + const x185: u8 = x184; + const x186: u8 = x185; + const x187: u8 = x186; + const x188: u8 = x187; + const x189: u8 = x188; + const x190: u8 = x189; + const x191: u8 = x190; + const x192: u8 = x191; + const x193: u8 = x192; + const x194: u8 = x193; + const x195: u8 = x194; + const x196: u8 = x195; + const x197: u8 = x196; + const x198: u8 = x197; + const x199: u8 = x198; + const x200: u8 = x199; + const x201: u8 = x200; + const x202: u8 = x201; + const x203: u8 = x202; + const x204: u8 = x203; + const x205: u8 = x204; + const x206: u8 = x205; + const x207: u8 = x206; + const x208: u8 = x207; + const x209: u8 = x208; + const x210: u8 = x209; + const x211: u8 = x210; + const x212: u8 = x211; + const x213: u8 = x212; + const x214: u8 = x213; + const x215: u8 = x214; + const x216: u8 = x215; + const x217: u8 = x216; + const x218: u8 = x217; + const x219: u8 = x218; + const x220: u8 = x219; + const x221: u8 = x220; + const x222: u8 = x221; + const x223: u8 = x222; + const x224: u8 = x223; + const x225: u8 = x224; + const x226: u8 = x225; + const x227: u8 = x226; + const x228: u8 = x227; + const x229: u8 = x228; + const x230: u8 = x229; + const x231: u8 = x230; + const x232: u8 = x231; + const x233: u8 = x232; + const x234: u8 = x233; + const x235: u8 = x234; + const x236: u8 = x235; + const x237: u8 = x236; + const x238: u8 = x237; + const x239: u8 = x238; + const x240: u8 = x239; + const x241: u8 = x240; + const x242: u8 = x241; + const x243: u8 = x242; + const x244: u8 = x243; + const x245: u8 = x244; + const x246: u8 = x245; + const x247: u8 = x246; + const x248: u8 = x247; + const x249: u8 = x248; + const x250: u8 = x249; + const x251: u8 = x250; + const x252: u8 = x251; + const x253: u8 = x252; + const x254: u8 = x253; + const x255: u8 = x254; + const x256: u8 = x255; + const x257: u8 = x256; + const x258: u8 = x257; + const x259: u8 = x258; + const x260: u8 = x259; + const x261: u8 = x260; + const x262: u8 = x261; + const x263: u8 = x262; + const x264: u8 = x263; + const x265: u8 = x264; + const x266: u8 = x265; + const x267: u8 = x266; + const x268: u8 = x267; + const x269: u8 = x268; + const x270: u8 = x269; + const x271: u8 = x270; + const x272: u8 = x271; + const x273: u8 = x272; + const x274: u8 = x273; + const x275: u8 = x274; + const x276: u8 = x275; + const x277: u8 = x276; + const x278: u8 = x277; + const x279: u8 = x278; + const x280: u8 = x279; + const x281: u8 = x280; + const x282: u8 = x281; + const x283: u8 = x282; + const x284: u8 = x283; + const x285: u8 = x284; + const x286: u8 = x285; + const x287: u8 = x286; + const x288: u8 = x287; + const x289: u8 = x288; + const x290: u8 = x289; + const x291: u8 = x290; + const x292: u8 = x291; + const x293: u8 = x292; + const x294: u8 = x293; + const x295: u8 = x294; + const x296: u8 = x295; + const x297: u8 = x296; + const x298: u8 = x297; + const x299: u8 = x298; + const x300: u8 = x299; + const x301: u8 = x300; + const x302: u8 = x301; + const x303: u8 = x302; + const x304: u8 = x303; + const x305: u8 = x304; + const x306: u8 = x305; + const x307: u8 = x306; + const x308: u8 = x307; + const x309: u8 = x308; + const x310: u8 = x309; + const x311: u8 = x310; + const x312: u8 = x311; + const x313: u8 = x312; + const x314: u8 = x313; + const x315: u8 = x314; + const x316: u8 = x315; + const x317: u8 = x316; + const x318: u8 = x317; + const x319: u8 = x318; + const x320: u8 = x319; + const x321: u8 = x320; + const x322: u8 = x321; + const x323: u8 = x322; + const x324: u8 = x323; + const x325: u8 = x324; + const x326: u8 = x325; + const x327: u8 = x326; + const x328: u8 = x327; + const x329: u8 = x328; + const x330: u8 = x329; + const x331: u8 = x330; + const x332: u8 = x331; + const x333: u8 = x332; + const x334: u8 = x333; + const x335: u8 = x334; + const x336: u8 = x335; + const x337: u8 = x336; + const x338: u8 = x337; + const x339: u8 = x338; + const x340: u8 = x339; + const x341: u8 = x340; + const x342: u8 = x341; + const x343: u8 = x342; + const x344: u8 = x343; + const x345: u8 = x344; + const x346: u8 = x345; + const x347: u8 = x346; + const x348: u8 = x347; + const x349: u8 = x348; + const x350: u8 = x349; + const x351: u8 = x350; + const x352: u8 = x351; + const x353: u8 = x352; + const x354: u8 = x353; + const x355: u8 = x354; + const x356: u8 = x355; + const x357: u8 = x356; + const x358: u8 = x357; + const x359: u8 = x358; + const x360: u8 = x359; + const x361: u8 = x360; + const x362: u8 = x361; + const x363: u8 = x362; + const x364: u8 = x363; + const x365: u8 = x364; + const x366: u8 = x365; + const x367: u8 = x366; + const x368: u8 = x367; + const x369: u8 = x368; + const x370: u8 = x369; + const x371: u8 = x370; + const x372: u8 = x371; + const x373: u8 = x372; + const x374: u8 = x373; + const x375: u8 = x374; + const x376: u8 = x375; + const x377: u8 = x376; + const x378: u8 = x377; + const x379: u8 = x378; + const x380: u8 = x379; + const x381: u8 = x380; + const x382: u8 = x381; + const x383: u8 = x382; return x383 } diff --git a/parser/src/errors/deprecated.rs b/parser/src/errors/deprecated.rs index 496c3db306..b16a4f5247 100644 --- a/parser/src/errors/deprecated.rs +++ b/parser/src/errors/deprecated.rs @@ -43,8 +43,8 @@ impl LeoError for DeprecatedError { } impl DeprecatedError { - pub fn const_statement(span: &Span) -> Self { - let message = "const _ = ... is deprecated. Did you mean let?".to_string(); + pub fn let_mut_statement(span: &Span) -> Self { + let message = "let mut = ... is deprecated. `let` keyword implies mutabality by default.".to_string(); Self::new_from_span(message, span) } diff --git a/parser/src/parser/statement.rs b/parser/src/parser/statement.rs index c01190fa0b..b57215f398 100644 --- a/parser/src/parser/statement.rs +++ b/parser/src/parser/statement.rs @@ -286,15 +286,17 @@ impl ParserContext { /// Returns a [`VariableName`] AST node if the next tokens represent a variable name with /// valid keywords. /// - pub fn parse_variable_name(&mut self) -> SyntaxResult { - let mutable = self.eat(Token::Mut); + pub fn parse_variable_name(&mut self, span: &SpannedToken) -> SyntaxResult { + if self.eat(Token::Mut).is_some() { + return Err(SyntaxError::DeprecatedError(DeprecatedError::let_mut_statement( + &span.span, + ))); + } + let name = self.expect_ident()?; Ok(VariableName { - span: mutable - .as_ref() - .map(|x| &x.span + &name.span) - .unwrap_or_else(|| name.span.clone()), - mutable: mutable.is_some(), + span: name.span.clone(), + mutable: matches!(span.token, Token::Let), identifier: name, }) } @@ -306,13 +308,13 @@ impl ParserContext { let declare = self.expect_oneof(&[Token::Let, Token::Const])?; let mut variable_names = vec![]; if self.eat(Token::LeftParen).is_some() { - variable_names.push(self.parse_variable_name()?); + variable_names.push(self.parse_variable_name(&declare)?); while self.eat(Token::Comma).is_some() { - variable_names.push(self.parse_variable_name()?); + variable_names.push(self.parse_variable_name(&declare)?); } self.expect(Token::RightParen)?; } else { - variable_names.push(self.parse_variable_name()?); + variable_names.push(self.parse_variable_name(&declare)?); } let type_ = if self.eat(Token::Colon).is_some() { @@ -329,12 +331,7 @@ impl ParserContext { span: &declare.span + expr.span(), declaration_type: match declare.token { Token::Let => Declare::Let, - Token::Const => { - return Err(SyntaxError::DeprecatedError(DeprecatedError::const_statement( - &declare.span, - ))); - //Declare::Const - } + Token::Const => Declare::Const, _ => unimplemented!(), }, variable_names, diff --git a/tests/fail/parse/address/empty.leo b/tests/fail/parse/address/empty.leo index e5c06d0def..305a77de5b 100644 --- a/tests/fail/parse/address/empty.leo +++ b/tests/fail/parse/address/empty.leo @@ -1,3 +1,3 @@ function main() { - let owner = address(); + const owner = address(); } \ No newline at end of file diff --git a/tests/fail/parse/address/invalid_length.leo b/tests/fail/parse/address/invalid_length.leo index c1b7f719be..ae1defecaf 100644 --- a/tests/fail/parse/address/invalid_length.leo +++ b/tests/fail/parse/address/invalid_length.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j88); + const public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j88); } \ No newline at end of file diff --git a/tests/fail/parse/address/invalid_prefix.leo b/tests/fail/parse/address/invalid_prefix.leo index 81959d2fa6..cd87e404a4 100644 --- a/tests/fail/parse/address/invalid_prefix.leo +++ b/tests/fail/parse/address/invalid_prefix.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const public_key_string = address(zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); } \ No newline at end of file diff --git a/tests/fail/parse/array/type_fail.leo b/tests/fail/parse/array/type_fail.leo index 1402ceba4c..356bba976a 100644 --- a/tests/fail/parse/array/type_fail.leo +++ b/tests/fail/parse/array/type_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: [u8; -2] = [0u32; 2]; + const a: [u8; -2] = [0u32; 2]; } \ No newline at end of file diff --git a/tests/fail/parse/circuits/self_circuit.leo b/tests/fail/parse/circuits/self_circuit.leo index 5a1d6c63be..18329433f7 100644 --- a/tests/fail/parse/circuits/self_circuit.leo +++ b/tests/fail/parse/circuits/self_circuit.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let a = Foo::new(); + const a = Foo::new(); } \ No newline at end of file diff --git a/tests/fail/parse/syntax/address_fail.leo b/tests/fail/parse/syntax/address_fail.leo index 4eb12c7743..b39ea75df6 100644 --- a/tests/fail/parse/syntax/address_fail.leo +++ b/tests/fail/parse/syntax/address_fail.leo @@ -1,3 +1,3 @@ function main() { - let address = 0u32; + const address = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/console_fail.leo b/tests/fail/parse/syntax/console_fail.leo index 6ee932a66b..c0229dd624 100644 --- a/tests/fail/parse/syntax/console_fail.leo +++ b/tests/fail/parse/syntax/console_fail.leo @@ -1,3 +1,3 @@ function main() { - let console = 0u32; + const console = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/field_fail.leo b/tests/fail/parse/syntax/field_fail.leo index a1f85dc6ea..33bb3118d8 100644 --- a/tests/fail/parse/syntax/field_fail.leo +++ b/tests/fail/parse/syntax/field_fail.leo @@ -1,3 +1,3 @@ function main() { - let field = 0u32; + const field = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/group_fail.leo b/tests/fail/parse/syntax/group_fail.leo index 322997ea50..db71c8a792 100644 --- a/tests/fail/parse/syntax/group_fail.leo +++ b/tests/fail/parse/syntax/group_fail.leo @@ -1,3 +1,3 @@ function main() { - let group = 0u32; + const group = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/i8_fail.leo b/tests/fail/parse/syntax/i8_fail.leo index 596a9056ab..a2d868f9f5 100644 --- a/tests/fail/parse/syntax/i8_fail.leo +++ b/tests/fail/parse/syntax/i8_fail.leo @@ -1,3 +1,3 @@ function main() { - let i8 = 0u32; + const i8 = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/input_fail.leo b/tests/fail/parse/syntax/input_fail.leo index e1b466d6d4..0053565a6f 100644 --- a/tests/fail/parse/syntax/input_fail.leo +++ b/tests/fail/parse/syntax/input_fail.leo @@ -1,3 +1,3 @@ function main() { - let input = 0u32; + const input = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/self_keyword_fail.leo b/tests/fail/parse/syntax/self_keyword_fail.leo index 28b899ccd4..79bc4d6e96 100644 --- a/tests/fail/parse/syntax/self_keyword_fail.leo +++ b/tests/fail/parse/syntax/self_keyword_fail.leo @@ -1,3 +1,3 @@ function main() { - let Self = 0u32; + const Self = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/self_type_fail.leo b/tests/fail/parse/syntax/self_type_fail.leo index 28b899ccd4..79bc4d6e96 100644 --- a/tests/fail/parse/syntax/self_type_fail.leo +++ b/tests/fail/parse/syntax/self_type_fail.leo @@ -1,3 +1,3 @@ function main() { - let Self = 0u32; + const Self = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/semicolon.leo b/tests/fail/parse/syntax/semicolon.leo index 68cfa7cbe0..f1deb29e37 100644 --- a/tests/fail/parse/syntax/semicolon.leo +++ b/tests/fail/parse/syntax/semicolon.leo @@ -1,3 +1,3 @@ function main() { - let a = 0 + const a = 0 } \ No newline at end of file diff --git a/tests/fail/parse/syntax/true_fail.leo b/tests/fail/parse/syntax/true_fail.leo index 4eb12c7743..b39ea75df6 100644 --- a/tests/fail/parse/syntax/true_fail.leo +++ b/tests/fail/parse/syntax/true_fail.leo @@ -1,3 +1,3 @@ function main() { - let address = 0u32; + const address = 0u32; } \ No newline at end of file diff --git a/tests/fail/parse/syntax/u8_fail.leo b/tests/fail/parse/syntax/u8_fail.leo index 77687f5ff2..4a48780a29 100644 --- a/tests/fail/parse/syntax/u8_fail.leo +++ b/tests/fail/parse/syntax/u8_fail.leo @@ -1,3 +1,3 @@ function main() { - let u8 = 0u32; + const u8 = 0u32; } \ No newline at end of file diff --git a/tests/pass/parse/address/console_assert_fail.leo b/tests/pass/parse/address/console_assert_fail.leo index 3e7a5f106d..17849256ca 100644 --- a/tests/pass/parse/address/console_assert_fail.leo +++ b/tests/pass/parse/address/console_assert_fail.leo @@ -1,6 +1,6 @@ function main() { - let address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9); + const address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9); console.assert(address_1 == address_2); } \ No newline at end of file diff --git a/tests/pass/parse/address/console_assert_pass.leo b/tests/pass/parse/address/console_assert_pass.leo index 60ea4a79cd..f17d7d8c05 100644 --- a/tests/pass/parse/address/console_assert_pass.leo +++ b/tests/pass/parse/address/console_assert_pass.leo @@ -1,6 +1,6 @@ function main() { - let address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_1 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const address_2 = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(address_1 == address_2); } \ No newline at end of file diff --git a/tests/pass/parse/address/implicit_invalid.leo b/tests/pass/parse/address/implicit_invalid.leo index 6f8eba5114..aadc38a6d8 100644 --- a/tests/pass/parse/address/implicit_invalid.leo +++ b/tests/pass/parse/address/implicit_invalid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/tests/pass/parse/address/implicit_valid.leo b/tests/pass/parse/address/implicit_valid.leo index df6ebf497d..75bcbaa8a1 100644 --- a/tests/pass/parse/address/implicit_valid.leo +++ b/tests/pass/parse/address/implicit_valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + const public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; } \ No newline at end of file diff --git a/tests/pass/parse/address/input.leo b/tests/pass/parse/address/input.leo index 795deac98b..29519f0334 100644 --- a/tests/pass/parse/address/input.leo +++ b/tests/pass/parse/address/input.leo @@ -1,5 +1,5 @@ function main(owner: address) { - let sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const sender = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); console.assert(owner == sender); } \ No newline at end of file diff --git a/tests/pass/parse/address/ternary.leo b/tests/pass/parse/address/ternary.leo index bdd88b9d92..dc87153d2d 100644 --- a/tests/pass/parse/address/ternary.leo +++ b/tests/pass/parse/address/ternary.leo @@ -1,8 +1,8 @@ function main(s: bool, c: address) { - let a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); - let b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); + const a = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const b = address(aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r); - let r = s? a: b; + const r = s? a: b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/address/valid.leo b/tests/pass/parse/address/valid.leo index f06aefdaa6..18f1682526 100644 --- a/tests/pass/parse/address/valid.leo +++ b/tests/pass/parse/address/valid.leo @@ -1,3 +1,3 @@ function main() { - let public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const public_key_string = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); } \ No newline at end of file diff --git a/tests/pass/parse/array/multi_fail_initializer.leo b/tests/pass/parse/array/multi_fail_initializer.leo index 258750b327..be1ab315bd 100644 --- a/tests/pass/parse/array/multi_fail_initializer.leo +++ b/tests/pass/parse/array/multi_fail_initializer.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions + const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions } \ No newline at end of file diff --git a/tests/pass/parse/array/multi_fail_inline.leo b/tests/pass/parse/array/multi_fail_inline.leo index 50a06c09b2..49c9296798 100644 --- a/tests/pass/parse/array/multi_fail_inline.leo +++ b/tests/pass/parse/array/multi_fail_inline.leo @@ -1,4 +1,4 @@ function main() { - let arr: [u8; (2, 2)] = [[1u8, 1u8], + const arr: [u8; (2, 2)] = [[1u8, 1u8], [1u8]]; // incorrect dimensions } \ No newline at end of file diff --git a/tests/pass/parse/array/multi_initializer.leo b/tests/pass/parse/array/multi_initializer.leo index 7257999ddf..6133542ef0 100644 --- a/tests/pass/parse/array/multi_initializer.leo +++ b/tests/pass/parse/array/multi_initializer.leo @@ -1,7 +1,7 @@ function main() { - let a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; + const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; - let b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; + const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/multi_initializer_fail.leo b/tests/pass/parse/array/multi_initializer_fail.leo index 0bd76acffa..e38a8fdaee 100644 --- a/tests/pass/parse/array/multi_initializer_fail.leo +++ b/tests/pass/parse/array/multi_initializer_fail.leo @@ -1,3 +1,3 @@ function main() { - let arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions + const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions } \ No newline at end of file diff --git a/tests/pass/parse/array/nested.leo b/tests/pass/parse/array/nested.leo index c557758b05..80fc5511bf 100644 --- a/tests/pass/parse/array/nested.leo +++ b/tests/pass/parse/array/nested.leo @@ -1,4 +1,4 @@ function main () { - let x = [false; (2, 2)]; - let y: bool = x[0][0]; + const x = [false; (2, 2)]; + const y: bool = x[0][0]; } diff --git a/tests/pass/parse/array/nested_3x2_value.leo b/tests/pass/parse/array/nested_3x2_value.leo index b69ddffb89..c5f64c997e 100644 --- a/tests/pass/parse/array/nested_3x2_value.leo +++ b/tests/pass/parse/array/nested_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/nested_3x2_value_fail.leo b/tests/pass/parse/array/nested_3x2_value_fail.leo index 35c8478cd1..a187a51991 100644 --- a/tests/pass/parse/array/nested_3x2_value_fail.leo +++ b/tests/pass/parse/array/nested_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } diff --git a/tests/pass/parse/array/slice.leo b/tests/pass/parse/array/slice.leo index 296f5bd050..9ff83dbbb8 100644 --- a/tests/pass/parse/array/slice.leo +++ b/tests/pass/parse/array/slice.leo @@ -1,6 +1,6 @@ // `{from}..{to}` copies the elements of one array into another exclusively function main(a: [u8; 3]) { - let b = [1u8; 4]; + const b = [1u8; 4]; console.assert(a == b[0..3]); } diff --git a/tests/pass/parse/array/slice_lower.leo b/tests/pass/parse/array/slice_lower.leo index dd669830ea..0af6fbd937 100644 --- a/tests/pass/parse/array/slice_lower.leo +++ b/tests/pass/parse/array/slice_lower.leo @@ -1,8 +1,8 @@ function main() { - let arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - let expected: [u32; 2] = [0, 1]; + const arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + const expected: [u32; 2] = [0, 1]; - let actual = arr[..2]; // Should produce [0, 1] + const actual = arr[..2]; // Should produce [0, 1] console.assert(expected == actual); } \ No newline at end of file diff --git a/tests/pass/parse/array/spread.leo b/tests/pass/parse/array/spread.leo index 962e92c923..8bd2861aae 100644 --- a/tests/pass/parse/array/spread.leo +++ b/tests/pass/parse/array/spread.leo @@ -1,7 +1,7 @@ // A spread operator `...` copies the elements of one array into another function main(a: [u8; 3]) { - let b = [1u8, 1u8]; - let c = [1u8, ...b]; + const b = [1u8, 1u8]; + const c = [1u8, ...b]; console.assert(a == c); } \ No newline at end of file diff --git a/tests/pass/parse/array/tuple_3x2_value.leo b/tests/pass/parse/array/tuple_3x2_value.leo index dc9128c51e..b6659539d5 100644 --- a/tests/pass/parse/array/tuple_3x2_value.leo +++ b/tests/pass/parse/array/tuple_3x2_value.leo @@ -1,8 +1,8 @@ // Multidimensional array syntax in leo function main() { - let a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline + const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - let b: [u32; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/tuple_3x2_value_fail.leo b/tests/pass/parse/array/tuple_3x2_value_fail.leo index 42e6f61500..78593ab696 100644 --- a/tests/pass/parse/array/tuple_3x2_value_fail.leo +++ b/tests/pass/parse/array/tuple_3x2_value_fail.leo @@ -1,4 +1,4 @@ // Multidimensional array syntax in leo function main() { - let a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } diff --git a/tests/pass/parse/array/type_input_3x2.leo b/tests/pass/parse/array/type_input_3x2.leo index 40781415c1..ea60a0cc24 100644 --- a/tests/pass/parse/array/type_input_3x2.leo +++ b/tests/pass/parse/array/type_input_3x2.leo @@ -1,5 +1,5 @@ function main(a: [[u8; 2]; 3]) { - let b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_input_4x3x2.leo b/tests/pass/parse/array/type_input_4x3x2.leo index bd75514904..2d9c4cff22 100644 --- a/tests/pass/parse/array/type_input_4x3x2.leo +++ b/tests/pass/parse/array/type_input_4x3x2.leo @@ -1,5 +1,5 @@ function main(a: [[[u8; 2]; 3]; 4]) { - let b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline diff --git a/tests/pass/parse/array/type_nested_value_nested_3x2.leo b/tests/pass/parse/array/type_nested_value_nested_3x2.leo index 341b9ead9c..bcf5bae674 100644 --- a/tests/pass/parse/array/type_nested_value_nested_3x2.leo +++ b/tests/pass/parse/array/type_nested_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer + const b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_nested_3x2_fail.leo b/tests/pass/parse/array/type_nested_value_nested_3x2_fail.leo index 4bd07f85db..56c8916fb0 100644 --- a/tests/pass/parse/array/type_nested_value_nested_3x2_fail.leo +++ b/tests/pass/parse/array/type_nested_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_nested_4x3x2.leo b/tests/pass/parse/array/type_nested_value_nested_4x3x2.leo index 5ba24a381b..1691fa26c7 100644 --- a/tests/pass/parse/array/type_nested_value_nested_4x3x2.leo +++ b/tests/pass/parse/array/type_nested_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer + const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_nested_4x3x2_fail.leo b/tests/pass/parse/array/type_nested_value_nested_4x3x2_fail.leo index 6479004d68..480327a91d 100644 --- a/tests/pass/parse/array/type_nested_value_nested_4x3x2_fail.leo +++ b/tests/pass/parse/array/type_nested_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_tuple_3x2.leo b/tests/pass/parse/array/type_nested_value_tuple_3x2.leo index c6fac9ec64..5f14084d55 100644 --- a/tests/pass/parse/array/type_nested_value_tuple_3x2.leo +++ b/tests/pass/parse/array/type_nested_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer + const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_tuple_3x2_fail.leo b/tests/pass/parse/array/type_nested_value_tuple_3x2_fail.leo index ba99b070c7..3bfb559615 100644 --- a/tests/pass/parse/array/type_nested_value_tuple_3x2_fail.leo +++ b/tests/pass/parse/array/type_nested_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) + const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_tuple_4x3x2.leo b/tests/pass/parse/array/type_nested_value_tuple_4x3x2.leo index 9be45de408..88a5143bd2 100644 --- a/tests/pass/parse/array/type_nested_value_tuple_4x3x2.leo +++ b/tests/pass/parse/array/type_nested_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer + const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_nested_value_tuple_4x3x2_fail.leo b/tests/pass/parse/array/type_nested_value_tuple_4x3x2_fail.leo index 95172bf329..ce1219a37b 100644 --- a/tests/pass/parse/array/type_nested_value_tuple_4x3x2_fail.leo +++ b/tests/pass/parse/array/type_nested_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) + const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_nested_3x2.leo b/tests/pass/parse/array/type_tuple_value_nested_3x2.leo index 4e061c4309..81195e03a1 100644 --- a/tests/pass/parse/array/type_tuple_value_nested_3x2.leo +++ b/tests/pass/parse/array/type_tuple_value_nested_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer + const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_nested_3x2_fail.leo b/tests/pass/parse/array/type_tuple_value_nested_3x2_fail.leo index 9732cf26ef..e84f025a9f 100644 --- a/tests/pass/parse/array/type_tuple_value_nested_3x2_fail.leo +++ b/tests/pass/parse/array/type_tuple_value_nested_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_nested_4x3x2.leo b/tests/pass/parse/array/type_tuple_value_nested_4x3x2.leo index d9dc698784..322a6f7601 100644 --- a/tests/pass/parse/array/type_tuple_value_nested_4x3x2.leo +++ b/tests/pass/parse/array/type_tuple_value_nested_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer + const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_nested_4x3x2_fail.leo b/tests/pass/parse/array/type_tuple_value_nested_4x3x2_fail.leo index b820c4d088..cbb7ccbf76 100644 --- a/tests/pass/parse/array/type_tuple_value_nested_4x3x2_fail.leo +++ b/tests/pass/parse/array/type_tuple_value_nested_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) + const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_tuple_3x2.leo b/tests/pass/parse/array/type_tuple_value_tuple_3x2.leo index b0693f7667..d451a9c1a8 100644 --- a/tests/pass/parse/array/type_tuple_value_tuple_3x2.leo +++ b/tests/pass/parse/array/type_tuple_value_tuple_3x2.leo @@ -1,7 +1,7 @@ function main() { - let a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline + const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - let b: [u8; (3, 2)] = [0; (3, 2)]; // initializer + const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_tuple_3x2_fail.leo b/tests/pass/parse/array/type_tuple_value_tuple_3x2_fail.leo index 99487ccb7a..884a75db9d 100644 --- a/tests/pass/parse/array/type_tuple_value_tuple_3x2_fail.leo +++ b/tests/pass/parse/array/type_tuple_value_tuple_3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) + const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_tuple_4x3x2.leo b/tests/pass/parse/array/type_tuple_value_tuple_4x3x2.leo index cdc1bc961e..1205b1dc9c 100644 --- a/tests/pass/parse/array/type_tuple_value_tuple_4x3x2.leo +++ b/tests/pass/parse/array/type_tuple_value_tuple_4x3x2.leo @@ -1,10 +1,10 @@ function main() { - let a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], + const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - let b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer + const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer console.assert(a == b); } \ No newline at end of file diff --git a/tests/pass/parse/array/type_tuple_value_tuple_4x3x2_fail.leo b/tests/pass/parse/array/type_tuple_value_tuple_4x3x2_fail.leo index 824fd90bc6..31e2a5e552 100644 --- a/tests/pass/parse/array/type_tuple_value_tuple_4x3x2_fail.leo +++ b/tests/pass/parse/array/type_tuple_value_tuple_4x3x2_fail.leo @@ -1,3 +1,3 @@ function main() { - let b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) + const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) } \ No newline at end of file diff --git a/tests/pass/parse/array/variable_slice_fail.leo b/tests/pass/parse/array/variable_slice_fail.leo index edb04caacf..e79d64112f 100644 --- a/tests/pass/parse/array/variable_slice_fail.leo +++ b/tests/pass/parse/array/variable_slice_fail.leo @@ -1,7 +1,7 @@ function main() { - let a = [1u8; 10]; + const a = [1u8; 10]; for i in 0..10 { - let x = a[i..10]; + const x = a[i..10]; console.debug("{}", x); } } \ No newline at end of file diff --git a/tests/pass/parse/boolean/all.leo b/tests/pass/parse/boolean/all.leo index 29a3815881..64fe8a795a 100644 --- a/tests/pass/parse/boolean/all.leo +++ b/tests/pass/parse/boolean/all.leo @@ -1,8 +1,8 @@ // !(true && (false || true)) function main() { - let a = true; - let b = false || a; - let c = !(true && b); + const a = true; + const b = false || a; + const c = !(true && b); console.assert(c == false); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/conditional_mut.leo b/tests/pass/parse/boolean/conditional_mut.leo index e6716cb05a..cebf82ab00 100644 --- a/tests/pass/parse/boolean/conditional_mut.leo +++ b/tests/pass/parse/boolean/conditional_mut.leo @@ -1,6 +1,6 @@ function main () { - let mut x = true; + let x = true; if x { - let y = 0u8; + const y = 0u8; } } \ No newline at end of file diff --git a/tests/pass/parse/boolean/false_and_false.leo b/tests/pass/parse/boolean/false_and_false.leo index 70e4b0797b..03dfabab4d 100644 --- a/tests/pass/parse/boolean/false_and_false.leo +++ b/tests/pass/parse/boolean/false_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false && false; + const a = false && false; console.assert(a == false); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/false_or_false.leo b/tests/pass/parse/boolean/false_or_false.leo index 4ae820254e..7ea710802c 100644 --- a/tests/pass/parse/boolean/false_or_false.leo +++ b/tests/pass/parse/boolean/false_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = false || false; + const a = false || false; console.assert(a == false); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/not_mutable.leo b/tests/pass/parse/boolean/not_mutable.leo index 91a6e5ff37..c621647ff9 100644 --- a/tests/pass/parse/boolean/not_mutable.leo +++ b/tests/pass/parse/boolean/not_mutable.leo @@ -1,4 +1,4 @@ function main () { - let mut b = false; - let a = !b; + let b = false; + const a = !b; } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_and_false.leo b/tests/pass/parse/boolean/true_and_false.leo index 3c7c484603..336dde7558 100644 --- a/tests/pass/parse/boolean/true_and_false.leo +++ b/tests/pass/parse/boolean/true_and_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true && false; + const a = true && false; console.assert(a == false); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_and_true.leo b/tests/pass/parse/boolean/true_and_true.leo index c378e50024..dae445dcf8 100644 --- a/tests/pass/parse/boolean/true_and_true.leo +++ b/tests/pass/parse/boolean/true_and_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true && true; + const a = true && true; console.assert(a == true); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_and_u32.leo b/tests/pass/parse/boolean/true_and_u32.leo index e5b3a8c001..ad3ead9040 100644 --- a/tests/pass/parse/boolean/true_and_u32.leo +++ b/tests/pass/parse/boolean/true_and_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true && 1u32; + const a = true && 1u32; } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_or_false.leo b/tests/pass/parse/boolean/true_or_false.leo index d643a96aa1..216e473cdb 100644 --- a/tests/pass/parse/boolean/true_or_false.leo +++ b/tests/pass/parse/boolean/true_or_false.leo @@ -1,5 +1,5 @@ function main() { - let a = true || false; + const a = true || false; console.assert(a == true); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_or_true.leo b/tests/pass/parse/boolean/true_or_true.leo index b8eaa91ff1..fea8628b9f 100644 --- a/tests/pass/parse/boolean/true_or_true.leo +++ b/tests/pass/parse/boolean/true_or_true.leo @@ -1,5 +1,5 @@ function main() { - let a = true || true; + const a = true || true; console.assert(a == true); } \ No newline at end of file diff --git a/tests/pass/parse/boolean/true_or_u32.leo b/tests/pass/parse/boolean/true_or_u32.leo index 500b5f7bf4..38dab727b9 100644 --- a/tests/pass/parse/boolean/true_or_u32.leo +++ b/tests/pass/parse/boolean/true_or_u32.leo @@ -1,3 +1,3 @@ function main() { - let a = true || 1u32; + const a = true || 1u32; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/define_circuit_inside_circuit_function.leo b/tests/pass/parse/circuits/define_circuit_inside_circuit_function.leo index 8c25c1e9d9..cedabf2185 100644 --- a/tests/pass/parse/circuits/define_circuit_inside_circuit_function.leo +++ b/tests/pass/parse/circuits/define_circuit_inside_circuit_function.leo @@ -4,10 +4,10 @@ circuit Foo { circuit Bar { function bar() { - let f = Foo { a: 0u32 }; + const f = Foo { a: 0u32 }; } } function main() { - let b = Bar::bar(); + const b = Bar::bar(); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/duplicate_name_context.leo b/tests/pass/parse/circuits/duplicate_name_context.leo index 98ff42d8f0..66640e75a2 100644 --- a/tests/pass/parse/circuits/duplicate_name_context.leo +++ b/tests/pass/parse/circuits/duplicate_name_context.leo @@ -7,7 +7,7 @@ circuit Bar { } function main () { - let Bar = 66u32; - let k1 = Bar{ b2: 30u32 }; - let k2 = Bar::add_five(55u32); + const Bar = 66u32; + const k1 = Bar{ b2: 30u32 }; + const k2 = Bar::add_five(55u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/inline.leo b/tests/pass/parse/circuits/inline.leo index 8e214c729a..9ba06f4191 100644 --- a/tests/pass/parse/circuits/inline.leo +++ b/tests/pass/parse/circuits/inline.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/inline_fail.leo b/tests/pass/parse/circuits/inline_fail.leo index 52792a07e0..01597005fb 100644 --- a/tests/pass/parse/circuits/inline_fail.leo +++ b/tests/pass/parse/circuits/inline_fail.leo @@ -3,5 +3,5 @@ circuit Foo { } function main() { - let a = Foo { y: 0u32 }; + const a = Foo { y: 0u32 }; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/inline_member_fail.leo b/tests/pass/parse/circuits/inline_member_fail.leo index 7f0b8f7889..59f6d7992b 100644 --- a/tests/pass/parse/circuits/inline_member_fail.leo +++ b/tests/pass/parse/circuits/inline_member_fail.leo @@ -3,6 +3,6 @@ circuit Foo { } function main() { - let y: u8 = 1; - let a = Foo { y }; + const y: u8 = 1; + const a = Foo { y }; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/inline_member_pass.leo b/tests/pass/parse/circuits/inline_member_pass.leo index 5541a65638..8e58e4935a 100644 --- a/tests/pass/parse/circuits/inline_member_pass.leo +++ b/tests/pass/parse/circuits/inline_member_pass.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let x: u8 = 1; - let a = Foo { x }; - let b = Foo::new(x); + const x: u8 = 1; + const a = Foo { x }; + const b = Foo::new(x); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/inline_undefined.leo b/tests/pass/parse/circuits/inline_undefined.leo index af070e01e9..40c4cf722c 100644 --- a/tests/pass/parse/circuits/inline_undefined.leo +++ b/tests/pass/parse/circuits/inline_undefined.leo @@ -1,3 +1,3 @@ function main() { - let a = Foo { }; + const a = Foo { }; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_function.leo b/tests/pass/parse/circuits/member_function.leo index e40603dffb..258b6c675e 100644 --- a/tests/pass/parse/circuits/member_function.leo +++ b/tests/pass/parse/circuits/member_function.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; console.assert(a.echo() == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_function_fail.leo b/tests/pass/parse/circuits/member_function_fail.leo index 224b79cbf4..5a1c4100c5 100644 --- a/tests/pass/parse/circuits/member_function_fail.leo +++ b/tests/pass/parse/circuits/member_function_fail.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echoed(1u32); + const a = Foo { }; + const err = a.echoed(1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_function_invalid.leo b/tests/pass/parse/circuits/member_function_invalid.leo index bb834e9562..aa689eb976 100644 --- a/tests/pass/parse/circuits/member_function_invalid.leo +++ b/tests/pass/parse/circuits/member_function_invalid.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let a = Foo { }; - let err = a.echo(1u32); // echo is a static function and must be accessed using `::` + const a = Foo { }; + const err = a.echo(1u32); // echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_function_nested.leo b/tests/pass/parse/circuits/member_function_nested.leo index 9e07cc9acf..e512c9df52 100644 --- a/tests/pass/parse/circuits/member_function_nested.leo +++ b/tests/pass/parse/circuits/member_function_nested.leo @@ -11,8 +11,8 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; - let b = a.add_x(1u32); + const a = Foo { x: 1u32 }; + const b = a.add_x(1u32); console.assert(b == 2u32); } diff --git a/tests/pass/parse/circuits/member_static_function.leo b/tests/pass/parse/circuits/member_static_function.leo index 4bf51190f0..9d53314f27 100644 --- a/tests/pass/parse/circuits/member_static_function.leo +++ b/tests/pass/parse/circuits/member_static_function.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let a = Foo::echo(1u32); + const a = Foo::echo(1u32); console.assert(a == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_static_function_invalid.leo b/tests/pass/parse/circuits/member_static_function_invalid.leo index 09fec386d9..7829b4b430 100644 --- a/tests/pass/parse/circuits/member_static_function_invalid.leo +++ b/tests/pass/parse/circuits/member_static_function_invalid.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` + const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_static_function_undefined.leo b/tests/pass/parse/circuits/member_static_function_undefined.leo index cf9f98c7b4..ece1d00963 100644 --- a/tests/pass/parse/circuits/member_static_function_undefined.leo +++ b/tests/pass/parse/circuits/member_static_function_undefined.leo @@ -5,5 +5,5 @@ circuit Foo { } function main() { - let err = Foo::echoed(1u32); + const err = Foo::echoed(1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_variable.leo b/tests/pass/parse/circuits/member_variable.leo index 0dd35f2aec..a3f3fbe7e6 100644 --- a/tests/pass/parse/circuits/member_variable.leo +++ b/tests/pass/parse/circuits/member_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/member_variable_and_function.leo b/tests/pass/parse/circuits/member_variable_and_function.leo index 074feab7b8..3b90db7eaa 100644 --- a/tests/pass/parse/circuits/member_variable_and_function.leo +++ b/tests/pass/parse/circuits/member_variable_and_function.leo @@ -7,9 +7,9 @@ circuit Foo { } function main() { - let a = Foo { foo: 1 }; + const a = Foo { foo: 1 }; - let b = a.foo + Foo::bar(); + const b = a.foo + Foo::bar(); console.assert(b == 2u32); } diff --git a/tests/pass/parse/circuits/member_variable_fail.leo b/tests/pass/parse/circuits/member_variable_fail.leo index 5780704ea2..fdf42068d5 100644 --- a/tests/pass/parse/circuits/member_variable_fail.leo +++ b/tests/pass/parse/circuits/member_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let a = Foo { x: 1u32 }; + const a = Foo { x: 1u32 }; - let err = a.y; + const err = a.y; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_function_fail.leo b/tests/pass/parse/circuits/mut_function_fail.leo index 3469f97627..1b87e2bfb1 100644 --- a/tests/pass/parse/circuits/mut_function_fail.leo +++ b/tests/pass/parse/circuits/mut_function_fail.leo @@ -5,7 +5,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_self_function_fail.leo b/tests/pass/parse/circuits/mut_self_function_fail.leo index 8c9b99f6ae..58c8088ba1 100644 --- a/tests/pass/parse/circuits/mut_self_function_fail.leo +++ b/tests/pass/parse/circuits/mut_self_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_self_static_function_fail.leo b/tests/pass/parse/circuits/mut_self_static_function_fail.leo index 8c9b99f6ae..58c8088ba1 100644 --- a/tests/pass/parse/circuits/mut_self_static_function_fail.leo +++ b/tests/pass/parse/circuits/mut_self_static_function_fail.leo @@ -9,7 +9,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_self_variable.leo b/tests/pass/parse/circuits/mut_self_variable.leo index f5a35ec754..92bcca0050 100644 --- a/tests/pass/parse/circuits/mut_self_variable.leo +++ b/tests/pass/parse/circuits/mut_self_variable.leo @@ -8,7 +8,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/tests/pass/parse/circuits/mut_self_variable_branch.leo b/tests/pass/parse/circuits/mut_self_variable_branch.leo index e47f9b85df..0c5b8f40a4 100644 --- a/tests/pass/parse/circuits/mut_self_variable_branch.leo +++ b/tests/pass/parse/circuits/mut_self_variable_branch.leo @@ -10,7 +10,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/tests/pass/parse/circuits/mut_self_variable_conditional.leo b/tests/pass/parse/circuits/mut_self_variable_conditional.leo index 74345afcb4..61a5e354dc 100644 --- a/tests/pass/parse/circuits/mut_self_variable_conditional.leo +++ b/tests/pass/parse/circuits/mut_self_variable_conditional.leo @@ -1,5 +1,5 @@ function main() { - let mut f = Foo { a: 0u32 }; + let f = Foo { a: 0u32 }; f.bar(); } diff --git a/tests/pass/parse/circuits/mut_self_variable_fail.leo b/tests/pass/parse/circuits/mut_self_variable_fail.leo index fdbb556bca..4db62a4d3e 100644 --- a/tests/pass/parse/circuits/mut_self_variable_fail.leo +++ b/tests/pass/parse/circuits/mut_self_variable_fail.leo @@ -7,7 +7,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.set_a(1u8); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_static_function_fail.leo b/tests/pass/parse/circuits/mut_static_function_fail.leo index ed3092c656..fd873bd17b 100644 --- a/tests/pass/parse/circuits/mut_static_function_fail.leo +++ b/tests/pass/parse/circuits/mut_static_function_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; f.bar = 1u8; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/mut_variable.leo b/tests/pass/parse/circuits/mut_variable.leo index 243d7a2cf2..151babb1cd 100644 --- a/tests/pass/parse/circuits/mut_variable.leo +++ b/tests/pass/parse/circuits/mut_variable.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let mut f = Foo { a: 0u8 }; + let f = Foo { a: 0u8 }; console.assert(f.a == 0u8); diff --git a/tests/pass/parse/circuits/mut_variable_fail.leo b/tests/pass/parse/circuits/mut_variable_fail.leo index 4d58150c95..7ba4193074 100644 --- a/tests/pass/parse/circuits/mut_variable_fail.leo +++ b/tests/pass/parse/circuits/mut_variable_fail.leo @@ -3,7 +3,7 @@ circuit Foo { } function main() { - let f = Foo { a: 0u8 }; + const f = Foo { a: 0u8 }; f.a = 1u8; } \ No newline at end of file diff --git a/tests/pass/parse/circuits/pedersen_mock.leo b/tests/pass/parse/circuits/pedersen_mock.leo index 559ebb7614..4abef65caa 100644 --- a/tests/pass/parse/circuits/pedersen_mock.leo +++ b/tests/pass/parse/circuits/pedersen_mock.leo @@ -6,9 +6,9 @@ circuit PedersenHash { } function hash(self, bits: [bool; 512]) -> u32 { - let mut digest: u32 = 0; + let digest: u32 = 0; for i in 0..512 { - let base = bits[i] ? self.parameters[i] : 0u32; + const base = bits[i] ? self.parameters[i] : 0u32; digest += base; } return digest @@ -17,11 +17,11 @@ circuit PedersenHash { // The 'pedersen_hash' main function. function main() { - let parameters = [0u32; 512]; - let pedersen = PedersenHash::new(parameters); - let hash_input: [bool; 512] = [true; 512]; + const parameters = [0u32; 512]; + const pedersen = PedersenHash::new(parameters); + const hash_input: [bool; 512] = [true; 512]; - let res = pedersen.hash(hash_input); + const res = pedersen.hash(hash_input); console.assert(res == 0u32); } diff --git a/tests/pass/parse/circuits/self_member.leo b/tests/pass/parse/circuits/self_member.leo index 1bd978433d..2b3401a228 100644 --- a/tests/pass/parse/circuits/self_member.leo +++ b/tests/pass/parse/circuits/self_member.leo @@ -7,8 +7,8 @@ circuit Foo { } function main() { - let a = Foo { f: 1u32 }; - let b = a.bar(); + const a = Foo { f: 1u32 }; + const b = a.bar(); console.assert(b == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/self_member_invalid.leo b/tests/pass/parse/circuits/self_member_invalid.leo index 2e8b14f66c..163499d619 100644 --- a/tests/pass/parse/circuits/self_member_invalid.leo +++ b/tests/pass/parse/circuits/self_member_invalid.leo @@ -7,6 +7,6 @@ circuit Foo { } function main() -> u32 { - let foo = Foo { f: 1u32 }; - let err = foo.bar(); + const foo = Foo { f: 1u32 }; + const err = foo.bar(); } \ No newline at end of file diff --git a/tests/pass/parse/circuits/self_member_undefined.leo b/tests/pass/parse/circuits/self_member_undefined.leo index 471ffb973c..05a40905d7 100644 --- a/tests/pass/parse/circuits/self_member_undefined.leo +++ b/tests/pass/parse/circuits/self_member_undefined.leo @@ -5,6 +5,6 @@ circuit Foo { } function main() { - let foo = Foo { }; - let err = foo.bar(); + const foo = Foo { }; + const err = foo.bar(); } \ No newline at end of file diff --git a/tests/pass/parse/compiler/main.leo b/tests/pass/parse/compiler/main.leo index f5ddfb4e7f..ed25576751 100644 --- a/tests/pass/parse/compiler/main.leo +++ b/tests/pass/parse/compiler/main.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 1 + 2; + const a: u32 = 1 + 2; } \ No newline at end of file diff --git a/tests/pass/parse/core/arguments_length_fail.leo b/tests/pass/parse/core/arguments_length_fail.leo index ccdd4c5af9..614490432d 100644 --- a/tests/pass/parse/core/arguments_length_fail.leo +++ b/tests/pass/parse/core/arguments_length_fail.leo @@ -1,9 +1,9 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; + const seed: [u8; 32] = [0; 32]; - let result = Blake2s::hash(seed); // function `hash` takes 2 arguments + const result = Blake2s::hash(seed); // function `hash` takes 2 arguments console.log("Result: {}", result); } diff --git a/tests/pass/parse/core/arguments_type_fail.leo b/tests/pass/parse/core/arguments_type_fail.leo index 13c7e9735e..f80e7b0205 100644 --- a/tests/pass/parse/core/arguments_type_fail.leo +++ b/tests/pass/parse/core/arguments_type_fail.leo @@ -1,10 +1,10 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; - let message: [u16; 32] = [0; 32]; // message should be type [u8; 32] + const seed: [u8; 32] = [0; 32]; + const message: [u16; 32] = [0; 32]; // message should be type [u8; 32] - let result = Blake2s::hash(seed, message); + const result = Blake2s::hash(seed, message); console.log("Result: {}", result); } diff --git a/tests/pass/parse/core/blake2s_random.leo b/tests/pass/parse/core/blake2s_random.leo index 72aef44932..c9592fcbf8 100644 --- a/tests/pass/parse/core/blake2s_random.leo +++ b/tests/pass/parse/core/blake2s_random.leo @@ -1,7 +1,7 @@ import core.unstable.blake2s.Blake2s; function main(seed: [u8; 32], message: [u8; 32], expected: [u8; 32]) { - let actual = Blake2s::hash(seed, message); + const actual = Blake2s::hash(seed, message); console.assert(expected == actual); } diff --git a/tests/pass/parse/core/unstable_blake2s.leo b/tests/pass/parse/core/unstable_blake2s.leo index ca7db13892..c430d9a837 100644 --- a/tests/pass/parse/core/unstable_blake2s.leo +++ b/tests/pass/parse/core/unstable_blake2s.leo @@ -1,10 +1,10 @@ import core.unstable.blake2s.Blake2s; function main() { - let seed: [u8; 32] = [0; 32]; - let message: [u8; 32] = [0; 32]; + const seed: [u8; 32] = [0; 32]; + const message: [u8; 32] = [0; 32]; - let result = Blake2s::hash(seed, message); + const result = Blake2s::hash(seed, message); console.log("Result: {}", result); } diff --git a/tests/pass/parse/field/field.leo b/tests/pass/parse/field/field.leo index 3f109881ad..5d5732e906 100644 --- a/tests/pass/parse/field/field.leo +++ b/tests/pass/parse/field/field.leo @@ -1,4 +1,4 @@ function main() { - let negOneField: field = -1field; - let oneField = 1field; + const negOneField: field = -1field; + const oneField = 1field; } \ No newline at end of file diff --git a/tests/pass/parse/field/ternary.leo b/tests/pass/parse/field/ternary.leo index f193ad82a3..05cb161b46 100644 --- a/tests/pass/parse/field/ternary.leo +++ b/tests/pass/parse/field/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: field, b: field, c: field) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/function/array_input.leo b/tests/pass/parse/function/array_input.leo index a70483cae7..899c0e4af6 100644 --- a/tests/pass/parse/function/array_input.leo +++ b/tests/pass/parse/function/array_input.leo @@ -1,6 +1,6 @@ function foo(a: [u8; 1]) {} function main() { - let a: [u16; 1] = [1; 1]; + const a: [u16; 1] = [1; 1]; foo(a); } \ No newline at end of file diff --git a/tests/pass/parse/function/array_params_direct_call.leo b/tests/pass/parse/function/array_params_direct_call.leo index 9305b0958d..8ded724bc4 100644 --- a/tests/pass/parse/function/array_params_direct_call.leo +++ b/tests/pass/parse/function/array_params_direct_call.leo @@ -1,7 +1,7 @@ function do_nothing(arr: [u32; 2]) {} function main() { - let arr: [u32; 2] = [0; 2]; + const arr: [u32; 2] = [0; 2]; do_nothing(arr); do_nothing([...arr]); diff --git a/tests/pass/parse/function/iteration.leo b/tests/pass/parse/function/iteration.leo index 19af4dd9cf..b1fcee6964 100644 --- a/tests/pass/parse/function/iteration.leo +++ b/tests/pass/parse/function/iteration.leo @@ -3,7 +3,7 @@ function one() -> u32 { } function main() { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += one(); diff --git a/tests/pass/parse/function/iteration_repeated.leo b/tests/pass/parse/function/iteration_repeated.leo index 3694b3594a..d76380a6b5 100644 --- a/tests/pass/parse/function/iteration_repeated.leo +++ b/tests/pass/parse/function/iteration_repeated.leo @@ -1,5 +1,5 @@ function iteration() -> u32 { - let mut a = 0u32; + let a = 0u32; for i in 0..10 { a += 1; @@ -9,7 +9,7 @@ function iteration() -> u32 { } function main() { - let total = iteration() + iteration(); + const total = iteration() + iteration(); console.assert(total == 20); } \ No newline at end of file diff --git a/tests/pass/parse/function/multiple_returns.leo b/tests/pass/parse/function/multiple_returns.leo index ef00a4ef47..d927c51976 100644 --- a/tests/pass/parse/function/multiple_returns.leo +++ b/tests/pass/parse/function/multiple_returns.leo @@ -3,7 +3,7 @@ function tuple() -> (bool, bool) { } function main() { - let (a, b) = tuple(); + const (a, b) = tuple(); console.assert(a == true); console.assert(b == false); diff --git a/tests/pass/parse/function/multiple_returns_fail_conditional.leo b/tests/pass/parse/function/multiple_returns_fail_conditional.leo index 04ebb9e306..227fe5ce12 100644 --- a/tests/pass/parse/function/multiple_returns_fail_conditional.leo +++ b/tests/pass/parse/function/multiple_returns_fail_conditional.leo @@ -1,7 +1,7 @@ function main () -> u16 { if false { - let a = 1u16; - let b = a + 1u16; + const a = 1u16; + const b = a + 1u16; return b } else if false { return 0u16 diff --git a/tests/pass/parse/function/repeated.leo b/tests/pass/parse/function/repeated.leo index a2d04d55f9..f83fa6098b 100644 --- a/tests/pass/parse/function/repeated.leo +++ b/tests/pass/parse/function/repeated.leo @@ -3,7 +3,7 @@ function one() -> bool { } function main() { - let a = one() && one(); + const a = one() && one(); console.assert(a == true); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_array_nested_fail.leo b/tests/pass/parse/function/return_array_nested_fail.leo index dca001d9cc..8eca684b8a 100644 --- a/tests/pass/parse/function/return_array_nested_fail.leo +++ b/tests/pass/parse/function/return_array_nested_fail.leo @@ -3,5 +3,5 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let b = array_3x2_tuple(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_array_nested_pass.leo b/tests/pass/parse/function/return_array_nested_pass.leo index dda5b4342b..bfbfc8fd29 100644 --- a/tests/pass/parse/function/return_array_nested_pass.leo +++ b/tests/pass/parse/function/return_array_nested_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [[u8; 2]; 3] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_array_tuple_fail.leo b/tests/pass/parse/function/return_array_tuple_fail.leo index 4b7377e327..c960456ac1 100644 --- a/tests/pass/parse/function/return_array_tuple_fail.leo +++ b/tests/pass/parse/function/return_array_tuple_fail.leo @@ -3,5 +3,5 @@ function array_3x2_nested() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); + const a = array_3x2_nested(); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_array_tuple_pass.leo b/tests/pass/parse/function/return_array_tuple_pass.leo index a700bcabad..4199e31990 100644 --- a/tests/pass/parse/function/return_array_tuple_pass.leo +++ b/tests/pass/parse/function/return_array_tuple_pass.leo @@ -7,6 +7,6 @@ function array_3x2_tuple() -> [u8; (3, 2)] { } function main() { - let a = array_3x2_nested(); - let b = array_3x2_tuple(); + const a = array_3x2_nested(); + const b = array_3x2_tuple(); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_tuple.leo b/tests/pass/parse/function/return_tuple.leo index c459740a47..a3b1bbc36a 100644 --- a/tests/pass/parse/function/return_tuple.leo +++ b/tests/pass/parse/function/return_tuple.leo @@ -1,11 +1,11 @@ // Returns a tuple of tuples. function tuples() -> ((u8, u8), u32) { - let a: (u8, u8) = (1, 2); - let b: u32 = 3; + const a: (u8, u8) = (1, 2); + const b: u32 = 3; return (a, b) } function main() { - let t = tuples(); + const t = tuples(); } \ No newline at end of file diff --git a/tests/pass/parse/function/return_tuple_conditional.leo b/tests/pass/parse/function/return_tuple_conditional.leo index c63967f548..839081b2a4 100644 --- a/tests/pass/parse/function/return_tuple_conditional.leo +++ b/tests/pass/parse/function/return_tuple_conditional.leo @@ -11,5 +11,5 @@ function tuple_conditional () -> ( } function main() { - let t = tuple_conditional(); + const t = tuple_conditional(); } \ No newline at end of file diff --git a/tests/pass/parse/function/scope_fail.leo b/tests/pass/parse/function/scope_fail.leo index 773c2479d7..6f1d390541 100644 --- a/tests/pass/parse/function/scope_fail.leo +++ b/tests/pass/parse/function/scope_fail.leo @@ -3,6 +3,6 @@ function foo() -> field { } function main() { - let myGlobal = 42field; - let err = foo(); + const myGlobal = 42field; + const err = foo(); } \ No newline at end of file diff --git a/tests/pass/parse/function/value_unchanged.leo b/tests/pass/parse/function/value_unchanged.leo index 32dcfa62d6..936ff2ddcc 100644 --- a/tests/pass/parse/function/value_unchanged.leo +++ b/tests/pass/parse/function/value_unchanged.leo @@ -12,7 +12,7 @@ function bad_mutate(mut x: u32) { } function main() { - let a = 1u32; + const a = 1u32; bad_mutate(a); console.assert(a == 1u32); // <- value `a` is still `1u32` diff --git a/tests/pass/parse/group/both_sign_high.leo b/tests/pass/parse/group/both_sign_high.leo index a8217d6d40..4c93573e1e 100644 --- a/tests/pass/parse/group/both_sign_high.leo +++ b/tests/pass/parse/group/both_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, +)group; + const element = (+, +)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/both_sign_inferred.leo b/tests/pass/parse/group/both_sign_inferred.leo index b3b8b512c3..0bbd360ba0 100644 --- a/tests/pass/parse/group/both_sign_inferred.leo +++ b/tests/pass/parse/group/both_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, _)group; + const element = (_, _)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/both_sign_low.leo b/tests/pass/parse/group/both_sign_low.leo index 0519c6d17d..1cb4f46c55 100644 --- a/tests/pass/parse/group/both_sign_low.leo +++ b/tests/pass/parse/group/both_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, -)group; + const element = (-, -)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/one.leo b/tests/pass/parse/group/one.leo index 7be0cbbc2c..510110150b 100644 --- a/tests/pass/parse/group/one.leo +++ b/tests/pass/parse/group/one.leo @@ -1,3 +1,3 @@ function main() { - let element = 1group; + const element = 1group; } \ No newline at end of file diff --git a/tests/pass/parse/group/point.leo b/tests/pass/parse/group/point.leo index 85eeb53b7b..5e68415a0d 100644 --- a/tests/pass/parse/group/point.leo +++ b/tests/pass/parse/group/point.leo @@ -1,3 +1,3 @@ function main() { - let point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + const point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/point_input.leo b/tests/pass/parse/group/point_input.leo index 68d8c458a3..a3a8e63bd3 100644 --- a/tests/pass/parse/group/point_input.leo +++ b/tests/pass/parse/group/point_input.leo @@ -1,3 +1,3 @@ function main(a: group) { - let b = a; + const b = a; } \ No newline at end of file diff --git a/tests/pass/parse/group/positive_and_negative.leo b/tests/pass/parse/group/positive_and_negative.leo index fdf9b892be..5d29e36ef2 100644 --- a/tests/pass/parse/group/positive_and_negative.leo +++ b/tests/pass/parse/group/positive_and_negative.leo @@ -1,10 +1,10 @@ function main() { - let pos_element = 1group; - let neg_element = -1group; + const pos_element = 1group; + const neg_element = -1group; - let pair_x_pos = (1, _)group; - let pair_x_neg = (-1, _)group; + const pair_x_pos = (1, _)group; + const pair_x_neg = (-1, _)group; - let pair_y_pos = (_, 1)group; - let pair_y_neg = (_, -1)group; + const pair_y_pos = (_, 1)group; + const pair_y_neg = (_, -1)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/ternary.leo b/tests/pass/parse/group/ternary.leo index fb69b74521..97fba1f5b6 100644 --- a/tests/pass/parse/group/ternary.leo +++ b/tests/pass/parse/group/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: group, b: group, c: group) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/group/x_and_y.leo b/tests/pass/parse/group/x_and_y.leo index 1b64702db1..a350a7ad6b 100644 --- a/tests/pass/parse/group/x_and_y.leo +++ b/tests/pass/parse/group/x_and_y.leo @@ -1,3 +1,3 @@ function main(element: group) { - let b = element; + const b = element; } \ No newline at end of file diff --git a/tests/pass/parse/group/x_sign_high.leo b/tests/pass/parse/group/x_sign_high.leo index 1b8d397d02..f38b54ad9a 100644 --- a/tests/pass/parse/group/x_sign_high.leo +++ b/tests/pass/parse/group/x_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, +)group; + const element = (0, +)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/x_sign_inferred.leo b/tests/pass/parse/group/x_sign_inferred.leo index 9e9622a4a4..02c5ac988b 100644 --- a/tests/pass/parse/group/x_sign_inferred.leo +++ b/tests/pass/parse/group/x_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, _)group; + const element = (0, _)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/x_sign_low.leo b/tests/pass/parse/group/x_sign_low.leo index a5058bda52..ad74d18b64 100644 --- a/tests/pass/parse/group/x_sign_low.leo +++ b/tests/pass/parse/group/x_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (0, -)group; + const element = (0, -)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/y_sign_high.leo b/tests/pass/parse/group/y_sign_high.leo index fe16883b39..af2a20149d 100644 --- a/tests/pass/parse/group/y_sign_high.leo +++ b/tests/pass/parse/group/y_sign_high.leo @@ -1,3 +1,3 @@ function main() { - let element = (+, 1)group; + const element = (+, 1)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/y_sign_inferred.leo b/tests/pass/parse/group/y_sign_inferred.leo index 003c373cf2..a4efa6a982 100644 --- a/tests/pass/parse/group/y_sign_inferred.leo +++ b/tests/pass/parse/group/y_sign_inferred.leo @@ -1,3 +1,3 @@ function main() { - let element = (_, 1)group; + const element = (_, 1)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/y_sign_low.leo b/tests/pass/parse/group/y_sign_low.leo index 9e61bfd2bb..f557ed0d35 100644 --- a/tests/pass/parse/group/y_sign_low.leo +++ b/tests/pass/parse/group/y_sign_low.leo @@ -1,3 +1,3 @@ function main() { - let element = (-, 1)group; + const element = (-, 1)group; } \ No newline at end of file diff --git a/tests/pass/parse/group/zero.leo b/tests/pass/parse/group/zero.leo index e2c0283c21..6cdd4c960e 100644 --- a/tests/pass/parse/group/zero.leo +++ b/tests/pass/parse/group/zero.leo @@ -1,3 +1,3 @@ function main() { - let element = 0group; + const element = 0group; } \ No newline at end of file diff --git a/tests/pass/parse/import/many_import.leo b/tests/pass/parse/import/many_import.leo index 5e85f19778..08ae494c4f 100644 --- a/tests/pass/parse/import/many_import.leo +++ b/tests/pass/parse/import/many_import.leo @@ -12,15 +12,15 @@ import bar.( // imports directory import import car.Car; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let baz = Baz { z: 1u32 }; - let bazzar = Bazzar { a: 1u32 }; - let bat = Bat { t: 1u32 }; + const bar = Bar { r: 1u32 }; + const baz = Baz { z: 1u32 }; + const bazzar = Bazzar { a: 1u32 }; + const bat = Bat { t: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/import/many_import_star.leo b/tests/pass/parse/import/many_import_star.leo index 5145d0d05d..575487a929 100644 --- a/tests/pass/parse/import/many_import_star.leo +++ b/tests/pass/parse/import/many_import_star.leo @@ -6,14 +6,14 @@ import bar.bat.bat.*; // imports directory import import car.*; // imports directory import function main() { - let point = Point { x: 1u32, y: 1u32 }; - let foo = foo(); + const point = Point { x: 1u32, y: 1u32 }; + const foo = foo(); - let bar = Bar { r: 1u32 }; - let bat = Bat { t: 1u32 }; - let baz = Baz { z: 1u32 }; + const bar = Bar { r: 1u32 }; + const bat = Bat { t: 1u32 }; + const baz = Baz { z: 1u32 }; - let car = Car { c: 1u32 }; + const car = Car { c: 1u32 }; console.assert(car.c == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/import/multiple.leo b/tests/pass/parse/import/multiple.leo index 5c89aaee0c..4bd181c02d 100644 --- a/tests/pass/parse/import/multiple.leo +++ b/tests/pass/parse/import/multiple.leo @@ -4,7 +4,7 @@ import test-import.( ); function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(a.x == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/import/star.leo b/tests/pass/parse/import/star.leo index 9cd817686f..69d0791627 100644 --- a/tests/pass/parse/import/star.leo +++ b/tests/pass/parse/import/star.leo @@ -1,7 +1,7 @@ import test-import.*; function main() { - let a = Point { x: 1u32, y: 0u32 }; + const a = Point { x: 1u32, y: 0u32 }; console.assert(foo() == 1u32); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/max.leo b/tests/pass/parse/integers/i128/max.leo index 46c0a32599..5ba44213e1 100644 --- a/tests/pass/parse/integers/i128/max.leo +++ b/tests/pass/parse/integers/i128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105727; + const a: i128 = 170141183460469231731687303715884105727; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/max_fail.leo b/tests/pass/parse/integers/i128/max_fail.leo index 820eda8759..a9a46afd7f 100644 --- a/tests/pass/parse/integers/i128/max_fail.leo +++ b/tests/pass/parse/integers/i128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = 170141183460469231731687303715884105728; + const a: i128 = 170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/min.leo b/tests/pass/parse/integers/i128/min.leo index 5f32e5add5..19509a3fb0 100644 --- a/tests/pass/parse/integers/i128/min.leo +++ b/tests/pass/parse/integers/i128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; + const a: i128 = -170141183460469231731687303715884105728; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/min_fail.leo b/tests/pass/parse/integers/i128/min_fail.leo index 9035444fa9..918f0e439d 100644 --- a/tests/pass/parse/integers/i128/min_fail.leo +++ b/tests/pass/parse/integers/i128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i128 = -170141183460469231731687303715884105729; + const a: i128 = -170141183460469231731687303715884105729; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/negate_min.leo b/tests/pass/parse/integers/i128/negate_min.leo index cfbd308362..c9de272960 100644 --- a/tests/pass/parse/integers/i128/negate_min.leo +++ b/tests/pass/parse/integers/i128/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i128 = -170141183460469231731687303715884105728; - let b = -a; + const a: i128 = -170141183460469231731687303715884105728; + const b = -a; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/negate_zero.leo b/tests/pass/parse/integers/i128/negate_zero.leo index 9fb0c11afe..e079baf393 100644 --- a/tests/pass/parse/integers/i128/negate_zero.leo +++ b/tests/pass/parse/integers/i128/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i128; + const a = 0i128; console.assert(-a == 0i128); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i128/ternary.leo b/tests/pass/parse/integers/i128/ternary.leo index a923c428e6..3783463b22 100644 --- a/tests/pass/parse/integers/i128/ternary.leo +++ b/tests/pass/parse/integers/i128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i128, b: i128, c: i128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/max.leo b/tests/pass/parse/integers/i16/max.leo index 084fe4969a..2b70b3cc56 100644 --- a/tests/pass/parse/integers/i16/max.leo +++ b/tests/pass/parse/integers/i16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32767; + const a: i16 = 32767; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/max_fail.leo b/tests/pass/parse/integers/i16/max_fail.leo index 8dd2b7f50a..209bcc6518 100644 --- a/tests/pass/parse/integers/i16/max_fail.leo +++ b/tests/pass/parse/integers/i16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = 32768; + const a: i16 = 32768; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/min.leo b/tests/pass/parse/integers/i16/min.leo index 3331281fcf..3d05bef95a 100644 --- a/tests/pass/parse/integers/i16/min.leo +++ b/tests/pass/parse/integers/i16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32768; + const a: i16 = -32768; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/min_fail.leo b/tests/pass/parse/integers/i16/min_fail.leo index 380848381a..13d7c8b7f2 100644 --- a/tests/pass/parse/integers/i16/min_fail.leo +++ b/tests/pass/parse/integers/i16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i16 = -32769; + const a: i16 = -32769; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/negate_min.leo b/tests/pass/parse/integers/i16/negate_min.leo index 2622f8d2a3..d52a356396 100644 --- a/tests/pass/parse/integers/i16/negate_min.leo +++ b/tests/pass/parse/integers/i16/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -32768i16; - let b = -a; + const a = -32768i16; + const b = -a; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/negate_zero.leo b/tests/pass/parse/integers/i16/negate_zero.leo index 46340c3dc5..20f8a4fba7 100644 --- a/tests/pass/parse/integers/i16/negate_zero.leo +++ b/tests/pass/parse/integers/i16/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i16; + const a = 0i16; console.assert(-a == 0i16); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i16/ternary.leo b/tests/pass/parse/integers/i16/ternary.leo index 4586b87bb4..d66c73cb93 100644 --- a/tests/pass/parse/integers/i16/ternary.leo +++ b/tests/pass/parse/integers/i16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i16, b: i16, c: i16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/max.leo b/tests/pass/parse/integers/i32/max.leo index a9c707eb7f..074c75f1a6 100644 --- a/tests/pass/parse/integers/i32/max.leo +++ b/tests/pass/parse/integers/i32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483647; + const a: i32 = 2147483647; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/max_fail.leo b/tests/pass/parse/integers/i32/max_fail.leo index f3fd81815f..af2877ff5e 100644 --- a/tests/pass/parse/integers/i32/max_fail.leo +++ b/tests/pass/parse/integers/i32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = 2147483648; + const a: i32 = 2147483648; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/min.leo b/tests/pass/parse/integers/i32/min.leo index a29d591029..8436268ce6 100644 --- a/tests/pass/parse/integers/i32/min.leo +++ b/tests/pass/parse/integers/i32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483648; + const a: i32 = -2147483648; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/min_fail.leo b/tests/pass/parse/integers/i32/min_fail.leo index 1462d207e9..11a683b087 100644 --- a/tests/pass/parse/integers/i32/min_fail.leo +++ b/tests/pass/parse/integers/i32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i32 = -2147483649; + const a: i32 = -2147483649; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/negate_min.leo b/tests/pass/parse/integers/i32/negate_min.leo index b3c10064e1..a96455d57a 100644 --- a/tests/pass/parse/integers/i32/negate_min.leo +++ b/tests/pass/parse/integers/i32/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -2147483648i32; - let b = -a; + const a = -2147483648i32; + const b = -a; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/negate_zero.leo b/tests/pass/parse/integers/i32/negate_zero.leo index 5533f575a6..a3807b1f8a 100644 --- a/tests/pass/parse/integers/i32/negate_zero.leo +++ b/tests/pass/parse/integers/i32/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i32; + const a = 0i32; console.assert(-a == 0i32); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i32/ternary.leo b/tests/pass/parse/integers/i32/ternary.leo index 7927c2998b..790769d62f 100644 --- a/tests/pass/parse/integers/i32/ternary.leo +++ b/tests/pass/parse/integers/i32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i32, b: i32, c: i32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/max.leo b/tests/pass/parse/integers/i64/max.leo index e0d19881e6..593f91e110 100644 --- a/tests/pass/parse/integers/i64/max.leo +++ b/tests/pass/parse/integers/i64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775807; + const a: i64 = 9223372036854775807; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/max_fail.leo b/tests/pass/parse/integers/i64/max_fail.leo index 3e6603e4be..362b794a2c 100644 --- a/tests/pass/parse/integers/i64/max_fail.leo +++ b/tests/pass/parse/integers/i64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = 9223372036854775808; + const a: i64 = 9223372036854775808; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/min.leo b/tests/pass/parse/integers/i64/min.leo index d7e99a87f8..794d8fbfac 100644 --- a/tests/pass/parse/integers/i64/min.leo +++ b/tests/pass/parse/integers/i64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775808; + const a: i64 = -9223372036854775808; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/min_fail.leo b/tests/pass/parse/integers/i64/min_fail.leo index 11e43646b0..bb260ecc3f 100644 --- a/tests/pass/parse/integers/i64/min_fail.leo +++ b/tests/pass/parse/integers/i64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i64 = -9223372036854775809; + const a: i64 = -9223372036854775809; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/negate_min.leo b/tests/pass/parse/integers/i64/negate_min.leo index 4dd27778d0..daf694491b 100644 --- a/tests/pass/parse/integers/i64/negate_min.leo +++ b/tests/pass/parse/integers/i64/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a: i64 = -9223372036854775808; - let b = -a; + const a: i64 = -9223372036854775808; + const b = -a; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/negate_zero.leo b/tests/pass/parse/integers/i64/negate_zero.leo index 6badfe4dc7..81f09c19a3 100644 --- a/tests/pass/parse/integers/i64/negate_zero.leo +++ b/tests/pass/parse/integers/i64/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i64; + const a = 0i64; console.assert(-a == 0i64); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i64/ternary.leo b/tests/pass/parse/integers/i64/ternary.leo index 1a2d03a77f..df63b3ad6a 100644 --- a/tests/pass/parse/integers/i64/ternary.leo +++ b/tests/pass/parse/integers/i64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i64, b: i64, c: i64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/max.leo b/tests/pass/parse/integers/i8/max.leo index b51126da59..f20d59ddf4 100644 --- a/tests/pass/parse/integers/i8/max.leo +++ b/tests/pass/parse/integers/i8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 127; + const a: i8 = 127; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/max_fail.leo b/tests/pass/parse/integers/i8/max_fail.leo index 4892505915..9e1956024a 100644 --- a/tests/pass/parse/integers/i8/max_fail.leo +++ b/tests/pass/parse/integers/i8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = 128; + const a: i8 = 128; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/min.leo b/tests/pass/parse/integers/i8/min.leo index d3c1bff5e4..7b6db025ea 100644 --- a/tests/pass/parse/integers/i8/min.leo +++ b/tests/pass/parse/integers/i8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -128; + const a: i8 = -128; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/min_fail.leo b/tests/pass/parse/integers/i8/min_fail.leo index 051468ea70..41170e9b93 100644 --- a/tests/pass/parse/integers/i8/min_fail.leo +++ b/tests/pass/parse/integers/i8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: i8 = -129; + const a: i8 = -129; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/negate_min.leo b/tests/pass/parse/integers/i8/negate_min.leo index 3959da615e..7f664a1b78 100644 --- a/tests/pass/parse/integers/i8/negate_min.leo +++ b/tests/pass/parse/integers/i8/negate_min.leo @@ -1,4 +1,4 @@ function main() { - let a = -128i8; - let b = -a; + const a = -128i8; + const b = -a; } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/negate_zero.leo b/tests/pass/parse/integers/i8/negate_zero.leo index 21fbbab675..cc3f4a0828 100644 --- a/tests/pass/parse/integers/i8/negate_zero.leo +++ b/tests/pass/parse/integers/i8/negate_zero.leo @@ -1,5 +1,5 @@ function main() { - let a = 0i8; + const a = 0i8; console.assert(-a == 0i8); } \ No newline at end of file diff --git a/tests/pass/parse/integers/i8/ternary.leo b/tests/pass/parse/integers/i8/ternary.leo index e1ec1943c9..0956a9cd39 100644 --- a/tests/pass/parse/integers/i8/ternary.leo +++ b/tests/pass/parse/integers/i8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: i8, b: i8, c: i8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/u128/max.leo b/tests/pass/parse/integers/u128/max.leo index 6da59dd058..b166ede06b 100644 --- a/tests/pass/parse/integers/u128/max.leo +++ b/tests/pass/parse/integers/u128/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211455; + const a: u128 = 340282366920938463463374607431768211455; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u128/max_fail.leo b/tests/pass/parse/integers/u128/max_fail.leo index 40cdf7d2bb..f51c967925 100644 --- a/tests/pass/parse/integers/u128/max_fail.leo +++ b/tests/pass/parse/integers/u128/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 340282366920938463463374607431768211456; + const a: u128 = 340282366920938463463374607431768211456; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u128/min.leo b/tests/pass/parse/integers/u128/min.leo index 044bda9e1c..41fbf1a2fe 100644 --- a/tests/pass/parse/integers/u128/min.leo +++ b/tests/pass/parse/integers/u128/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = 0; + const a: u128 = 0; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u128/min_fail.leo b/tests/pass/parse/integers/u128/min_fail.leo index df2390c576..b0d17191ff 100644 --- a/tests/pass/parse/integers/u128/min_fail.leo +++ b/tests/pass/parse/integers/u128/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u128 = -1; + const a: u128 = -1; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u128/ternary.leo b/tests/pass/parse/integers/u128/ternary.leo index 22e2e67058..99a6b997e0 100644 --- a/tests/pass/parse/integers/u128/ternary.leo +++ b/tests/pass/parse/integers/u128/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u128, b: u128, c: u128) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/u16/max.leo b/tests/pass/parse/integers/u16/max.leo index a707df9af8..56cb2af18d 100644 --- a/tests/pass/parse/integers/u16/max.leo +++ b/tests/pass/parse/integers/u16/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65535; + const a: u16 = 65535; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u16/max_fail.leo b/tests/pass/parse/integers/u16/max_fail.leo index 68ff0481e0..bb703210e3 100644 --- a/tests/pass/parse/integers/u16/max_fail.leo +++ b/tests/pass/parse/integers/u16/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 65536; + const a: u16 = 65536; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u16/min.leo b/tests/pass/parse/integers/u16/min.leo index ab1bd7db48..4dee94a1a4 100644 --- a/tests/pass/parse/integers/u16/min.leo +++ b/tests/pass/parse/integers/u16/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = 0; + const a: u16 = 0; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u16/min_fail.leo b/tests/pass/parse/integers/u16/min_fail.leo index 99b7310362..0c61dd7ddf 100644 --- a/tests/pass/parse/integers/u16/min_fail.leo +++ b/tests/pass/parse/integers/u16/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u16 = -1; + const a: u16 = -1; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u16/ternary.leo b/tests/pass/parse/integers/u16/ternary.leo index 11d836570d..d6131f9f4f 100644 --- a/tests/pass/parse/integers/u16/ternary.leo +++ b/tests/pass/parse/integers/u16/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u16, b: u16, c: u16) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/u32/max.leo b/tests/pass/parse/integers/u32/max.leo index 2950164a08..4a07281b5d 100644 --- a/tests/pass/parse/integers/u32/max.leo +++ b/tests/pass/parse/integers/u32/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967295; + const a: u32 = 4294967295; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u32/max_fail.leo b/tests/pass/parse/integers/u32/max_fail.leo index 96c7e01657..6b1631876e 100644 --- a/tests/pass/parse/integers/u32/max_fail.leo +++ b/tests/pass/parse/integers/u32/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 4294967296; + const a: u32 = 4294967296; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u32/min.leo b/tests/pass/parse/integers/u32/min.leo index 0f1c080938..8077e0ec02 100644 --- a/tests/pass/parse/integers/u32/min.leo +++ b/tests/pass/parse/integers/u32/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = 0; + const a: u32 = 0; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u32/min_fail.leo b/tests/pass/parse/integers/u32/min_fail.leo index a8d41c475a..c3e3f33225 100644 --- a/tests/pass/parse/integers/u32/min_fail.leo +++ b/tests/pass/parse/integers/u32/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u32 = -1; + const a: u32 = -1; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u32/ternary.leo b/tests/pass/parse/integers/u32/ternary.leo index 3c96a7236c..f32ffc29fe 100644 --- a/tests/pass/parse/integers/u32/ternary.leo +++ b/tests/pass/parse/integers/u32/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u32, b: u32, c: u32) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/u64/max.leo b/tests/pass/parse/integers/u64/max.leo index 985897c006..f14ac7ce64 100644 --- a/tests/pass/parse/integers/u64/max.leo +++ b/tests/pass/parse/integers/u64/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551615; + const a: u64 = 18446744073709551615; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u64/max_fail.leo b/tests/pass/parse/integers/u64/max_fail.leo index 0ca3f13895..d606c83585 100644 --- a/tests/pass/parse/integers/u64/max_fail.leo +++ b/tests/pass/parse/integers/u64/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 18446744073709551616; + const a: u64 = 18446744073709551616; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u64/min.leo b/tests/pass/parse/integers/u64/min.leo index aa9b72fc8a..b1da40b14c 100644 --- a/tests/pass/parse/integers/u64/min.leo +++ b/tests/pass/parse/integers/u64/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = 0; + const a: u64 = 0; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u64/min_fail.leo b/tests/pass/parse/integers/u64/min_fail.leo index 81b90cc74a..e58f1897e6 100644 --- a/tests/pass/parse/integers/u64/min_fail.leo +++ b/tests/pass/parse/integers/u64/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u64 = -1; + const a: u64 = -1; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u64/ternary.leo b/tests/pass/parse/integers/u64/ternary.leo index 4c4ddd8e0c..4427cd0466 100644 --- a/tests/pass/parse/integers/u64/ternary.leo +++ b/tests/pass/parse/integers/u64/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u64, b: u64, c: u64) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/integers/u8/max.leo b/tests/pass/parse/integers/u8/max.leo index 684bdfba10..03e82c9a5e 100644 --- a/tests/pass/parse/integers/u8/max.leo +++ b/tests/pass/parse/integers/u8/max.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 255; + const a: u8 = 255; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u8/max_fail.leo b/tests/pass/parse/integers/u8/max_fail.leo index f2b870096d..01bb544601 100644 --- a/tests/pass/parse/integers/u8/max_fail.leo +++ b/tests/pass/parse/integers/u8/max_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 256; + const a: u8 = 256; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u8/min.leo b/tests/pass/parse/integers/u8/min.leo index a88e33c5a6..1db08a07b5 100644 --- a/tests/pass/parse/integers/u8/min.leo +++ b/tests/pass/parse/integers/u8/min.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = 0; + const a: u8 = 0; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u8/min_fail.leo b/tests/pass/parse/integers/u8/min_fail.leo index 7b91dc6e1a..3cd8d46de7 100644 --- a/tests/pass/parse/integers/u8/min_fail.leo +++ b/tests/pass/parse/integers/u8/min_fail.leo @@ -1,3 +1,3 @@ function main() { - let a: u8 = -1; + const a: u8 = -1; } \ No newline at end of file diff --git a/tests/pass/parse/integers/u8/ternary.leo b/tests/pass/parse/integers/u8/ternary.leo index 1b436aa054..5123a511cd 100644 --- a/tests/pass/parse/integers/u8/ternary.leo +++ b/tests/pass/parse/integers/u8/ternary.leo @@ -1,5 +1,5 @@ function main(s: bool, a: u8, b: u8, c: u8) { - let r = s ? a : b; + const r = s ? a : b; console.assert(r == c); } \ No newline at end of file diff --git a/tests/pass/parse/mutability/array.leo b/tests/pass/parse/mutability/array.leo index 1d51c15271..ea63baaad2 100644 --- a/tests/pass/parse/mutability/array.leo +++ b/tests/pass/parse/mutability/array.leo @@ -1,5 +1,5 @@ // Arrays are immutable by default. function main() { - let a = [1u32]; + const a = [1u32]; a[0] = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/array_mut.leo b/tests/pass/parse/mutability/array_mut.leo index 1b86bac80f..5d4db3b68a 100644 --- a/tests/pass/parse/mutability/array_mut.leo +++ b/tests/pass/parse/mutability/array_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32]; + let a = [1u32]; a[0] = 0; console.assert(a[0] == 0u32); diff --git a/tests/pass/parse/mutability/array_splice_mut.leo b/tests/pass/parse/mutability/array_splice_mut.leo index 57cc67e872..d13216600a 100644 --- a/tests/pass/parse/mutability/array_splice_mut.leo +++ b/tests/pass/parse/mutability/array_splice_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [1u32, 2u32, 3u32]; + let a = [1u32, 2u32, 3u32]; a[0u32..2u32] = [4u32, 5u32]; console.assert(a[0] == 4u32); diff --git a/tests/pass/parse/mutability/array_tuple_mut.leo b/tests/pass/parse/mutability/array_tuple_mut.leo index e0096bd7ac..ed323d46da 100644 --- a/tests/pass/parse/mutability/array_tuple_mut.leo +++ b/tests/pass/parse/mutability/array_tuple_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes an array variable mutable. function main() { - let mut a = [(1u32, 2u32)]; + let a = [(1u32, 2u32)]; a[0u32].1 = 3u32; console.assert(a[0u32].0 == 1u32); diff --git a/tests/pass/parse/mutability/circuit.leo b/tests/pass/parse/mutability/circuit.leo index be1c568836..508595ef16 100644 --- a/tests/pass/parse/mutability/circuit.leo +++ b/tests/pass/parse/mutability/circuit.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let a = Foo { x: 1 }; + const a = Foo { x: 1 }; a.x = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/circuit_function_mut.leo b/tests/pass/parse/mutability/circuit_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/tests/pass/parse/mutability/circuit_function_mut.leo +++ b/tests/pass/parse/mutability/circuit_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/circuit_mut.leo b/tests/pass/parse/mutability/circuit_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/tests/pass/parse/mutability/circuit_mut.leo +++ b/tests/pass/parse/mutability/circuit_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/tests/pass/parse/mutability/circuit_static_function_mut.leo b/tests/pass/parse/mutability/circuit_static_function_mut.leo index eba1d02c0e..c1bc941c94 100644 --- a/tests/pass/parse/mutability/circuit_static_function_mut.leo +++ b/tests/pass/parse/mutability/circuit_static_function_mut.leo @@ -4,6 +4,6 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.bar = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/circuit_variable_mut.leo b/tests/pass/parse/mutability/circuit_variable_mut.leo index 27bd6109b2..f7067db11e 100644 --- a/tests/pass/parse/mutability/circuit_variable_mut.leo +++ b/tests/pass/parse/mutability/circuit_variable_mut.leo @@ -4,7 +4,7 @@ circuit Foo { } function main() { - let mut a = Foo { x: 1 }; + let a = Foo { x: 1 }; a.x = 0; console.assert(a.x == 0u32); diff --git a/tests/pass/parse/mutability/const.leo b/tests/pass/parse/mutability/const.leo index d2a3a6ac2b..6201e7c5af 100644 --- a/tests/pass/parse/mutability/const.leo +++ b/tests/pass/parse/mutability/const.leo @@ -1,5 +1,5 @@ // Let variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/let.leo b/tests/pass/parse/mutability/let.leo index 477e6b35f5..105730adb7 100644 --- a/tests/pass/parse/mutability/let.leo +++ b/tests/pass/parse/mutability/let.leo @@ -1,5 +1,5 @@ // Variables are immutable by default. function main() { - let a = 1u32; + const a = 1u32; a = 0; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/let_mut.leo b/tests/pass/parse/mutability/let_mut.leo index 5766d144d3..cd1060d0d2 100644 --- a/tests/pass/parse/mutability/let_mut.leo +++ b/tests/pass/parse/mutability/let_mut.leo @@ -1,6 +1,6 @@ // Adding the `mut` keyword makes a variable mutable. function main() { - let mut a = 1u32; + let a = 1u32; a = 0; console.assert(a == 0u32); diff --git a/tests/pass/parse/mutability/let_mut_nested.leo b/tests/pass/parse/mutability/let_mut_nested.leo index 27121f6e48..93236ef4c6 100644 --- a/tests/pass/parse/mutability/let_mut_nested.leo +++ b/tests/pass/parse/mutability/let_mut_nested.leo @@ -1,5 +1,5 @@ function main () { - let mut x = 2u8; - let mut y = x; - let z = y / 2u8; + let x = 2u8; + let y = x; + const z = y / 2u8; } \ No newline at end of file diff --git a/tests/pass/parse/mutability/swap.leo b/tests/pass/parse/mutability/swap.leo index 0a209149ee..b2a795e826 100644 --- a/tests/pass/parse/mutability/swap.leo +++ b/tests/pass/parse/mutability/swap.leo @@ -1,17 +1,17 @@ // Swap two elements of an array. function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { - let t = a[i]; + const t = a[i]; a[i] = a[j]; a[j] = t; return a } function main() { - let mut arr: [u32; 2] = [0, 1]; - let expected: [u32; 2] = [1, 0]; + let arr: [u32; 2] = [0, 1]; + const expected: [u32; 2] = [1, 0]; // Do swap. - let actual = swap(arr, 0, 1); + const actual = swap(arr, 0, 1); // Check result. for i in 0..2 { diff --git a/tests/pass/parse/statements/block.leo b/tests/pass/parse/statements/block.leo index 8650808041..ca8da645ec 100644 --- a/tests/pass/parse/statements/block.leo +++ b/tests/pass/parse/statements/block.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; { x = 5u32; diff --git a/tests/pass/parse/statements/chain.leo b/tests/pass/parse/statements/chain.leo index dbc0e1f38c..44d4e86243 100644 --- a/tests/pass/parse/statements/chain.leo +++ b/tests/pass/parse/statements/chain.leo @@ -1,5 +1,5 @@ function main(a: u32, b: u32) { - let mut c = 0u32; + let c = 0u32; if a == 1 { c = 1; diff --git a/tests/pass/parse/statements/for_loop.leo b/tests/pass/parse/statements/for_loop.leo index 2dca076858..db307f3c36 100644 --- a/tests/pass/parse/statements/for_loop.leo +++ b/tests/pass/parse/statements/for_loop.leo @@ -1,5 +1,5 @@ function main(a: bool) { - let mut b = 0u32; + let b = 0u32; if a { for i in 0..4 { @@ -7,7 +7,7 @@ function main(a: bool) { } } - let r: u32 = a ? 6 : 0; + const r: u32 = a ? 6 : 0; console.assert(r == b); } diff --git a/tests/pass/parse/statements/iteration_basic.leo b/tests/pass/parse/statements/iteration_basic.leo index 103c9abb9e..5d74e69a1f 100644 --- a/tests/pass/parse/statements/iteration_basic.leo +++ b/tests/pass/parse/statements/iteration_basic.leo @@ -1,5 +1,5 @@ function main() { - let mut x = 4u32; + let x = 4u32; for i in 0..3 { x -= 1; } diff --git a/tests/pass/parse/statements/mutate.leo b/tests/pass/parse/statements/mutate.leo index 458d3d0d60..9bb124eefd 100644 --- a/tests/pass/parse/statements/mutate.leo +++ b/tests/pass/parse/statements/mutate.leo @@ -1,5 +1,5 @@ function main(a: u32) { - let mut b = 5u32; + let b = 5u32; if a == 1 { b = 1; diff --git a/tests/pass/parse/statements/nested.leo b/tests/pass/parse/statements/nested.leo index 3596f889d1..1849c2a339 100644 --- a/tests/pass/parse/statements/nested.leo +++ b/tests/pass/parse/statements/nested.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool, c: u32) { - let mut d = 0u32; + let d = 0u32; if a { d += 1; diff --git a/tests/pass/parse/statements/ternary_basic.leo b/tests/pass/parse/statements/ternary_basic.leo index 675b681fa9..38359004a9 100644 --- a/tests/pass/parse/statements/ternary_basic.leo +++ b/tests/pass/parse/statements/ternary_basic.leo @@ -1,5 +1,5 @@ function main(a: bool, b: bool) { - let c = a ? true : false; + const c = a ? true : false; - let d = c == b; + const d = c == b; } \ No newline at end of file diff --git a/tests/pass/parse/syntax/compare_mismatched_types.leo b/tests/pass/parse/syntax/compare_mismatched_types.leo index 8cf6327cb3..1ac81ab098 100644 --- a/tests/pass/parse/syntax/compare_mismatched_types.leo +++ b/tests/pass/parse/syntax/compare_mismatched_types.leo @@ -1,3 +1,3 @@ function main() { - let a = -5i8 > 342u32; + const a = -5i8 > 342u32; } \ No newline at end of file diff --git a/tests/pass/parse/tuples/access.leo b/tests/pass/parse/tuples/access.leo index 196e9d058c..9277f4ecc5 100644 --- a/tests/pass/parse/tuples/access.leo +++ b/tests/pass/parse/tuples/access.leo @@ -1,5 +1,5 @@ function main() { - let a = (true, false); + const a = (true, false); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/tests/pass/parse/tuples/basic.leo b/tests/pass/parse/tuples/basic.leo index 37c728611c..2e777f2797 100644 --- a/tests/pass/parse/tuples/basic.leo +++ b/tests/pass/parse/tuples/basic.leo @@ -1,3 +1,3 @@ function main() { - let a = (true, false); + const a = (true, false); } \ No newline at end of file diff --git a/tests/pass/parse/tuples/function.leo b/tests/pass/parse/tuples/function.leo index b318348813..4222b858cb 100644 --- a/tests/pass/parse/tuples/function.leo +++ b/tests/pass/parse/tuples/function.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a = foo(); + const a = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/tests/pass/parse/tuples/function_multiple.leo b/tests/pass/parse/tuples/function_multiple.leo index 39848377c6..73fbe277ae 100644 --- a/tests/pass/parse/tuples/function_multiple.leo +++ b/tests/pass/parse/tuples/function_multiple.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let (a, b) = foo(); + const (a, b) = foo(); console.assert(a == true); console.assert(b == false); diff --git a/tests/pass/parse/tuples/function_typed.leo b/tests/pass/parse/tuples/function_typed.leo index 8af2c907ca..f89e7a3273 100644 --- a/tests/pass/parse/tuples/function_typed.leo +++ b/tests/pass/parse/tuples/function_typed.leo @@ -3,7 +3,7 @@ function foo() -> (bool, bool) { } function main() { - let a: (bool, bool) = foo(); + const a: (bool, bool) = foo(); console.assert(a.0 == true); console.assert(a.1 == false); diff --git a/tests/pass/parse/tuples/multiple.leo b/tests/pass/parse/tuples/multiple.leo index b7627dad2a..2cb003b0e1 100644 --- a/tests/pass/parse/tuples/multiple.leo +++ b/tests/pass/parse/tuples/multiple.leo @@ -1,5 +1,5 @@ function main() { - let (a, b) = (true, false); + const (a, b) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/tests/pass/parse/tuples/multiple_typed.leo b/tests/pass/parse/tuples/multiple_typed.leo index 29fc7ef877..bbe4a01858 100644 --- a/tests/pass/parse/tuples/multiple_typed.leo +++ b/tests/pass/parse/tuples/multiple_typed.leo @@ -1,5 +1,5 @@ function main() { - let (a, b): (bool, bool) = (true, false); + const (a, b): (bool, bool) = (true, false); console.assert(a == true); console.assert(b == false); diff --git a/tests/pass/parse/tuples/nested.leo b/tests/pass/parse/tuples/nested.leo index a9599b360c..bbdb2394a8 100644 --- a/tests/pass/parse/tuples/nested.leo +++ b/tests/pass/parse/tuples/nested.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); } \ No newline at end of file diff --git a/tests/pass/parse/tuples/nested_access.leo b/tests/pass/parse/tuples/nested_access.leo index 5edba64e24..f21fa59bba 100644 --- a/tests/pass/parse/tuples/nested_access.leo +++ b/tests/pass/parse/tuples/nested_access.leo @@ -1,6 +1,6 @@ function main() { - let a = (true, false); - let b = (true, a); + const a = (true, false); + const b = (true, a); console.assert(b.0 == true); console.assert(b.1.0 == true); diff --git a/tests/pass/parse/tuples/nested_typed.leo b/tests/pass/parse/tuples/nested_typed.leo index 2e68117a2b..44a10b2a3e 100644 --- a/tests/pass/parse/tuples/nested_typed.leo +++ b/tests/pass/parse/tuples/nested_typed.leo @@ -1,4 +1,4 @@ function main() { - let a = (true, false); - let b: (bool, (bool, bool)) = (true, a); + const a = (true, false); + const b: (bool, (bool, bool)) = (true, a); } \ No newline at end of file diff --git a/tests/pass/parse/tuples/typed.leo b/tests/pass/parse/tuples/typed.leo index 8cd2ed79db..8f623fc148 100644 --- a/tests/pass/parse/tuples/typed.leo +++ b/tests/pass/parse/tuples/typed.leo @@ -1,3 +1,3 @@ function main() { - let a: (bool, bool) = (true, false); + const a: (bool, bool) = (true, false); } \ No newline at end of file From 1d9befc0acedc1ca5b459c807c8f855144844ac5 Mon Sep 17 00:00:00 2001 From: gluax Date: Fri, 19 Mar 2021 11:30:24 -0400 Subject: [PATCH 02/10] function input mutable by default --- asg/tests/fail/mutability/function_input.leo | 4 ++-- asg/tests/pass/function/value_unchanged.leo | 2 +- asg/tests/pass/mutability/function_input_mut.leo | 4 ++-- asg/tests/pass/mutability/swap.leo | 2 +- compiler/tests/function/value_unchanged.leo | 2 +- compiler/tests/mutability/function_input.leo | 4 ++-- compiler/tests/mutability/function_input_mut.leo | 4 ++-- compiler/tests/mutability/swap.leo | 2 +- parser/src/errors/deprecated.rs | 14 ++++++++++++-- parser/src/parser/file.rs | 9 ++++++++- parser/src/parser/statement.rs | 5 +++-- tests/pass/parse/function/value_unchanged.leo | 2 +- tests/pass/parse/mutability/function_input_mut.leo | 4 ++-- tests/pass/parse/mutability/swap.leo | 2 +- 14 files changed, 39 insertions(+), 21 deletions(-) diff --git a/asg/tests/fail/mutability/function_input.leo b/asg/tests/fail/mutability/function_input.leo index 1ef3ce1f02..18d035574b 100644 --- a/asg/tests/fail/mutability/function_input.leo +++ b/asg/tests/fail/mutability/function_input.leo @@ -1,4 +1,4 @@ -// Function input are immutable by default. -function main(a: bool) { +// Const function input are immutable. +function main(const a: bool) { a = false; } \ No newline at end of file diff --git a/asg/tests/pass/function/value_unchanged.leo b/asg/tests/pass/function/value_unchanged.leo index 936ff2ddcc..e116736316 100644 --- a/asg/tests/pass/function/value_unchanged.leo +++ b/asg/tests/pass/function/value_unchanged.leo @@ -7,7 +7,7 @@ // line 11: variable `x` is set to value `0`. // line 18: program returns the value of `a`. -function bad_mutate(mut x: u32) { +function bad_mutate(x: u32) { x = 0; // <- does not change `a` } diff --git a/asg/tests/pass/mutability/function_input_mut.leo b/asg/tests/pass/mutability/function_input_mut.leo index 2df24b227c..98739d78c7 100644 --- a/asg/tests/pass/mutability/function_input_mut.leo +++ b/asg/tests/pass/mutability/function_input_mut.leo @@ -1,5 +1,5 @@ -// Adding the `mut` keyword makes a function variable mutable. -function main(mut a: bool) { +// Function input are mutable by default. +function main(a: bool) { a = true; console.assert(a == true); diff --git a/asg/tests/pass/mutability/swap.leo b/asg/tests/pass/mutability/swap.leo index b2a795e826..2d9ddb4279 100644 --- a/asg/tests/pass/mutability/swap.leo +++ b/asg/tests/pass/mutability/swap.leo @@ -1,5 +1,5 @@ // Swap two elements of an array. -function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { +function swap(a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { const t = a[i]; a[i] = a[j]; a[j] = t; diff --git a/compiler/tests/function/value_unchanged.leo b/compiler/tests/function/value_unchanged.leo index 936ff2ddcc..e116736316 100644 --- a/compiler/tests/function/value_unchanged.leo +++ b/compiler/tests/function/value_unchanged.leo @@ -7,7 +7,7 @@ // line 11: variable `x` is set to value `0`. // line 18: program returns the value of `a`. -function bad_mutate(mut x: u32) { +function bad_mutate(x: u32) { x = 0; // <- does not change `a` } diff --git a/compiler/tests/mutability/function_input.leo b/compiler/tests/mutability/function_input.leo index 1ef3ce1f02..18d035574b 100644 --- a/compiler/tests/mutability/function_input.leo +++ b/compiler/tests/mutability/function_input.leo @@ -1,4 +1,4 @@ -// Function input are immutable by default. -function main(a: bool) { +// Const function input are immutable. +function main(const a: bool) { a = false; } \ No newline at end of file diff --git a/compiler/tests/mutability/function_input_mut.leo b/compiler/tests/mutability/function_input_mut.leo index 2df24b227c..98739d78c7 100644 --- a/compiler/tests/mutability/function_input_mut.leo +++ b/compiler/tests/mutability/function_input_mut.leo @@ -1,5 +1,5 @@ -// Adding the `mut` keyword makes a function variable mutable. -function main(mut a: bool) { +// Function input are mutable by default. +function main(a: bool) { a = true; console.assert(a == true); diff --git a/compiler/tests/mutability/swap.leo b/compiler/tests/mutability/swap.leo index b2a795e826..2d9ddb4279 100644 --- a/compiler/tests/mutability/swap.leo +++ b/compiler/tests/mutability/swap.leo @@ -1,5 +1,5 @@ // Swap two elements of an array. -function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { +function swap(a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { const t = a[i]; a[i] = a[j]; a[j] = t; diff --git a/parser/src/errors/deprecated.rs b/parser/src/errors/deprecated.rs index b16a4f5247..5a03d59d3b 100644 --- a/parser/src/errors/deprecated.rs +++ b/parser/src/errors/deprecated.rs @@ -43,9 +43,19 @@ impl LeoError for DeprecatedError { } impl DeprecatedError { - pub fn let_mut_statement(span: &Span) -> Self { + pub fn mut_function_input(mut span: Span) -> Self { + let message = + "function func(mut a: u32) { ... } is deprecated. Passed variables are mutable by default.".to_string(); + span.col_start -= 1; + span.col_stop -= 1; + Self::new_from_span(message, &span) + } + + pub fn let_mut_statement(mut span: Span) -> Self { let message = "let mut = ... is deprecated. `let` keyword implies mutabality by default.".to_string(); - Self::new_from_span(message, span) + span.col_start -= 1; + span.col_stop -= 1; + Self::new_from_span(message, &span) } pub fn test_function(span: &Span) -> Self { diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index 36dca63852..5b7687ab15 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -332,11 +332,18 @@ impl ParserContext { } return Ok(FunctionInput::SelfKeyword(SelfKeyword { span: name.span })); } + + if let Some(mutable) = &mutable { + return Err(SyntaxError::DeprecatedError(DeprecatedError::mut_function_input( + &mutable.span + &name.span, + ))); + } + self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable { const_: const_.is_some(), - mutable: mutable.is_some(), + mutable: const_.is_none(), type_, span: name.span.clone(), identifier: name, diff --git a/parser/src/parser/statement.rs b/parser/src/parser/statement.rs index b57215f398..ad2c954d6f 100644 --- a/parser/src/parser/statement.rs +++ b/parser/src/parser/statement.rs @@ -287,9 +287,10 @@ impl ParserContext { /// valid keywords. /// pub fn parse_variable_name(&mut self, span: &SpannedToken) -> SyntaxResult { - if self.eat(Token::Mut).is_some() { + let mutable = self.eat(Token::Mut); + if let Some(mutable) = &mutable { return Err(SyntaxError::DeprecatedError(DeprecatedError::let_mut_statement( - &span.span, + &mutable.span + &span.span, ))); } diff --git a/tests/pass/parse/function/value_unchanged.leo b/tests/pass/parse/function/value_unchanged.leo index 936ff2ddcc..e116736316 100644 --- a/tests/pass/parse/function/value_unchanged.leo +++ b/tests/pass/parse/function/value_unchanged.leo @@ -7,7 +7,7 @@ // line 11: variable `x` is set to value `0`. // line 18: program returns the value of `a`. -function bad_mutate(mut x: u32) { +function bad_mutate(x: u32) { x = 0; // <- does not change `a` } diff --git a/tests/pass/parse/mutability/function_input_mut.leo b/tests/pass/parse/mutability/function_input_mut.leo index 2df24b227c..98739d78c7 100644 --- a/tests/pass/parse/mutability/function_input_mut.leo +++ b/tests/pass/parse/mutability/function_input_mut.leo @@ -1,5 +1,5 @@ -// Adding the `mut` keyword makes a function variable mutable. -function main(mut a: bool) { +// Function input are mutable by default. +function main(a: bool) { a = true; console.assert(a == true); diff --git a/tests/pass/parse/mutability/swap.leo b/tests/pass/parse/mutability/swap.leo index b2a795e826..2d9ddb4279 100644 --- a/tests/pass/parse/mutability/swap.leo +++ b/tests/pass/parse/mutability/swap.leo @@ -1,5 +1,5 @@ // Swap two elements of an array. -function swap(mut a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { +function swap(a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { const t = a[i]; a[i] = a[j]; a[j] = t; From 2c6a34fea7270592b26205fd185882cea5787743 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 22 Mar 2021 11:47:34 -0400 Subject: [PATCH 03/10] test that was failing coverage only existed on master --- compiler/tests/statements/iteration_variable.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests/statements/iteration_variable.leo b/compiler/tests/statements/iteration_variable.leo index d3d82b2664..67bb166236 100644 --- a/compiler/tests/statements/iteration_variable.leo +++ b/compiler/tests/statements/iteration_variable.leo @@ -1,5 +1,5 @@ function main() { - let x: u32 = 5; + const x: u32 = 5; for i in 0..x { console.log("{}", i); From fe8eae981d5854cf618dbbb29d07aa637f6e25d8 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 23 Mar 2021 11:32:36 -0400 Subject: [PATCH 04/10] const_ self as function input --- parser/src/parser/file.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index b590c35f3e..a298095a26 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -327,13 +327,13 @@ impl ParserContext { self.expect_ident()? }; if name.name == "self" { - if const_.is_some() { - //error - } if let Some(mutable) = &mutable { name.span = &mutable.span + &name.span; name.name = "mut self".to_string(); return Ok(FunctionInput::MutSelfKeyword(MutSelfKeyword { identifier: name })); + } else if let Some(const_) = &const_ { + name.span = &const_.span + &name.span; + name.name = "const self".to_string(); } return Ok(FunctionInput::SelfKeyword(SelfKeyword { identifier: name })); } @@ -347,8 +347,8 @@ impl ParserContext { self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable { - const_: const_.is_some(), - mutable: const_.is_none(), + const_: const_.is_some() || (const_.is_none() && mutable.is_none()), + mutable: mutable.is_some(), type_, span: name.span.clone(), identifier: name, From 0ea4f1e0e35c0eaa06bd4382cbe3869b95801264 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 23 Mar 2021 11:49:27 -0400 Subject: [PATCH 05/10] const_ self as function input properly --- asg/src/program/function.rs | 4 +++ ast/src/common/const_self_keyword.rs | 44 +++++++++++++++++++++++ ast/src/common/mod.rs | 3 ++ ast/src/functions/input/input_variable.rs | 23 +++++++++++- compiler/src/function/main_function.rs | 2 +- parser/src/parser/file.rs | 5 +-- 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 ast/src/common/const_self_keyword.rs diff --git a/asg/src/program/function.rs b/asg/src/program/function.rs index c74e15f850..76181db69d 100644 --- a/asg/src/program/function.rs +++ b/asg/src/program/function.rs @@ -37,6 +37,7 @@ use std::cell::{Cell, RefCell}; #[derive(Clone, Copy, PartialEq)] pub enum FunctionQualifier { SelfRef, + ConstSelfRef, MutSelfRef, Static, } @@ -89,6 +90,9 @@ impl<'a> Function<'a> { FunctionInput::SelfKeyword(_) => { qualifier = FunctionQualifier::SelfRef; } + FunctionInput::ConstSelfKeyword(_) => { + qualifier = FunctionQualifier::ConstSelfRef; + } FunctionInput::MutSelfKeyword(_) => { qualifier = FunctionQualifier::MutSelfRef; } diff --git a/ast/src/common/const_self_keyword.rs b/ast/src/common/const_self_keyword.rs new file mode 100644 index 0000000000..52d361ae16 --- /dev/null +++ b/ast/src/common/const_self_keyword.rs @@ -0,0 +1,44 @@ +// Copyright (C) 2019-2021 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use crate::{Identifier, Node, Span}; + +use serde::{Deserialize, Serialize}; +use std::fmt; + +/// The `self` keyword can view circuit values inside of a circuit function. +/// Circuit values cannot be modified. To modify values use the `mut self` [MutSelfKeyword]. +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)] +#[serde(transparent)] +pub struct ConstSelfKeyword { + pub identifier: Identifier, +} + +impl fmt::Display for ConstSelfKeyword { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "const self") + } +} + +impl Node for ConstSelfKeyword { + fn span(&self) -> &Span { + &self.identifier.span + } + + fn set_span(&mut self, span: Span) { + self.identifier.span = span; + } +} diff --git a/ast/src/common/mod.rs b/ast/src/common/mod.rs index ad86f6ee2b..a5f8c8f9c4 100644 --- a/ast/src/common/mod.rs +++ b/ast/src/common/mod.rs @@ -17,6 +17,9 @@ pub mod array_dimensions; pub use array_dimensions::*; +pub mod const_self_keyword; +pub use const_self_keyword::*; + pub mod identifier; pub use identifier::*; diff --git a/ast/src/functions/input/input_variable.rs b/ast/src/functions/input/input_variable.rs index 5ec9306aeb..fda2c11ab8 100644 --- a/ast/src/functions/input/input_variable.rs +++ b/ast/src/functions/input/input_variable.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{FunctionInputVariable, InputKeyword, MutSelfKeyword, Node, SelfKeyword, Span}; +use crate::{ConstSelfKeyword, FunctionInputVariable, InputKeyword, MutSelfKeyword, Node, SelfKeyword, Span}; use serde::{Deserialize, Serialize}; use std::fmt; @@ -24,6 +24,7 @@ use std::fmt; pub enum FunctionInput { InputKeyword(InputKeyword), SelfKeyword(SelfKeyword), + ConstSelfKeyword(ConstSelfKeyword), MutSelfKeyword(MutSelfKeyword), Variable(FunctionInputVariable), } @@ -37,11 +38,26 @@ impl FunctionInput { match self { FunctionInput::InputKeyword(_) => false, FunctionInput::SelfKeyword(_) => true, + FunctionInput::ConstSelfKeyword(_) => true, FunctionInput::MutSelfKeyword(_) => true, FunctionInput::Variable(_) => false, } } + /// + /// Returns `true` if the function input is the `const self` keyword. + /// Returns `false` otherwise. + /// + pub fn is_const_self(&self) -> bool { + match self { + FunctionInput::InputKeyword(_) => false, + FunctionInput::SelfKeyword(_) => false, + FunctionInput::ConstSelfKeyword(_) => true, + FunctionInput::MutSelfKeyword(_) => false, + FunctionInput::Variable(_) => false, + } + } + /// /// Returns `true` if the function input is the `mut self` keyword. /// Returns `false` otherwise. @@ -50,6 +66,7 @@ impl FunctionInput { match self { FunctionInput::InputKeyword(_) => false, FunctionInput::SelfKeyword(_) => false, + FunctionInput::ConstSelfKeyword(_) => false, FunctionInput::MutSelfKeyword(_) => true, FunctionInput::Variable(_) => false, } @@ -59,6 +76,7 @@ impl FunctionInput { match self { FunctionInput::InputKeyword(keyword) => write!(f, "{}", keyword), FunctionInput::SelfKeyword(keyword) => write!(f, "{}", keyword), + FunctionInput::ConstSelfKeyword(keyword) => write!(f, "{}", keyword), FunctionInput::MutSelfKeyword(keyword) => write!(f, "{}", keyword), FunctionInput::Variable(function_input) => write!(f, "{}", function_input), } @@ -83,6 +101,7 @@ impl PartialEq for FunctionInput { match (self, other) { (FunctionInput::InputKeyword(_), FunctionInput::InputKeyword(_)) => true, (FunctionInput::SelfKeyword(_), FunctionInput::SelfKeyword(_)) => true, + (FunctionInput::ConstSelfKeyword(_), FunctionInput::ConstSelfKeyword(_)) => true, (FunctionInput::MutSelfKeyword(_), FunctionInput::MutSelfKeyword(_)) => true, (FunctionInput::Variable(left), FunctionInput::Variable(right)) => left.eq(right), _ => false, @@ -98,6 +117,7 @@ impl Node for FunctionInput { match self { InputKeyword(keyword) => &keyword.identifier.span, SelfKeyword(keyword) => &keyword.identifier.span, + ConstSelfKeyword(keyword) => &keyword.identifier.span, MutSelfKeyword(keyword) => &keyword.identifier.span, Variable(variable) => &variable.span, } @@ -108,6 +128,7 @@ impl Node for FunctionInput { match self { InputKeyword(keyword) => keyword.identifier.span = span, SelfKeyword(keyword) => keyword.identifier.span = span, + ConstSelfKeyword(keyword) => keyword.identifier.span = span, MutSelfKeyword(keyword) => keyword.identifier.span = span, Variable(variable) => variable.span = span, } diff --git a/compiler/src/function/main_function.rs b/compiler/src/function/main_function.rs index 8a77d3fd21..865f7a9fba 100644 --- a/compiler/src/function/main_function.rs +++ b/compiler/src/function/main_function.rs @@ -49,7 +49,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } match function.qualifier { - FunctionQualifier::SelfRef | FunctionQualifier::MutSelfRef => { + FunctionQualifier::SelfRef | FunctionQualifier::ConstSelfRef | FunctionQualifier::MutSelfRef => { unimplemented!("cannot access self variable in main function") } FunctionQualifier::Static => (), diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index a298095a26..acd48729f9 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -334,6 +334,7 @@ impl ParserContext { } else if let Some(const_) = &const_ { name.span = &const_.span + &name.span; name.name = "const self".to_string(); + return Ok(FunctionInput::ConstSelfKeyword(ConstSelfKeyword { identifier: name })); } return Ok(FunctionInput::SelfKeyword(SelfKeyword { identifier: name })); } @@ -347,8 +348,8 @@ impl ParserContext { self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable { - const_: const_.is_some() || (const_.is_none() && mutable.is_none()), - mutable: mutable.is_some(), + const_: const_.is_some(), + mutable: const_.is_none(), type_, span: name.span.clone(), identifier: name, From 341a5290e3c6e87d650bd4dde99301e2bf16a276 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 24 Mar 2021 20:36:22 -0400 Subject: [PATCH 06/10] Delete HEAD --- HEAD | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 HEAD diff --git a/HEAD b/HEAD deleted file mode 100644 index e69de29bb2..0000000000 From afc42bcecdcb1449bed4f3c0911e2188b96dcebd Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 25 Mar 2021 11:31:08 -0400 Subject: [PATCH 07/10] perdeshen-hash Forgot to save after resolving merge conflict. --- examples/pedersen-hash/src/main.leo | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/pedersen-hash/src/main.leo b/examples/pedersen-hash/src/main.leo index 5f5a650006..84670cd6c2 100644 --- a/examples/pedersen-hash/src/main.leo +++ b/examples/pedersen-hash/src/main.leo @@ -19,11 +19,7 @@ circuit PedersenHash { // The 'pedersen-hash' main function. function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group { -<<<<<<< HEAD const pedersen = PedersenHash::new(parameters); -======= - let pedersen = PedersenHash::new(parameters); ->>>>>>> 9b61d0fa152f435e3e165090455c85eedeb9b770 return pedersen.hash(hash_input) } From 793cbb9f27d8bd2154b45f7445b8e504f1d39eb6 Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 25 Mar 2021 14:30:06 -0400 Subject: [PATCH 08/10] add test for const self, no clippy issues locally --- .../tests/circuits/const_self_variable_fail.leo | 13 +++++++++++++ compiler/tests/circuits/mod.rs | 9 +++++++++ examples/pedersen-hash/src/main.leo | 4 ---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 compiler/tests/circuits/const_self_variable_fail.leo diff --git a/compiler/tests/circuits/const_self_variable_fail.leo b/compiler/tests/circuits/const_self_variable_fail.leo new file mode 100644 index 0000000000..fca9620946 --- /dev/null +++ b/compiler/tests/circuits/const_self_variable_fail.leo @@ -0,0 +1,13 @@ +circuit Foo { + a: u8, + + function set_a(const self, new: u8) { + self.a = new; + } +} + +function main() { + let f = Foo { a: 0u8 }; + + f.set_a(1u8); +} \ No newline at end of file diff --git a/compiler/tests/circuits/mod.rs b/compiler/tests/circuits/mod.rs index 3fe4b54955..77d8801e4b 100644 --- a/compiler/tests/circuits/mod.rs +++ b/compiler/tests/circuits/mod.rs @@ -132,6 +132,15 @@ fn test_member_static_function_undefined() { expect_asg_error(error) } +// Constant +#[test] +fn test_const_self_variable_fail() { + let program_string = include_str!("const_self_variable_fail.leo"); + let error = parse_program(program_string).err().unwrap(); + + expect_asg_error(error); +} + // Mutability #[test] diff --git a/examples/pedersen-hash/src/main.leo b/examples/pedersen-hash/src/main.leo index 5f5a650006..84670cd6c2 100644 --- a/examples/pedersen-hash/src/main.leo +++ b/examples/pedersen-hash/src/main.leo @@ -19,11 +19,7 @@ circuit PedersenHash { // The 'pedersen-hash' main function. function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group { -<<<<<<< HEAD const pedersen = PedersenHash::new(parameters); -======= - let pedersen = PedersenHash::new(parameters); ->>>>>>> 9b61d0fa152f435e3e165090455c85eedeb9b770 return pedersen.hash(hash_input) } From c78ab699b812777e99aa527450b43ea440211b4b Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 25 Mar 2021 16:52:43 -0400 Subject: [PATCH 09/10] another test --- compiler/tests/circuits/const_self_variable.leo | 13 +++++++++++++ compiler/tests/circuits/mod.rs | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 compiler/tests/circuits/const_self_variable.leo diff --git a/compiler/tests/circuits/const_self_variable.leo b/compiler/tests/circuits/const_self_variable.leo new file mode 100644 index 0000000000..ebcc3076ae --- /dev/null +++ b/compiler/tests/circuits/const_self_variable.leo @@ -0,0 +1,13 @@ +circuit Foo { + a: u8, + + function use_a(const self) -> u8 { + return self.a + 1 + } +} + +function main() { + let f = Foo { a: 0u8 }; + + console.assert(1u8 == f.use_a()); +} \ No newline at end of file diff --git a/compiler/tests/circuits/mod.rs b/compiler/tests/circuits/mod.rs index 77d8801e4b..9395853529 100644 --- a/compiler/tests/circuits/mod.rs +++ b/compiler/tests/circuits/mod.rs @@ -133,6 +133,14 @@ fn test_member_static_function_undefined() { } // Constant +#[test] +fn test_const_self_variable() { + let program_string = include_str!("const_self_variable.leo"); + let program = parse_program(program_string).unwrap(); + + assert_satisfied(program); +} + #[test] fn test_const_self_variable_fail() { let program_string = include_str!("const_self_variable_fail.leo"); From dcc2844a508a41ee4b027fb3c9a18acf8b76c3c2 Mon Sep 17 00:00:00 2001 From: collin Date: Thu, 25 Mar 2021 22:52:58 -0700 Subject: [PATCH 10/10] fix canonicalization test --- compiler/tests/canonicalization/compound_assignment.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests/canonicalization/compound_assignment.leo b/compiler/tests/canonicalization/compound_assignment.leo index f17d8762ff..95c810a7d5 100644 --- a/compiler/tests/canonicalization/compound_assignment.leo +++ b/compiler/tests/canonicalization/compound_assignment.leo @@ -1,4 +1,4 @@ function main() { - let mut x = 10u32; + let x = 10u32; x += 20; } \ No newline at end of file