diff --git a/src/parser.rs b/src/parser.rs index cf1f58e..f536b2f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -690,14 +690,22 @@ impl<'t> Parse<'t> for Bind { p.consume().parse(PPrec::Max)?, vec![p.parse(Prec::Body.next())?], )), - BindKind::Fn => Ok(Self( - level, - p.consume().parse(PPrec::Fn)?, - vec![p.parse(Prec::Body.next())?], - )), + BindKind::Fn => { + if p.consume().next_if(TKind::Lt)?.is_ok() { + let _gty: Vec = p.list(vec![], (), TKind::Comma, TKind::Gt)?; + } + Ok(Self( + level, + p.parse(PPrec::Fn)?, + vec![p.parse(Prec::Body.next())?], + )) + } _ => { + if p.consume().next_if(TKind::Lt)?.is_ok() { + let _gty: Vec = p.list(vec![], (), TKind::Comma, TKind::Gt)?; + } // let Pat - let pat = p.consume().parse(PPrec::Tuple)?; + let pat = p.parse(PPrec::Tuple)?; if p.next_if(TKind::Eq).allow_eof()?.is_none_or(|v| v.is_err()) { return Ok(Self(level, pat, vec![])); }