mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: EdnItem -> Atom, rewrite tokenizer
This commit is contained in:
parent
143cd24e09
commit
ff31957fed
39 changed files with 477 additions and 376 deletions
|
|
@ -47,10 +47,10 @@ impl<E: Output, A: Content<E>> Content<E> for Align<E, A> {
|
|||
impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Align<E, RenderBox<'a, E>> {
|
||||
fn try_from_edn (
|
||||
state: &'a T,
|
||||
head: &EdnItem<impl AsRef<str>>,
|
||||
tail: &'a [EdnItem<impl AsRef<str>>]
|
||||
head: &Atom<impl AsRef<str>>,
|
||||
tail: &'a [Atom<impl AsRef<str>>]
|
||||
) -> Option<Self> {
|
||||
use EdnItem::*;
|
||||
use Atom::*;
|
||||
Some(match (head.to_ref(), tail) {
|
||||
(Key("align/c"), [a]) => Self::c(state.get_content(a).expect("no content")),
|
||||
(Key("align/x"), [a]) => Self::x(state.get_content(a).expect("no content")),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue