diff --git a/src/abstract_tree/function_call.rs b/src/abstract_tree/function_call.rs index 548421f..c59c163 100644 --- a/src/abstract_tree/function_call.rs +++ b/src/abstract_tree/function_call.rs @@ -48,7 +48,7 @@ impl AbstractTree for FunctionCall { arguments.push(value); } - let function_context = Context::with_data_from(context)?; + let function_context = Context::inherit_data_from(context)?; function.call(arguments, function_context) } diff --git a/src/abstract_tree/value_node.rs b/src/abstract_tree/value_node.rs index 8ddb0b6..98b2ea4 100644 --- a/src/abstract_tree/value_node.rs +++ b/src/abstract_tree/value_node.rs @@ -78,7 +78,7 @@ impl AbstractTree for ValueNode { body, } = self { - let function_context = Context::with_types_from(context)?; + let function_context = Context::inherit_types_from(context)?; for (identifier, r#type) in parameters { function_context.set_type(identifier.clone(), r#type.clone())?; diff --git a/src/context.rs b/src/context.rs index 3bbccb3..fe97c4f 100644 --- a/src/context.rs +++ b/src/context.rs @@ -33,7 +33,7 @@ impl Context { } } - pub fn with_types_from(other: &Context) -> Result { + pub fn inherit_types_from(other: &Context) -> Result { let mut new_data = BTreeMap::new(); for (identifier, value_data) in other.inner.read()?.iter() { @@ -47,7 +47,7 @@ impl Context { Ok(Self::with_data(new_data)) } - pub fn with_data_from(other: &Context) -> Result { + pub fn inherit_data_from(other: &Context) -> Result { let mut new_data = BTreeMap::new(); for (identifier, value_data) in other.inner.read()?.iter() {