aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <rene.kijewski@fu-berlin.de>2023-08-01 11:30:06 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-08-01 13:04:41 +0200
commit4315773676527c94646315ac2a3475fd6eb2925a (patch)
treef9be7d81305bfc0210249db28c822b6df6ce25f8 /askama_derive/src/generator.rs
parent32cd2825c4e5be9d0f160f9d112a98dbba24b29d (diff)
downloadaskama-4315773676527c94646315ac2a3475fd6eb2925a.tar.gz
askama-4315773676527c94646315ac2a3475fd6eb2925a.tar.bz2
askama-4315773676527c94646315ac2a3475fd6eb2925a.zip
parser: add type for `Node::Comment`
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r--askama_derive/src/generator.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 6e04a1a..c736847 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -5,7 +5,7 @@ use crate::CompileError;
use parser::expr::Expr;
use parser::node::{
- Call, CondTest, If, Include, Let, Lit, Loop, Match, Node, Target, Whitespace, Ws,
+ Call, Comment, CondTest, If, Include, Let, Lit, Loop, Match, Node, Target, Whitespace, Ws,
};
use parser::Parsed;
use proc_macro::TokenStream;
@@ -633,8 +633,8 @@ impl<'a> Generator<'a> {
Node::Lit(ref lit) => {
self.visit_lit(lit);
}
- Node::Comment(ws) => {
- self.write_comment(ws);
+ Node::Comment(ref comment) => {
+ self.write_comment(comment);
}
Node::Expr(ws, ref val) => {
self.write_expr(ws, val);
@@ -1293,8 +1293,8 @@ impl<'a> Generator<'a> {
}
}
- fn write_comment(&mut self, ws: Ws) {
- self.handle_ws(ws);
+ fn write_comment(&mut self, comment: &'a Comment<'_>) {
+ self.handle_ws(comment.ws);
}
/* Visitor methods for expression types */