From dffab8ae94f75ef5e4c446903c3b7b8007f00400 Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 8 Aug 2015 17:58:51 -0700 Subject: [PATCH] Fixed arg list parsing --- Grammar | 1 + src/parser.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Grammar b/Grammar index 8cffe32..dcb8717 100644 --- a/Grammar +++ b/Grammar @@ -12,6 +12,7 @@ := fn ( ) end := e + | | , := if then end diff --git a/src/parser.rs b/src/parser.rs index 43d545c..961d741 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -147,7 +147,11 @@ fn argument_list(tokens: &mut Tokens) -> ParseResult { Some(&Identifier(ref s)) => { args.push(s.clone()); tokens.next(); - expect!(Comma, tokens); + if let Some(&Comma) = tokens.peek().map(|i| i.clone()) { + tokens.next(); + } else { + break; + } }, _ => break }