Implement function calls
This commit is contained in:
parent
31e9cb61bb
commit
90352dd264
@ -61,6 +61,12 @@ impl AbstractTree for FunctionCall {
|
|||||||
results.push(result);
|
results.push(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for identifier in definition.identifiers() {
|
||||||
|
let key = identifier.inner();
|
||||||
|
|
||||||
|
context.remove(&key);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Value::List(results))
|
Ok(Value::List(results))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,6 @@ impl<'context, 'code> Evaluator<'context, 'code> {
|
|||||||
let item_count = root_node.child_count();
|
let item_count = root_node.child_count();
|
||||||
let mut results = Vec::with_capacity(item_count);
|
let mut results = Vec::with_capacity(item_count);
|
||||||
|
|
||||||
println!("{}", root_node.to_sexp());
|
|
||||||
|
|
||||||
for item_node in root_node.children(&mut cursor) {
|
for item_node in root_node.children(&mut cursor) {
|
||||||
let item_result = Item::from_syntax_node(item_node, self.source);
|
let item_result = Item::from_syntax_node(item_node, self.source);
|
||||||
|
|
||||||
|
@ -108,6 +108,13 @@ impl VariableMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Removes and assignmed variable.
|
||||||
|
///
|
||||||
|
/// TODO: Support dot notation.
|
||||||
|
pub fn remove(&mut self, key: &str) -> Option<Value> {
|
||||||
|
self.variables.remove(key)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a reference to the inner BTreeMap.
|
/// Returns a reference to the inner BTreeMap.
|
||||||
pub fn inner(&self) -> &BTreeMap<String, Value> {
|
pub fn inner(&self) -> &BTreeMap<String, Value> {
|
||||||
&self.variables
|
&self.variables
|
||||||
|
Loading…
Reference in New Issue
Block a user