mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 04:06:48 +01:00
extact dsl_token; flip Dsl; try to obviate ViewContext
This commit is contained in:
parent
f08593f0f8
commit
f797a7143d
12 changed files with 264 additions and 209 deletions
|
|
@ -40,7 +40,7 @@ macro_rules! transform_xy {
|
|||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'state, E: Output + 'state, T: ViewContext<'state, E>>
|
||||
FromDsl<'state, T> for $Enum<RenderBox<'state, E>> {
|
||||
Dsl<T> for $Enum<RenderBox<'state, E>> {
|
||||
fn take_from <'source: 'state> (state: &'state T, iter: &mut TokenIter<'source>) -> Perhaps<Self> {
|
||||
if let Some(Token { value: Value::Key(k), .. }) = iter.peek() {
|
||||
let mut base = iter.clone();
|
||||
|
|
@ -85,7 +85,7 @@ macro_rules! transform_xy_unit {
|
|||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'state, E: Output + 'state, T: ViewContext<'state, E>>
|
||||
FromDsl<'state, T> for $Enum<E::Unit, RenderBox<'state, E>> {
|
||||
Dsl<T> for $Enum<E::Unit, RenderBox<'state, E>> {
|
||||
fn take_from <'source: 'state> (state: &'state T, iter: &mut TokenIter<'source>) -> Perhaps<Self> {
|
||||
Ok(if let Some(Token { value: Value::Key($x|$y|$xy), .. }) = iter.peek() {
|
||||
let mut base = iter.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue