Implement specials in the renderer.
This commit is contained in:
parent
7f65e73229
commit
cc6dbefcdb
@ -6,5 +6,6 @@ pub use parser::template;
|
|||||||
pub use parser::Body;
|
pub use parser::Body;
|
||||||
pub use parser::DustTag;
|
pub use parser::DustTag;
|
||||||
pub use parser::Filter;
|
pub use parser::Filter;
|
||||||
|
pub use parser::Special;
|
||||||
pub use parser::Template;
|
pub use parser::Template;
|
||||||
pub use parser::TemplateElement;
|
pub use parser::TemplateElement;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
use crate::parser::template;
|
use crate::parser::template;
|
||||||
use crate::parser::Body;
|
use crate::parser::Body;
|
||||||
use crate::parser::DustTag;
|
use crate::parser::DustTag;
|
||||||
|
use crate::parser::Special;
|
||||||
use crate::parser::Template;
|
use crate::parser::Template;
|
||||||
use crate::parser::TemplateElement;
|
use crate::parser::TemplateElement;
|
||||||
use crate::renderer::context_element::ContextElement;
|
use crate::renderer::context_element::ContextElement;
|
||||||
@ -145,6 +146,16 @@ impl<'a> DustRenderer<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DustTag::DTSpecial(special) => {
|
||||||
|
return Ok(match special {
|
||||||
|
Special::Space => " ",
|
||||||
|
Special::NewLine => "\n",
|
||||||
|
Special::CarriageReturn => "\r",
|
||||||
|
Special::LeftCurlyBrace => "{",
|
||||||
|
Special::RightCurlyBrace => "}",
|
||||||
|
}
|
||||||
|
.to_owned())
|
||||||
|
}
|
||||||
_ => (), // TODO: Implement the rest
|
_ => (), // TODO: Implement the rest
|
||||||
}
|
}
|
||||||
Ok("".to_owned())
|
Ok("".to_owned())
|
||||||
|
Loading…
Reference in New Issue
Block a user