aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar Dave Poulter <hello@davepoulter.net>2019-10-08 11:17:38 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2019-10-08 11:36:19 +0200
commitc82db307b0456e2a901599516b14f0d92e9cc682 (patch)
tree4970f0824b6cc7ab452e22869329d22a183e4ec6 /askama_derive/src/generator.rs
parent66274b7c8ef2f47fe479013b9d408ac21a36472d (diff)
downloadaskama-c82db307b0456e2a901599516b14f0d92e9cc682.tar.gz
askama-c82db307b0456e2a901599516b14f0d92e9cc682.tar.bz2
askama-c82db307b0456e2a901599516b14f0d92e9cc682.zip
Add support for boolean literals
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 7757016..28b8246 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -865,6 +865,7 @@ impl<'a> Generator<'a> {
fn visit_expr(&mut self, buf: &mut Buffer, expr: &Expr) -> DisplayWrap {
match *expr {
+ Expr::BoolLit(s) => self.visit_bool_lit(buf, s),
Expr::NumLit(s) => self.visit_num_lit(buf, s),
Expr::StrLit(s) => self.visit_str_lit(buf, s),
Expr::Var(s) => self.visit_var(buf, s),
@@ -1127,6 +1128,11 @@ impl<'a> Generator<'a> {
DisplayWrap::Unwrapped
}
+ fn visit_bool_lit(&mut self, buf: &mut Buffer, s: &str) -> DisplayWrap {
+ buf.write(s);
+ DisplayWrap::Unwrapped
+ }
+
fn visit_str_lit(&mut self, buf: &mut Buffer, s: &str) -> DisplayWrap {
buf.write(&format!("\"{}\"", s));
DisplayWrap::Unwrapped