yggdrasil_rt/token.rs
1use crate::position::Position;
2
3/// A token generated by a `Parser`.
4#[derive(Clone, Debug, Eq, Hash, PartialEq)]
5pub enum Token<'i, R> {
6 /// The starting `Position` of a matched `Rule`
7 Start {
8 /// matched rule
9 rule: R,
10 /// starting position
11 pos: Position<'i>,
12 },
13 /// The ending `Position` of a matched `Rule`
14 End {
15 /// matched rule
16 rule: R,
17 /// ending position
18 pos: Position<'i>,
19 },
20}