Struct i_slint_compiler::parser::SyntaxToken
source · [−]pub struct SyntaxToken {
pub token: SyntaxToken<Language>,
pub source_file: SourceFile,
}
Fields
token: SyntaxToken<Language>
source_file: SourceFile
Implementations
sourceimpl SyntaxToken
impl SyntaxToken
pub fn parent(&self) -> SyntaxNode
pub fn next_token(&self) -> Option<SyntaxToken>
Methods from Deref<Target = SyntaxToken<Language>>
sourcepub fn replace_with(&self, new_token: GreenToken) -> GreenNode
pub fn replace_with(&self, new_token: GreenToken) -> GreenNode
Returns a green tree, equal to the green tree this token belongs two, except with this token substitute. The complexity of operation is proportional to the depth of the tree
pub fn kind(&self) -> <L as Language>::Kind
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn text(&self) -> &str
pub fn green(&self) -> &GreenTokenData
pub fn parent(&self) -> Option<SyntaxNode<L>>
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode<L>>
pub fn next_sibling_or_token(
&self
) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
pub fn prev_sibling_or_token(
&self
) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
pub fn siblings_with_tokens(
&self,
direction: Direction
) -> impl Iterator<Item = NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
sourcepub fn next_token(&self) -> Option<SyntaxToken<L>>
pub fn next_token(&self) -> Option<SyntaxToken<L>>
Next token in the tree (i.e, not necessary a sibling).
sourcepub fn prev_token(&self) -> Option<SyntaxToken<L>>
pub fn prev_token(&self) -> Option<SyntaxToken<L>>
Previous token in the tree (i.e, not necessary a sibling).
pub fn detach(&self)
Trait Implementations
sourceimpl Clone for SyntaxToken
impl Clone for SyntaxToken
sourcefn clone(&self) -> SyntaxToken
fn clone(&self) -> SyntaxToken
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SyntaxToken
impl Debug for SyntaxToken
sourceimpl Deref for SyntaxToken
impl Deref for SyntaxToken
sourceimpl Display for SyntaxToken
impl Display for SyntaxToken
sourceimpl From<SyntaxToken> for NodeOrToken
impl From<SyntaxToken> for NodeOrToken
sourcefn from(original: SyntaxToken) -> NodeOrToken
fn from(original: SyntaxToken) -> NodeOrToken
Converts to this type from the input type.
sourceimpl Spanned for SyntaxToken
impl Spanned for SyntaxToken
fn span(&self) -> Span
fn source_file(&self) -> Option<&SourceFile>
fn to_source_location(&self) -> SourceLocation
Auto Trait Implementations
impl !RefUnwindSafe for SyntaxToken
impl !Send for SyntaxToken
impl !Sync for SyntaxToken
impl Unpin for SyntaxToken
impl !UnwindSafe for SyntaxToken
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more