pub enum Token {
Var(String),
Iri(String),
Prefixed(String, String),
Str {
value: String,
lang: Option<String>,
datatype: Option<String>,
},
Num(String),
Bool(bool),
Word(String),
Punct(char),
Op(&'static str),
StarOpen,
StarClose,
}Expand description
A lexical token.
Variants§
Var(String)
?x or $x — the leading sigil is kept (the full ?x text) so it
matches ctx.register_variable’s convention.
Iri(String)
<http://…> — the inner IRI text (angle brackets stripped).
Prefixed(String, String)
prefix:local — kept split so the parser can expand against the prefix map.
Str
A quoted string literal (quotes stripped, \"/\\ unescaped). An
optional @lang or ^^<datatype> is carried alongside.
Num(String)
A numeric literal (integer or decimal/double) — kept as text so the parser can choose the inline tag.
Bool(bool)
true / false.
Word(String)
An unquoted word: a keyword (FILTER, OPTIONAL, …), a function name, or
the Turtle a shorthand. Case is preserved; callers upper-case to match.
Punct(char)
( ) { } , ; . [ ]
Op(&'static str)
A multi-char or single-char operator: ||, &&, =, !=, <, <=,
>, >=, +, -, *, /, !.
StarOpen
<< — opens an RDF-Star quoted triple.
StarClose
>> — closes an RDF-Star quoted triple.
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more