mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
NFA parser for mbe matcher
This commit is contained in:
parent
7f57a01b3d
commit
cff2201c30
9 changed files with 592 additions and 175 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue