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>
14        = T
15    where
16        T: AsUndecorated<T> + Debug + PartialEq + Eq;
17
18    fn decorate_parser<PIn, I, O, E>(parser: PIn) -> impl winnow::Parser<I, Self::Decorated<O>, E>
19    where
20        I: winnow::stream::Stream + winnow::stream::Location,
21        O: AsUndecorated<O> + Debug + PartialEq + Eq,
22        PIn: winnow::Parser<I, O, E>,
23    {
24        parser
25    }
26}
27
28pub type LedgerEntry<'i> = super::LedgerEntry<'i, Ident>;
29pub type Transaction<'i> = super::Transaction<'i, Ident>;
30pub type Posting<'i> = super::Posting<'i, Ident>;
31pub type PostingAmount<'i> = super::PostingAmount<'i, Ident>;
32pub type Lot<'i> = super::Lot<'i, Ident>;