[−][src]Struct ucglib::ast::Token
Defines a Token representing a building block of UCG syntax.
Token's are passed to the parser stage to be parsed into an AST.
Fields
typ: TokenTypefragment: Stringpos: PositionMethods
impl Token[src]
pub fn new<S: Into<String>, P: Into<Position>>(
f: S,
typ: TokenType,
p: P
) -> Self[src]
f: S,
typ: TokenType,
p: P
) -> Self
Constructs a new Token with a type and line and column information.
pub fn new_with_pos<S: Into<String>>(
f: S,
typ: TokenType,
pos: Position
) -> Self[src]
f: S,
typ: TokenType,
pos: Position
) -> Self
Trait Implementations
impl Ord for Token[src]
fn cmp(&self, other: &Token) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self[src]
🔬 This is a nightly-only experimental API. (
clamp)Restrict a value to a certain interval. Read more
impl Clone for Token[src]
fn clone(&self) -> Token[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq<Token> for Token[src]
impl<'a> From<&'a Token> for PositionedItem<String>[src]
fn from(t: &'a Token) -> PositionedItem<String>[src]
impl Eq for Token[src]
impl PartialOrd<Token> for Token[src]
fn partial_cmp(&self, other: &Token) -> Option<Ordering>[src]
fn lt(&self, other: &Token) -> bool[src]
fn le(&self, other: &Token) -> bool[src]
fn gt(&self, other: &Token) -> bool[src]
fn ge(&self, other: &Token) -> bool[src]
impl Debug for Token[src]
impl Hash for Token[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl Borrow<str> for Token[src]
impl Positioned for Token[src]
Auto Trait Implementations
impl Sync for Token
impl Unpin for Token
impl Send for Token
impl UnwindSafe for Token
impl RefUnwindSafe for Token
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<S> SliceConcat<str> for S where
S: Borrow<str>, [src]
S: Borrow<str>,
type Output = String
🔬 This is a nightly-only experimental API. (
slice_concat_trait)The resulting type after concatenation
fn concat(slice: &[S]) -> String[src]
fn join(slice: &[S], sep: &str) -> String[src]
impl<T, V> SliceConcat<T> for V where
T: Clone,
V: Borrow<[T]>, [src]
T: Clone,
V: Borrow<[T]>,
type Output = Vec<T>
🔬 This is a nightly-only experimental API. (
slice_concat_trait)The resulting type after concatenation
fn concat(slice: &[V]) -> Vec<T>[src]
fn join(slice: &[V], sep: &T) -> Vec<T>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,