(&mut self, name: String, value: Option<RuntimeValue>)
| 128 | } |
| 129 | |
| 130 | fn update_variable(&mut self, name: String, value: Option<RuntimeValue>) { |
| 131 | for i in 0..self.variables.len() { |
| 132 | // If find a varialbe, remove the old entry and add new entry. |
| 133 | if self.variables[i].0 == name { |
| 134 | self.variables.remove(i); |
| 135 | self.variables.push((name, value)); |
| 136 | return; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | #[derive(Debug, Clone, PartialEq, Eq)] |