diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-01-07 20:33:29 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-01-07 20:33:29 +0100 |
commit | 5d193ce822fab739f889a70c1defa402ddea8eab (patch) | |
tree | d9ec0d8998ca9850d879809e66f8037bd3beed1e /askama_derive | |
parent | 9837efad983dd0de6439a8c9d59165df01adfe3f (diff) | |
download | askama-5d193ce822fab739f889a70c1defa402ddea8eab.tar.gz askama-5d193ce822fab739f889a70c1defa402ddea8eab.tar.bz2 askama-5d193ce822fab739f889a70c1defa402ddea8eab.zip |
Move parser and generator code into askama crate
Diffstat (limited to '')
-rw-r--r-- | askama/src/generator.rs (renamed from askama_derive/src/generator.rs) | 0 | ||||
-rw-r--r-- | askama/src/parser.rs (renamed from askama_derive/src/parser.rs) | 0 | ||||
-rw-r--r-- | askama_derive/Cargo.toml | 2 | ||||
-rw-r--r-- | askama_derive/src/lib.rs | 10 |
4 files changed, 4 insertions, 8 deletions
diff --git a/askama_derive/src/generator.rs b/askama/src/generator.rs index 0e80265..0e80265 100644 --- a/askama_derive/src/generator.rs +++ b/askama/src/generator.rs diff --git a/askama_derive/src/parser.rs b/askama/src/parser.rs index cd93971..cd93971 100644 --- a/askama_derive/src/parser.rs +++ b/askama/src/parser.rs diff --git a/askama_derive/Cargo.toml b/askama_derive/Cargo.toml index e9bfa66..400cbd3 100644 --- a/askama_derive/Cargo.toml +++ b/askama_derive/Cargo.toml @@ -7,5 +7,5 @@ authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"] proc-macro = true [dependencies] +askama = { path = "../askama" } syn = "0.10" -nom = "2.0" diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 3b8fe55..8613ead 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -1,13 +1,9 @@ #![feature(proc_macro, proc_macro_lib)] -#[macro_use] -extern crate nom; +extern crate askama; extern crate proc_macro; extern crate syn; -mod generator; -mod parser; - use proc_macro::TokenStream; use std::fs::File; use std::io::Read; @@ -65,6 +61,6 @@ pub fn derive_template(input: TokenStream) -> TokenStream { let name = &ast.ident; let path = get_path_from_attrs(&ast.attrs); let src = get_template_source(&path); - let tokens = parser::parse(&src); - generator::generate(name.as_ref(), &tokens).parse().unwrap() + let tokens = askama::parser::parse(&src); + askama::generator::generate(name.as_ref(), &tokens).parse().unwrap() } |