From c3e9ede0ef16a164dd20688ed92248ea11094444 Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Thu, 17 Feb 2022 21:41:41 +0700 Subject: [PATCH] :scream: no comma in args call!? --- example/ex.hyc | 2 +- let.cmi | Bin 0 -> 179 bytes let.cmo | Bin 0 -> 214 bytes src/front/parse.rs | 4 +--- 4 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 let.cmi create mode 100644 let.cmo diff --git a/example/ex.hyc b/example/ex.hyc index b6302eb..538e40d 100644 --- a/example/ex.hyc +++ b/example/ex.hyc @@ -1,5 +1,5 @@ fun foo a b = a * b; -let bar = foo(3, 3); +let bar = foo( 3 3 ); if bar == 9 then do diff --git a/let.cmi b/let.cmi new file mode 100644 index 0000000000000000000000000000000000000000..c0666243f6482e7ca46e1ec02134bf441e3fbe22 GIT binary patch literal 179 zcmZ=x%*`>hw6ydzFg9qJx@;c<0|OfnGXXIx2rp3fNiA`J$|M3s_<`6Qh;&!6hjD CF+Mo} literal 0 HcmV?d00001 diff --git a/let.cmo b/let.cmo new file mode 100644 index 0000000000000000000000000000000000000000..738f282397dc0f6d58f585c70c848082fe5f83bf GIT binary patch literal 214 zcmZ=x%*`>hw6yd$Fg9RdV6aI65}8130mLAn4aAB-EDXeqKx_rXmOu;wEmN2615#~3 zECs|dKpe=yz@WjP?2}p&kh5UH#7SzwB`G_gY2?j^DHZNCyqw#gm?8RAkQqCWDSimCc00IEXDnlax literal 0 HcmV?d00001 diff --git a/src/front/parse.rs b/src/front/parse.rs index a39a9bb..23308df 100644 --- a/src/front/parse.rs +++ b/src/front/parse.rs @@ -149,9 +149,7 @@ fn expr_parser() -> impl Parser> + Clone { }).labelled("literal"); let args = expr.clone() - .chain(just(Token::Comma) - .ignore_then(expr.clone()).repeated()) - .then_ignore(just(Token::Comma).or_not()) + .repeated() .or_not() .map(|item| item.unwrap_or_else(Vec::new));