Added the signature for passing filters into the render function.

Added the signature for passing filters into the render function but I am not yet using the filters.
This commit is contained in:
Tom Alexander
2020-04-12 21:54:15 -04:00
parent 70cb107f86
commit 883bda7a78
6 changed files with 30 additions and 22 deletions

View File

@@ -9,5 +9,6 @@ pub use node_invoker::Result;
pub use parser::template;
pub use parser::Body;
pub use parser::DustTag;
pub use parser::Filter;
pub use parser::Template;
pub use parser::TemplateElement;

View File

@@ -45,7 +45,7 @@ pub enum DustTag<'a> {
}
#[derive(Clone, Debug, PartialEq)]
enum Special {
pub enum Special {
Space,
NewLine,
CarriageReturn,
@@ -66,11 +66,11 @@ pub struct Path<'a> {
#[derive(Clone, Debug, PartialEq)]
pub struct Reference<'a> {
pub path: Path<'a>,
filters: Vec<Filter>,
pub filters: Vec<Filter>,
}
#[derive(Clone, Debug, PartialEq)]
enum Filter {
pub enum Filter {
HtmlEncode,
DisableHtmlEncode,
JavascriptStringEncode,
@@ -86,20 +86,20 @@ pub struct Span<'a> {
}
#[derive(Clone, Debug, PartialEq)]
struct Container<'a> {
pub struct Container<'a> {
path: Path<'a>,
contents: Option<Body<'a>>,
else_contents: Option<Body<'a>>,
}
#[derive(Clone, Debug, PartialEq)]
struct NamedBlock<'a> {
pub struct NamedBlock<'a> {
name: &'a str,
contents: Option<Body<'a>>,
}
#[derive(Clone, Debug, PartialEq)]
struct ParameterizedBlock<'a> {
pub struct ParameterizedBlock<'a> {
name: &'a str,
params: Vec<KVPair<'a>>,
contents: Option<Body<'a>>,
@@ -107,7 +107,7 @@ struct ParameterizedBlock<'a> {
}
#[derive(Clone, Debug, PartialEq)]
struct Partial<'a> {
pub struct Partial<'a> {
name: String,
params: Vec<KVPair<'a>>,
}