From da7537344b20bf721979e66c05682bf6370c29f4 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Tue, 4 Apr 2023 15:41:02 -0700 Subject: [PATCH] Rename Mapping::put to Mapping::set --- compiler/ast/src/functions/core_function.rs | 6 +++--- .../src/dead_code_elimination/eliminate_expression.rs | 2 +- compiler/passes/src/type_checking/checker.rs | 2 +- compiler/span/src/symbol.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/ast/src/functions/core_function.rs b/compiler/ast/src/functions/core_function.rs index 115ff2e7ee..b7bcb371f0 100644 --- a/compiler/ast/src/functions/core_function.rs +++ b/compiler/ast/src/functions/core_function.rs @@ -39,7 +39,7 @@ pub enum CoreFunction { MappingGet, MappingGetOr, - MappingPut, + MappingSet, } impl CoreFunction { @@ -66,7 +66,7 @@ impl CoreFunction { (sym::Mapping, sym::get) => Self::MappingGet, (sym::Mapping, sym::get_or) => Self::MappingGetOr, - (sym::Mapping, sym::put) => Self::MappingPut, + (sym::Mapping, sym::set) => Self::MappingSet, _ => return None, }) } @@ -94,7 +94,7 @@ impl CoreFunction { Self::MappingGet => 2, Self::MappingGetOr => 3, - Self::MappingPut => 3, + Self::MappingSet => 3, } } } diff --git a/compiler/passes/src/dead_code_elimination/eliminate_expression.rs b/compiler/passes/src/dead_code_elimination/eliminate_expression.rs index eaa8389fd3..475bd69b4c 100644 --- a/compiler/passes/src/dead_code_elimination/eliminate_expression.rs +++ b/compiler/passes/src/dead_code_elimination/eliminate_expression.rs @@ -42,7 +42,7 @@ impl ExpressionReconstructor for DeadCodeEliminator { match (&function.ty, function.name.name) { (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::get) | (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::get_or) - | (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::put) => { + | (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::set) => { self.is_necessary = true; } _ => {} diff --git a/compiler/passes/src/type_checking/checker.rs b/compiler/passes/src/type_checking/checker.rs index 7740a31517..d91ceb737d 100644 --- a/compiler/passes/src/type_checking/checker.rs +++ b/compiler/passes/src/type_checking/checker.rs @@ -468,7 +468,7 @@ impl<'a> TypeChecker<'a> { None } } - CoreFunction::MappingPut => { + CoreFunction::MappingSet => { // Check that the operation is invoked in a `finalize` block. if !self.is_finalize { self.handler diff --git a/compiler/span/src/symbol.rs b/compiler/span/src/symbol.rs index 8662488f95..c00943c174 100644 --- a/compiler/span/src/symbol.rs +++ b/compiler/span/src/symbol.rs @@ -150,13 +150,13 @@ symbols! { get, get_or, hash, - put, Mapping, Pedersen64, Pedersen128, Poseidon2, Poseidon4, Poseidon8, + set, // types address,