From 4bd302c68817fc78ff31594b1175a3b67cece171 Mon Sep 17 00:00:00 2001 From: bott Date: Fri, 5 Oct 2018 05:51:22 +0200 Subject: Add changing delimiters support --- askama_derive/src/generator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'askama_derive/src/generator.rs') diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 2a233d5..33fbe4c 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -1,6 +1,6 @@ use super::{get_template_source, Context, Heritage}; use input::TemplateInput; -use parser::{self, Cond, Expr, MatchParameter, MatchVariant, Node, Target, When, WS}; +use parser::{Cond, Expr, MatchParameter, MatchVariant, Node, Target, When, WS}; use shared::filters; use proc_macro2::Span; @@ -13,6 +13,8 @@ use std::{cmp, hash, str}; use syn; +use parser::parse; + pub(crate) fn generate( input: &TemplateInput, contexts: &HashMap<&PathBuf, Context>, @@ -482,7 +484,7 @@ impl<'a> Generator<'a> { .config .find_template(path, Some(&self.input.path)); let src = get_template_source(&path); - let nodes = parser::parse(&src); + let nodes = parse(&src, self.input.syntax); { // Since nodes must not outlive the Generator, we instantiate // a nested Generator here to handle the include's nodes. -- cgit