diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-06 14:59:19 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-06 14:59:27 +0200 |
commit | 47df34c0f000429511fda7982e3ef1b4cd2d4569 (patch) | |
tree | 327d5348e63cedec415b726a850db45ccce67f94 /askama_derive/src/parser.rs | |
parent | 077c56c00782ff826e46258f678ef0f163f4e3cb (diff) | |
download | askama-47df34c0f000429511fda7982e3ef1b4cd2d4569.tar.gz askama-47df34c0f000429511fda7982e3ef1b4cd2d4569.tar.bz2 askama-47df34c0f000429511fda7982e3ef1b4cd2d4569.zip |
Expand include node to template source during code generation
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/parser.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/askama_derive/src/parser.rs b/askama_derive/src/parser.rs index 767371b..b07d8eb 100644 --- a/askama_derive/src/parser.rs +++ b/askama_derive/src/parser.rs @@ -1,6 +1,4 @@ use nom::{self, IResult}; -use path; -use std::path::Path; use std::str; #[derive(Debug)] @@ -33,7 +31,7 @@ pub enum Node<'a> { Extends(Expr<'a>), BlockDef(WS, &'a str, Vec<Node<'a>>, WS), Block(WS, &'a str, WS), - Include(WS, String), + Include(WS, &'a str), } pub type Cond<'a> = (WS, Option<Expr<'a>>, Vec<Node<'a>>); @@ -325,7 +323,7 @@ named!(block_include<Node>, do_parse!( name: ws!(expr_str_lit) >> nws: opt!(tag_s!("-")) >> (Node::Include(WS(pws.is_some(), nws.is_some()), match name { - Expr::StrLit(s) => path::get_template_source(Path::new(s)), + Expr::StrLit(s) => s, _ => panic!("include path must be a string literal"), })) )); |