Skip to content

Commit

Permalink
Rename ImlValue::value() to ImlValue::into_refvalue()
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward committed Mar 19, 2023
1 parent 6f0d981 commit 9e4bb42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/compiler/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ fn traverse_node_lvalue(compiler: &mut Compiler, node: &Dict, store: bool, hold:

"capture_index" => {
let children = children.object::<Dict>().unwrap();
let index = traverse_node_value(compiler, children).value();
let index = traverse_node_value(compiler, children).into_refvalue();

if store {
if hold {
Expand Down Expand Up @@ -866,7 +866,8 @@ fn traverse_node(compiler: &mut Compiler, node: &Dict) -> ImlOp {

"capture_index" => {
let children = node["children"].borrow();
let index = traverse_node_value(compiler, children.object::<Dict>().unwrap()).value();
let index =
traverse_node_value(compiler, children.object::<Dict>().unwrap()).into_refvalue();
ImlOp::from(Op::LoadFastCapture(index.to_usize().unwrap()))
}

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/iml/imlvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(in crate::compiler) enum ImlValue {
}

impl ImlValue {
pub fn value(self) -> RefValue {
pub fn into_refvalue(self) -> RefValue {
if let Self::Value(value) = self {
value
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl Linker {

RefValue::from(parselet)
} else {
iml.value()
iml.into_refvalue()
}
})
.collect();
Expand Down

0 comments on commit 9e4bb42

Please sign in to comment.