Clean up
This commit is contained in:
parent
7642b23553
commit
1ae9dd67a7
@ -40,7 +40,7 @@ impl AbstractTree for FunctionExpression {
|
||||
}
|
||||
_ => {
|
||||
return Err(Error::UnexpectedSyntaxNode {
|
||||
expected: "identifier, function call, value or index".to_string(),
|
||||
expected: "identifier, function call, value, index or yield".to_string(),
|
||||
actual: child.kind().to_string(),
|
||||
location: child.start_position(),
|
||||
relevant_source: source[child.byte_range()].to_string(),
|
||||
|
@ -112,6 +112,8 @@ impl AbstractTree for FunctionNode {
|
||||
let r#type = Type::function(parameter_types, return_type.take_inner());
|
||||
let syntax_position = node.range().into();
|
||||
|
||||
println!("{context}");
|
||||
|
||||
Ok(FunctionNode {
|
||||
parameters,
|
||||
body,
|
||||
|
@ -50,6 +50,8 @@ impl AbstractTree for Identifier {
|
||||
|
||||
fn expected_type(&self, context: &Map) -> Result<Type> {
|
||||
if let Some((_value, r#type)) = context.variables()?.get(&self.0) {
|
||||
println!("{_value} {}", r#type);
|
||||
|
||||
Ok(r#type.clone())
|
||||
} else {
|
||||
Err(Error::VariableIdentifierNotFound(self.0.clone()))
|
||||
|
@ -157,10 +157,10 @@ pub enum Error {
|
||||
actual: Value,
|
||||
},
|
||||
|
||||
/// A `VariableIdentifier` operation did not find its value in the context.
|
||||
/// Failed to find a variable with a value for this key.
|
||||
VariableIdentifierNotFound(String),
|
||||
|
||||
/// A `FunctionIdentifier` operation did not find its value in the context.
|
||||
/// Failed to find a variable with a function value for this key.
|
||||
FunctionIdentifierNotFound(String),
|
||||
|
||||
/// The function failed due to an external error.
|
||||
|
Loading…
Reference in New Issue
Block a user