From 35cf03cf794b515afdb24a989e07b6acd0e2fc19 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Wed, 25 Aug 2021 02:00:41 +0200 Subject: Parse boolean literals in assignment targets 268d825 introduced a regression that made matching against boolean literals impossible. E.g. "true" was interpreted as the variable "r#true". This PR fixes the problem. The bug was reported by @Restioson in issue #531. --- askama_shared/src/generator.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'askama_shared/src/generator.rs') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index dccda93..ec468e5 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -1484,6 +1484,12 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { } self.visit_char_lit(buf, s); } + Target::BoolLit(s) => { + if first_level { + buf.write("&"); + } + buf.write(s); + } } } -- cgit