mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
FEATURE: Allow trailing commas in map, filter, and reduce expressions.
This commit is contained in:
parent
2134d79f0d
commit
00cc246903
@ -563,6 +563,7 @@ fn call_expression(input: SliceIter<Token>) -> Result<SliceIter<Token>, Expressi
|
||||
callee_name => trace_parse!(symbol),
|
||||
_ => punct!("("),
|
||||
args => optional!(separated!(punct!(","), trace_parse!(expression))),
|
||||
_ => optional!(punct!(",")),
|
||||
_ => must!(punct!(")")),
|
||||
(callee_name, args)
|
||||
);
|
||||
@ -592,6 +593,7 @@ make_fn!(
|
||||
acc => must!(trace_parse!(expression)),
|
||||
_ => must!(punct!(",")),
|
||||
tgt => must!(trace_parse!(expression)),
|
||||
_ => optional!(punct!(",")),
|
||||
_ => must!(punct!(")")),
|
||||
(Expression::FuncOp(FuncOpDef::Reduce(ReduceOpDef{
|
||||
func: Box::new(func),
|
||||
@ -611,6 +613,7 @@ make_fn!(
|
||||
func => must!(expression),
|
||||
_ => must!(punct!(",")),
|
||||
list => must!(trace_parse!(expression)),
|
||||
_ => optional!(punct!(",")),
|
||||
_ => must!(punct!(")")),
|
||||
(Expression::FuncOp(FuncOpDef::Map(MapFilterOpDef{
|
||||
func: Box::new(func),
|
||||
@ -629,6 +632,7 @@ make_fn!(
|
||||
func => must!(expression),
|
||||
_ => must!(punct!(",")),
|
||||
list => must!(trace_parse!(expression)),
|
||||
_ => optional!(punct!(",")),
|
||||
_ => must!(punct!(")")),
|
||||
(Expression::FuncOp(FuncOpDef::Filter(MapFilterOpDef{
|
||||
func: Box::new(func),
|
||||
|
Loading…
x
Reference in New Issue
Block a user