Add Representation

This commit is contained in:
Greg Shuflin 2024-01-30 00:05:20 -08:00
parent 5141cdadd9
commit b042e06084
3 changed files with 13 additions and 1 deletions

View File

@ -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
}
}
}

View File

@ -5,6 +5,7 @@ mod combinators;
mod map;
mod parser;
mod primitives;
mod representation;
mod sequence;
#[cfg(test)]

2
src/representation.rs Normal file
View File

@ -0,0 +1,2 @@
#[derive(Debug)]
pub struct Representation {}