NFA parser for mbe matcher

This commit is contained in:
Edwin Cheng 2021-02-02 04:42:37 +08:00
parent 7f57a01b3d
commit cff2201c30
9 changed files with 592 additions and 175 deletions

View file

@ -21,7 +21,7 @@ use test_utils::mark;
pub use tt::{Delimiter, DelimiterKind, Punct};
use crate::{
parser::{parse_pattern, parse_template, Op},
parser::{parse_pattern, parse_template, MetaTemplate, Op},
tt_iter::TtIter,
};
@ -94,15 +94,6 @@ struct Rule {
rhs: MetaTemplate,
}
#[derive(Clone, Debug, PartialEq, Eq)]
struct MetaTemplate(Vec<Op>);
impl<'a> MetaTemplate {
fn iter(&self) -> impl Iterator<Item = &Op> {
self.0.iter()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
struct Shift(u32);