Make the dust template parser all_consuming.
This commit is contained in:
parent
5b2ac7c2c2
commit
8121c93392
@ -698,7 +698,7 @@ fn body(i: &str) -> IResult<&str, Body> {
|
|||||||
|
|
||||||
pub fn template(i: &str) -> IResult<&str, Template> {
|
pub fn template(i: &str) -> IResult<&str, Template> {
|
||||||
// DustJS ignores all preceding whitespace (tabs, newlines, spaces) but only ignores trailing newlines
|
// DustJS ignores all preceding whitespace (tabs, newlines, spaces) but only ignores trailing newlines
|
||||||
let (remaining, contents) = delimited(multispace0, body, eof_whitespace)(i)?;
|
let (remaining, contents) = all_consuming(delimited(multispace0, body, eof_whitespace))(i)?;
|
||||||
Ok((remaining, Template { contents: contents }))
|
Ok((remaining, Template { contents: contents }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ pub fn compile_template<'a>(
|
|||||||
source: &'a str,
|
source: &'a str,
|
||||||
name: String,
|
name: String,
|
||||||
) -> Result<CompiledTemplate<'a>, CompileError> {
|
) -> Result<CompiledTemplate<'a>, CompileError> {
|
||||||
// TODO: Make this all consuming
|
|
||||||
// TODO: This could use better error management
|
// TODO: This could use better error management
|
||||||
let (_remaining, parsed_template) = template(source).expect("Failed to compile template");
|
let (_remaining, parsed_template) = template(source).expect("Failed to compile template");
|
||||||
Ok(CompiledTemplate {
|
Ok(CompiledTemplate {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user