diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-10-14 09:27:01 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-10-14 09:27:01 +0200 |
commit | 38c79a737ca01e2610c67e3b847da545b05f96b2 (patch) | |
tree | 91f1d644dcfd388bfdff1803e9c5241f65b96778 | |
parent | 4bd89aa6936b343d53968fb1d4d1960140b13b67 (diff) | |
download | askama-38c79a737ca01e2610c67e3b847da545b05f96b2.tar.gz askama-38c79a737ca01e2610c67e3b847da545b05f96b2.tar.bz2 askama-38c79a737ca01e2610c67e3b847da545b05f96b2.zip |
Add panic to make sure indentation mismatches are detected
-rw-r--r-- | askama_shared/src/generator.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index 4588677..64fa1f5 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -765,6 +765,9 @@ impl<'a> Generator<'a> { } fn dedent(&mut self) { + if self.indent == 0 { + panic!("dedent() called while indentation == 0"); + } self.indent -= 1; } } |