lol_html/parser/state_machine/syntax_dsl/
state.rs

1macro_rules! state {
2    (
3        $name:ident $(<-- ( $($enter_actions:tt)* ))* {
4            $($arms:tt)*
5        }
6
7        $($rest:tt)*
8    ) => {
9        #[allow(unused_variables)]
10        fn $name(&mut self, context: &mut Self::Context, input: &[u8]) -> StateResult {
11            // NOTE: clippy complains about some states that break the loop in each match arm
12            #[allow(clippy::never_loop)]
13            loop {
14                let ch = self.consume_ch(input);
15
16                state_body!(|[self, context, input, ch]|> [$($arms)*], [$($($enter_actions)*)*]);
17            }
18        }
19
20        state!($($rest)*);
21    };
22
23    // NOTE: end of the state list
24    () => ();
25}