Add Representation
This commit is contained in:
parent
5141cdadd9
commit
b042e06084
@ -1,6 +1,6 @@
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use crate::{ParseResult, Parser};
|
use crate::{representation::Representation, ParseResult, Parser};
|
||||||
|
|
||||||
pub struct AnnotatedParser<P, I, O, E>
|
pub struct AnnotatedParser<P, I, O, E>
|
||||||
where
|
where
|
||||||
@ -8,6 +8,7 @@ where
|
|||||||
{
|
{
|
||||||
inner: P,
|
inner: P,
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
|
repr: Option<Representation>,
|
||||||
phantom: PhantomData<(I, O, E)>,
|
phantom: PhantomData<(I, O, E)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ where
|
|||||||
Self {
|
Self {
|
||||||
inner,
|
inner,
|
||||||
name: None,
|
name: None,
|
||||||
|
repr: None,
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,4 +44,11 @@ where
|
|||||||
..self
|
..self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn with_repr(self, repr: Representation) -> Self {
|
||||||
|
Self {
|
||||||
|
repr: Some(repr),
|
||||||
|
..self
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ mod combinators;
|
|||||||
mod map;
|
mod map;
|
||||||
mod parser;
|
mod parser;
|
||||||
mod primitives;
|
mod primitives;
|
||||||
|
mod representation;
|
||||||
mod sequence;
|
mod sequence;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
2
src/representation.rs
Normal file
2
src/representation.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Representation {}
|
Loading…
Reference in New Issue
Block a user