lang_pt 0.1.2

A parser tool to generate recursive descent top down parser.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::Lex;
use std::fmt::{Debug, Display, Formatter};

impl<TToken: Debug> Display for Lex<TToken> {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        f.debug_tuple("")
            .field(&self.token)
            .field(&self.start)
            .field(&self.end)
            .finish()
    }
}

impl<TToken> Lex<TToken> {
    pub fn new(token: TToken, start: usize, end: usize) -> Self {
        Self { token, start, end }
    }
}