okane_core/syntax/
plain.rs

1//! Defines simplest [Decoration] [Ident], which does decorate nothing.
2//! Also provides type aliases with [Ident].
3
4use std::fmt::Debug;
5
6use super::decoration::{AsUndecorated, Decoration};
7
8/// Ident is a [Decoration] that attaches no extra information.
9/// Good to use if you just want a syntax type.
10pub struct Ident;
11
12impl Decoration for Ident {
13    type Decorated<T> = T
14    where
15        T: AsUndecorated<T> + Debug + PartialEq + Eq ;
16
17    fn decorate_parser<PIn, I, O, E>(parser: PIn) -> impl winnow::Parser<I, Self::Decorated<O>, E>
18    where
19        I: winnow::stream::Stream + winnow::stream::Location,
20        O: AsUndecorated<O> + Debug + PartialEq + Eq,
21        PIn: winnow::Parser<I, O, E>,
22    {
23        parser
24    }
25}
26
27pub type LedgerEntry<'i> = super::LedgerEntry<'i, Ident>;
28pub type Transaction<'i> = super::Transaction<'i, Ident>;
29pub type Posting<'i> = super::Posting<'i, Ident>;
30pub type PostingAmount<'i> = super::PostingAmount<'i, Ident>;
31pub type Lot<'i> = super::Lot<'i, Ident>;