| 1 | use crate::parser::core::rule_builder; |
| 2 | use crate::Node; |
| 3 | |
| 4 | /// Each member of block rule chain must implement this trait |
| 5 | pub trait BlockRule : 'static { |
| 6 | fn check(state: &mut super::BlockState) -> Option<()> { |
| 7 | Self::run(state).map(|_| ()) |
| 8 | } |
| 9 | |
| 10 | fn run(state: &mut super::BlockState) -> Option<(Node, usize)>; |
| 11 | } |
| 12 | |
| 13 | rule_builder!(BlockRule); |