From e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 6 Dec 2023 17:20:53 +0100 Subject: Allow trailing comma in macro definition and call --- askama_parser/src/expr.rs | 2 +- askama_parser/src/node.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'askama_parser/src') diff --git a/askama_parser/src/expr.rs b/askama_parser/src/expr.rs index 2928b57..65a7835 100644 --- a/askama_parser/src/expr.rs +++ b/askama_parser/src/expr.rs @@ -119,7 +119,7 @@ impl<'a> Expr<'a> { } }), ), - char(')'), + tuple((opt(ws(char(','))), char(')'))), )), )(i) } diff --git a/askama_parser/src/node.rs b/askama_parser/src/node.rs index 27d4adc..c2f7b39 100644 --- a/askama_parser/src/node.rs +++ b/askama_parser/src/node.rs @@ -493,7 +493,7 @@ impl<'a> Macro<'a> { delimited( ws(char('(')), separated_list0(char(','), ws(identifier)), - ws(char(')')), + tuple((opt(ws(char(','))), char(')'))), )(i) } -- cgit