aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser
diff options
context:
space:
mode:
authorLibravatar Guillaume Gomez <guillaume1.gomez@gmail.com>2023-12-06 17:20:53 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-12-07 11:03:26 +0100
commite4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6 (patch)
treeb61c656c5ba74bae82ccfdc51f22a01f35c28120 /askama_parser
parent7f30a657f6530b4422eedb26977ab5b831a48bd8 (diff)
downloadaskama-e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6.tar.gz
askama-e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6.tar.bz2
askama-e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6.zip
Allow trailing comma in macro definition and call
Diffstat (limited to 'askama_parser')
-rw-r--r--askama_parser/src/expr.rs2
-rw-r--r--askama_parser/src/node.rs2
2 files changed, 2 insertions, 2 deletions
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)
}