mirror of
https://github.com/rm-dr/daisy
synced 2025-07-03 17:19:41 -07:00
Added tuples
This commit is contained in:
@ -32,6 +32,15 @@ pub fn eval_function(g: &Expression) -> Result<Expression, (LineLocation, EvalEr
|
||||
|
||||
if args.len() != 1 {panic!()};
|
||||
let a = &args[0];
|
||||
|
||||
// All the functions below take only one argument
|
||||
if let Expression::Tuple(l, v) = a {
|
||||
return Err((
|
||||
*l + *loc,
|
||||
EvalError::BadArguments(f.to_string(), 1, v.len())
|
||||
))
|
||||
};
|
||||
|
||||
let Expression::Quantity(l, q) = a else {panic!()};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user