FromDsl -> Namespace

This commit is contained in:
🪞👃🪞 2025-05-21 00:06:36 +03:00
parent 455d6d00d5
commit f714302f21
8 changed files with 33 additions and 32 deletions

View file

@ -33,7 +33,7 @@ macro_rules! transform_xy {
#[inline] pub const fn xy (item: A) -> Self { Self::XY(item) }
}
#[cfg(feature = "dsl")]
impl<'source, A, T: Dsl<A>> FromDsl<'source, T> for $Enum<A> {
impl<'source, A, T: Dsl<A>> Namespace<'source, T> for $Enum<A> {
fn take_from <'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();
@ -77,7 +77,7 @@ macro_rules! transform_xy_unit {
#[inline] pub const fn xy (x: U, y: U, item: A) -> Self { Self::XY(x, y, item) }
}
#[cfg(feature = "dsl")]
impl<'source, A, U: Coordinate, T: Dsl<A> + Dsl<U>> FromDsl<'source, T> for $Enum<U, A> {
impl<'source, A, U: Coordinate, T: Dsl<A> + Dsl<U>> Namespace<'source, T> for $Enum<U, A> {
fn take_from <'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();