Add Representation
This commit is contained in:
parent
5141cdadd9
commit
b042e06084
@ -1,6 +1,6 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ParseResult, Parser};
|
||||
use crate::{representation::Representation, ParseResult, Parser};
|
||||
|
||||
pub struct AnnotatedParser<P, I, O, E>
|
||||
where
|
||||
@ -8,6 +8,7 @@ where
|
||||
{
|
||||
inner: P,
|
||||
name: Option<String>,
|
||||
repr: Option<Representation>,
|
||||
phantom: PhantomData<(I, O, E)>,
|
||||
}
|
||||
|
||||
@ -32,6 +33,7 @@ where
|
||||
Self {
|
||||
inner,
|
||||
name: None,
|
||||
repr: None,
|
||||
phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
@ -42,4 +44,11 @@ where
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_repr(self, repr: Representation) -> Self {
|
||||
Self {
|
||||
repr: Some(repr),
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ mod combinators;
|
||||
mod map;
|
||||
mod parser;
|
||||
mod primitives;
|
||||
mod representation;
|
||||
mod sequence;
|
||||
|
||||
#[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