1
0

Implement structures

This commit is contained in:
Jeff 2024-01-04 21:12:45 -05:00
parent 84cb17e75c
commit 2a7988f9a6
2 changed files with 5 additions and 8 deletions

View File

@ -1,11 +1,11 @@
dictionary = { Info = struct {
dust = "awesome" dust = "awesome"
answer = 42 answer = 42
} }
output( output(
'Dust is ' 'Dust is '
+ dictionary:dust + Info:dust
+ '! The answer is ' + '! The answer is '
+ dictionary:answer + Info:answer
) )

View File

@ -51,17 +51,14 @@ impl AbstractTree for FunctionCall {
let get_type = variables.get(identifier.inner()); let get_type = variables.get(identifier.inner());
if let Some((_, r#type)) = get_type { if let Some((_, r#type)) = get_type {
r#type r#type.clone()
} else { } else {
return Err(Error::FunctionIdentifierNotFound( return Err(Error::FunctionIdentifierNotFound(
identifier.inner().clone(), identifier.inner().clone(),
)); ));
} }
} }
FunctionExpression::FunctionCall(_) => todo!(), function_expression => function_expression.expected_type(context)?,
FunctionExpression::Value(_) => todo!(),
FunctionExpression::Index(_) => todo!(),
FunctionExpression::Yield(_) => todo!(),
}; };
let parameter_types = if let Type::Function { let parameter_types = if let Type::Function {
parameter_types, .. parameter_types, ..