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 }