add noexec operator to pass named functions to functions

This commit is contained in:
2024-10-16 17:04:25 -04:00
parent d0661512c9
commit 329af77ff4
3 changed files with 23 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ pub(crate) enum ParseTree {
FunctionCall(String, Vec<ParseTree>),
Variable(String),
Constant(Value),
NonCall(String),
// Type Casts
IntCast(Box<ParseTree>),
@@ -257,7 +258,10 @@ impl ParseTree {
Ok(ParseTree::LambdaDefinition(f))
}
Op::NonCall => todo!(),
Op::NonCall => {
let name = Self::get_identifier(tokens.next())?;
Ok(ParseTree::NonCall(name))
},
op => Err(ParseError::UnwantedToken(Token::Operator(op))),
}
}