Fix identifier bug
This commit is contained in:
parent
ab149ce010
commit
4e861620ce
@ -37,12 +37,14 @@ 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> {
|
||||||
if let Some((_value, r#type)) = context.variables()?.get(&self.0) {
|
if let Some((_value, r#type)) = context.variables()?.get(&self.0) {
|
||||||
Ok(r#type.clone())
|
Ok(r#type.clone())
|
||||||
|
Loading…
Reference in New Issue
Block a user