From 6ee90b34c87354baf8e03d5469a92cf5dd17a82b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 16 Aug 2022 16:49:29 +0200 Subject: Add support for frontmatter --- src/tokenizer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tokenizer.rs') 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. -- cgit