diff options
author | René Kijewski <rene.kijewski@fu-berlin.de> | 2023-07-31 20:54:47 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-07-31 21:29:35 +0200 |
commit | 107bdfdd7658919691948f629adf2254cd6aa367 (patch) | |
tree | 7d28e7b08e7bf30bc9298fdc1466476624ca50ac /askama_parser/src/expr.rs | |
parent | 18b6d2f38ac51dfa3207c4d509567cd0db937274 (diff) | |
download | askama-107bdfdd7658919691948f629adf2254cd6aa367.tar.gz askama-107bdfdd7658919691948f629adf2254cd6aa367.tar.bz2 askama-107bdfdd7658919691948f629adf2254cd6aa367.zip |
Fix parsing calls
This change:
* adds a cut when the leading `(` was encountered, and
* fixed the interaction between call expressions and boolean OR.
Diffstat (limited to '')
-rw-r--r-- | askama_parser/src/expr.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/askama_parser/src/expr.rs b/askama_parser/src/expr.rs index ef5c5e2..ab7caff 100644 --- a/askama_parser/src/expr.rs +++ b/askama_parser/src/expr.rs @@ -68,10 +68,12 @@ pub enum Expr<'a> { impl<'a> Expr<'a> { pub(super) fn arguments(i: &'a str) -> IResult<&'a str, Vec<Self>> { - delimited( + preceded( ws(char('(')), - separated_list0(char(','), ws(Self::parse)), - ws(char(')')), + cut(terminated( + separated_list0(char(','), ws(Self::parse)), + char(')'), + )), )(i) } |