Functions can take mulitple args.

This commit is contained in:
Richard Feldman 2019-05-25 22:39:43 -04:00
parent 298716a925
commit 1819b9955f
4 changed files with 86 additions and 52 deletions

View file

@ -12,8 +12,8 @@ pub enum Expr {
Let(Pattern, Box<Expr>, Box<Expr>),
// Functions
Func(String, Box<Expr>),
Apply(Box<(Expr, Expr)>),
Func(String, Vec<Expr>),
Apply(Box<Expr>, Vec<Expr>),
Operator(Box<Expr>, Operator, Box<Expr>),
Closure(Vec<Pattern>, Box<Expr>),
@ -26,6 +26,7 @@ pub enum Problem {
UnrecognizedVarName(String),
TypeMismatch(String),
ReassignedVarName(String),
WrongArity(u32 /* Expected */, u32 /* Provided */),
}