mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-08 12:46:44 +01:00
edn -> dsl
This commit is contained in:
parent
d30eda33d1
commit
877b344765
35 changed files with 197 additions and 225 deletions
|
|
@ -3,7 +3,7 @@
|
|||
//!
|
||||
//! Transform may also react to the [Area] provided.
|
||||
//! ```
|
||||
//! use ::tek_tui::{*, tek_output::*};
|
||||
//! use ::tengri::{output::*, tui::*};
|
||||
//! let area: [u16;4] = [10, 10, 20, 20];
|
||||
//! fn test (area: [u16;4], item: &impl Content<TuiOut>, expected: [u16;4]) {
|
||||
//! assert_eq!(Content::layout(item, area), expected);
|
||||
|
|
@ -30,6 +30,7 @@ macro_rules! transform_xy {
|
|||
#[inline] pub fn y (item: T) -> Self { Self::Y(item) }
|
||||
#[inline] pub fn xy (item: T) -> Self { Self::XY(item) }
|
||||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T>
|
||||
for $Enum<RenderBox<'a, E>> {
|
||||
fn try_from_expr (state: &'a T, iter: TokenIter<'a>) -> Option<Self> {
|
||||
|
|
@ -76,6 +77,7 @@ macro_rules! transform_xy_unit {
|
|||
#[inline] pub fn y (y: U, item: T) -> Self { Self::Y(y, item) }
|
||||
#[inline] pub fn xy (x: U, y: U, item: T) -> Self { Self::XY(x, y, item) }
|
||||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T>
|
||||
for $Enum<E::Unit, RenderBox<'a, E>> {
|
||||
fn try_from_expr (state: &'a T, iter: TokenIter<'a>) -> Option<Self> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue