mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
wip: distribute layout operator parsing
This commit is contained in:
parent
4af6e011b6
commit
fa70a42bad
12 changed files with 150 additions and 81 deletions
|
|
@ -25,7 +25,7 @@ use crate::*;
|
|||
}
|
||||
|
||||
/// Map EDN tokens to parameters of a given type for a given context
|
||||
pub trait EdnProvide<'a, U> {
|
||||
pub trait EdnProvide<'a, U>: Sized {
|
||||
fn get <S: AsRef<str>> (&'a self, _edn: &'a EdnItem<S>) -> Option<U> {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
|
||||
pub(crate) use std::{fmt::{Debug, Formatter, Error as FormatError}};
|
||||
|
||||
mod edn_error; pub use self::edn_error::*;
|
||||
mod edn_item; pub use self::edn_item::*;
|
||||
mod edn_iter; pub use self::edn_iter::*;
|
||||
mod edn_token; pub use self::edn_token::*;
|
||||
mod edn_error; pub use self::edn_error::*;
|
||||
mod edn_item; pub use self::edn_item::*;
|
||||
mod edn_iter; pub use self::edn_iter::*;
|
||||
mod edn_token; pub use self::edn_token::*;
|
||||
mod edn_provide; pub use self::edn_provide::*;
|
||||
mod try_from_edn; pub use self::try_from_edn::*;
|
||||
|
||||
#[cfg(test)] #[test] fn test_edn () -> Result<(), ParseError> {
|
||||
use EdnItem::*;
|
||||
|
|
|
|||
6
edn/src/try_from_edn.rs
Normal file
6
edn/src/try_from_edn.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
use crate::*;
|
||||
|
||||
pub trait TryFromEdn<'a, T>: Sized {
|
||||
fn try_from_edn (state: &'a T, head: &EdnItem<&str>, tail: &'a [EdnItem<&str>]) ->
|
||||
Option<Self>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue