mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
feat: support var-args lambda function
This commit is contained in:
parent
cb00efca54
commit
3d310714f1
13 changed files with 123 additions and 47 deletions
|
@ -1703,6 +1703,15 @@ impl Parser {
|
|||
debug_exit_info!(self);
|
||||
Ok(call_or_acc)
|
||||
}
|
||||
Some(t) if t.is(PreStar) => {
|
||||
let _ = self.lpop();
|
||||
let expr = self.try_reduce_expr(false, in_type_args, in_brace, false)?;
|
||||
let tuple = self
|
||||
.try_reduce_nonempty_tuple(ArgKind::Var(PosArg::new(expr)), false)
|
||||
.map_err(|_| self.stack_dec(fn_name!()))?;
|
||||
debug_exit_info!(self);
|
||||
Ok(Expr::Tuple(tuple))
|
||||
}
|
||||
Some(t) if t.category_is(TC::UnaryOp) => {
|
||||
let unaryop = self
|
||||
.try_reduce_unary()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue