Skip to main content

Node

Enum Node 

Source
pub enum Node {
Show 25 variants Empty, Interpreted, Seq(&'static [u32], &'static [bool]), Alt(&'static [u32]), Kw(&'static str), Kws(&'static [&'static str]), Opt(u32), Rep(u32, bool), Occ(u32, u32, f64), List(u32, u32, f64, u32), Leaf(&'static str, u8), Rng(u32, f64, f64, Option<&'static str>, bool), Ref(u32), Fn(&'static str, u32), FnDef(&'static str, Option<u32>), Num(f64, Option<&'static str>, Option<&'static str>), Str(&'static str), Comma, Colon, Slash, OpenParens, CloseParens, OpenCurly, OptList(u32), Unordered(&'static [u32], &'static [bool], bool),
}
Expand description

a syntax node. the children are indexes in NODES, the definitions indexes in ROOTS

Variants§

§

Empty

an empty syntax

§

Interpreted

a definition the compiler could not compile: the interpreter validates it

§

Seq(&'static [u32], &'static [bool])

a sequence: the items, nullable[i]: the items from i are nullable

§

Alt(&'static [u32])

alternatives: the one that matches the most tokens

§

Kw(&'static str)

a keyword (lowercase), ignoring the case

§

Kws(&'static [&'static str])

alternative keywords (lowercase, sorted)

§

Opt(u32)

an optional syntax: skipped when it does not match

§

Rep(u32, bool)

* (zero allowed) or +

§

Occ(u32, u32, f64)

{min,max}

§

List(u32, u32, f64, u32)

#{min,max}, the number of commas of an item

§

Leaf(&'static str, u8)

a type validated by match_property(), the kind of its fast path (see leaf_kind)

§

Rng(u32, f64, f64, Option<&'static str>, bool)

a type with a range: the type, min, max, the unit of a dimension range, optional

§

Ref(u32)

a reference to a definition

§

Fn(&'static str, u32)

a function (lowercase name) and its arguments

§

FnDef(&'static str, Option<u32>)

a function definition <rgb()>: the definition of the function syntax

§

Num(f64, Option<&'static str>, Option<&'static str>)

a literal number or dimension: the value, the token type name of the unit, the unit

§

Str(&'static str)

a quoted literal: '+'

§

Comma

§

Colon

§

Slash

§

OpenParens

§

CloseParens

§

OpenCurly

§

OptList(u32)

<bg-layer>#? , <final-bg-layer>: [ <bg-layer> , ]*

§

Unordered(&'static [u32], &'static [bool], bool)

|| (any) or && (all): the operands, nullable operands

Trait Implementations§

Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Node

§

impl Freeze for Node

§

impl Move for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.