aboutsummaryrefslogtreecommitdiffstats
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-16 16:49:29 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-16 16:49:53 +0200
commit6ee90b34c87354baf8e03d5469a92cf5dd17a82b (patch)
treecfa64be772be6464e6f790dabccf8a77e7afe60e /src/tokenizer.rs
parent93d0b7c6465f4ffe220b3ddada729746b11eb6ce (diff)
downloadmarkdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.gz
markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.bz2
markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.zip
Add support for frontmatter
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 7eba194..2edab03 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -509,6 +509,11 @@ impl<'a> Tokenizer<'a> {
/// Stack an attempt, moving to `ok` on [`State::Ok`][] and `nok` on
/// [`State::Nok`][], reverting in both cases.
pub fn check(&mut self, ok: State, nok: State) {
+ debug_assert_ne!(
+ nok,
+ State::Nok,
+ "checking w/ `State::Nok` should likely be an attempt"
+ );
// Always capture (and restore) when checking.
// No need to capture (and restore) when `nok` is `State::Nok`, because the
// parent attempt will do it.