Skip to content

Commit

Permalink
reassignement of values
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-extracts committed Nov 29, 2024
1 parent 1d70689 commit 837f864
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/interpreting/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,18 @@ pub fn interpret(
}
}
_ => {
let (a, b) = assign(param1.clone(), param2.clone());
let p1 = match *l.clone() {
Ast::Node { value, left, right } => {
match (value.clone(), *left, *right) {
(Parameters::Identifier(_), Ast::Nil, Ast::Nil) => {
value.clone()
}
_ => Parameters::Null,
}
}
_ => Parameters::Null,
};
let (a, b) = assign(p1, param2.clone());
if a != "".to_string() {
if ram.contains_key(&a) {
ram.remove(&a);
Expand Down

0 comments on commit 837f864

Please sign in to comment.