diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-10-06 14:19:12 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-10-07 07:37:46 +0200 |
commit | e1497adb506ac1d7fa8d063b4474a5519d0c10d0 (patch) | |
tree | d41791a089ddb598c2b52963aff9cfce44b80f39 /askama_derive/src/input.rs | |
parent | 6e6691b06b2792108bef8fc2da142bb10e3f9dba (diff) | |
download | askama-e1497adb506ac1d7fa8d063b4474a5519d0c10d0.tar.gz askama-e1497adb506ac1d7fa8d063b4474a5519d0c10d0.tar.bz2 askama-e1497adb506ac1d7fa8d063b4474a5519d0c10d0.zip |
Handle syntax validation during Config instantiation
Diffstat (limited to 'askama_derive/src/input.rs')
-rw-r--r-- | askama_derive/src/input.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs index 5d3fa76..95d0019 100644 --- a/askama_derive/src/input.rs +++ b/askama_derive/src/input.rs @@ -141,26 +141,6 @@ impl<'a> TemplateInput<'a> { }, ); - if syntax.block_start.len() != 2 - || syntax.block_end.len() != 2 - || syntax.expr_start.len() != 2 - || syntax.expr_end.len() != 2 - || syntax.comment_start.len() != 2 - || syntax.comment_end.len() != 2 - { - panic!("length of delimiters must be two") - } - - let bs = syntax.block_start.as_bytes()[0]; - let be = syntax.block_start.as_bytes()[1]; - let cs = syntax.comment_start.as_bytes()[0]; - let ce = syntax.comment_start.as_bytes()[1]; - let es = syntax.block_start.as_bytes()[0]; - let ee = syntax.block_start.as_bytes()[1]; - if !(bs == cs && bs == es) && !(be == ce && be == ee) { - panic!("bad delimiters block_start: {}, comment_start: {}, expr_start: {}, needs one of the two characters in common", syntax.block_start, syntax.comment_start, syntax.expr_start); - } - TemplateInput { ast, config, |