Skip to content
Snippets Groups Projects
Commit 7eb839b7 authored by Aaron Councilman's avatar Aaron Councilman
Browse files

Allow dangling commas in argument lists

parent de78461b
No related branches found
No related tags found
1 merge request!127Allow dangling commas in argument lists
Pipeline #201199 passed
...@@ -174,13 +174,12 @@ FuncDecl -> Result<Top, ()> ...@@ -174,13 +174,12 @@ FuncDecl -> Result<Top, ()>
body : $11? }) } body : $11? }) }
; ;
Arguments -> Result<Vec<(Option<Span>, VarBind)>, ()> Arguments -> Result<Vec<(Option<Span>, VarBind)>, ()>
: { Ok(vec![]) } : ArgumentsList { Ok($1?.into_iter().collect()) }
| ArgBind { Ok(vec![$1?]) }
| ArgumentsS ',' ArgBind { flatten($1, $3) }
; ;
ArgumentsS -> Result<Vec<(Option<Span>, VarBind)>, ()> ArgumentsList -> Result<VecDeque<(Option<Span>, VarBind)>, ()>
: ArgBind { Ok(vec![$1?]) } : { Ok(VecDeque::new()) }
| ArgumentsS ',' ArgBind { flatten($1, $3) } | ArgBind { Ok(VecDeque::from([$1?])) }
| ArgBind ',' ArgumentsList { let mut lst = $3?; lst.push_front($1?); Ok(lst) }
; ;
ArgBind -> Result<(Option<Span>, VarBind), ()> ArgBind -> Result<(Option<Span>, VarBind), ()>
: 'inout' VarBind { Ok((Some(span_of_tok($1)?), $2?)) } : 'inout' VarBind { Ok((Some(span_of_tok($1)?), $2?)) }
......
...@@ -206,8 +206,8 @@ fn cava<r, c, num_ctrl_pts : usize>( ...@@ -206,8 +206,8 @@ fn cava<r, c, num_ctrl_pts : usize>(
ctrl_pts : f32[num_ctrl_pts, CHAN], ctrl_pts : f32[num_ctrl_pts, CHAN],
weights : f32[num_ctrl_pts, CHAN], weights : f32[num_ctrl_pts, CHAN],
coefs : f32[4, CHAN], coefs : f32[4, CHAN],
tonemap : f32[256, CHAN]) tonemap : f32[256, CHAN],
-> u8[CHAN, r, c] { ) -> u8[CHAN, r, c] {
let scaled = scale::<r, c>(input); let scaled = scale::<r, c>(input);
let demosc = demosaic::<r, c>(scaled); let demosc = demosaic::<r, c>(scaled);
let denosd = denoise::<r, c>(demosc); let denosd = denoise::<r, c>(demosc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment