Implement specials in the renderer.

This commit is contained in:
Tom Alexander
2020-05-03 14:52:08 -04:00
parent 7f65e73229
commit cc6dbefcdb
2 changed files with 12 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
use crate::parser::template;
use crate::parser::Body;
use crate::parser::DustTag;
use crate::parser::Special;
use crate::parser::Template;
use crate::parser::TemplateElement;
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
}
Ok("".to_owned())