Fix identifier bug
This commit is contained in:
parent
ab149ce010
commit
4e861620ce
@ -37,10 +37,12 @@ impl AbstractTree for Identifier {
|
|||||||
|
|
||||||
fn run(&self, _source: &str, context: &Map) -> Result<Value> {
|
fn run(&self, _source: &str, context: &Map) -> Result<Value> {
|
||||||
if let Some((value, _)) = context.variables()?.get(&self.0) {
|
if let Some((value, _)) = context.variables()?.get(&self.0) {
|
||||||
Ok(value.clone())
|
if !value.is_none() {
|
||||||
} else {
|
return Ok(value.clone());
|
||||||
Err(Error::VariableIdentifierNotFound(self.inner().clone()))
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Err(Error::VariableIdentifierNotFound(self.0.clone()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expected_type(&self, context: &Map) -> Result<Type> {
|
fn expected_type(&self, context: &Map) -> Result<Type> {
|
||||||
|
Loading…
Reference in New Issue
Block a user