pub struct LexedSource<'a> { /* private fields */ }Expand description
Lossless tokenization of a KCL source string.
LexedSource keeps the original source and the full token sequence,
including whitespace, comments, and recovery tokens. Lexical errors are
represented as token kinds such as SyntaxKind::Unknown,
SyntaxKind::UnterminatedString, and
SyntaxKind::UnterminatedBlockComment.
Implementations§
Source§impl<'a> LexedSource<'a>
impl<'a> LexedSource<'a>
Sourcepub fn into_tokens(self) -> Vec<Token<'a>>
pub fn into_tokens(self) -> Vec<Token<'a>>
Consumes the lexed source and returns its token vector.
Trait Implementations§
Source§impl<'a> Clone for LexedSource<'a>
impl<'a> Clone for LexedSource<'a>
Source§fn clone(&self) -> LexedSource<'a>
fn clone(&self) -> LexedSource<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for LexedSource<'a>
impl<'a> Debug for LexedSource<'a>
Source§impl<'a, 's> IntoIterator for &'s LexedSource<'a>
impl<'a, 's> IntoIterator for &'s LexedSource<'a>
Source§impl<'a> IntoIterator for LexedSource<'a>
impl<'a> IntoIterator for LexedSource<'a>
Source§impl<'a> PartialEq for LexedSource<'a>
impl<'a> PartialEq for LexedSource<'a>
Source§fn eq(&self, other: &LexedSource<'a>) -> bool
fn eq(&self, other: &LexedSource<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Eq for LexedSource<'a>
impl<'a> StructuralPartialEq for LexedSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for LexedSource<'a>
impl<'a> RefUnwindSafe for LexedSource<'a>
impl<'a> Send for LexedSource<'a>
impl<'a> Sync for LexedSource<'a>
impl<'a> Unpin for LexedSource<'a>
impl<'a> UnsafeUnpin for LexedSource<'a>
impl<'a> UnwindSafe for LexedSource<'a>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more