From 8f8d72a749a39845fd03ae259533abe73dc7dcdf Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 9 Aug 2022 14:04:27 +0200 Subject: Add support for passing `ok`, `nok` as separate states to attempts --- src/construct/heading_setext.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/construct/heading_setext.rs') diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 50feba4..a8c707a 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -93,7 +93,11 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { }, ); - tokenizer.go(state_name, StateName::HeadingSetextBefore) + tokenizer.attempt( + state_name, + State::Fn(StateName::HeadingSetextBefore), + State::Nok, + ) } else { State::Nok } @@ -134,7 +138,11 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { tokenizer.tokenize_state.marker = 0; tokenizer.exit(Token::HeadingSetextUnderline); let state_name = space_or_tab(tokenizer); - tokenizer.attempt_opt(state_name, StateName::HeadingSetextAfter) + tokenizer.attempt( + state_name, + State::Fn(StateName::HeadingSetextAfter), + State::Fn(StateName::HeadingSetextAfter), + ) } } } -- cgit