pub struct CommentedToken<'a> {
pub token: Token<'a>,
pub offset: usize,
pub leading_comments: Option<Vec<&'a str>>,
pub inline_comment: Option<&'a str>,
}Expand description
Representation of a token.
This represents a single token in an R program along with the line on which it occurs and the column offset. Additionally, it stores the comments that are associated with the token.
Fields§
§token: Token<'a>The actual token stored in this struct.
offset: usizeThe column offset of the start of this token.
leading_comments: Option<Vec<&'a str>>Preceding comments.
inline_comment: Option<&'a str>Trailing inline comment.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for CommentedToken<'a>
impl<'a> Clone for CommentedToken<'a>
Source§fn clone(&self) -> CommentedToken<'a>
fn clone(&self) -> CommentedToken<'a>
Returns a copy of the value. Read more
1.0.0 · 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 CommentedToken<'a>
impl<'a> Debug for CommentedToken<'a>
Source§impl<'a> Deref for CommentedToken<'a>
impl<'a> Deref for CommentedToken<'a>
Source§impl<'a> Display for CommentedToken<'a>
impl<'a> Display for CommentedToken<'a>
Source§impl<'a> PartialEq for CommentedToken<'a>
impl<'a> PartialEq for CommentedToken<'a>
When comparing two tokens, only the token itself is compared. The line and offset are ignored.
Auto Trait Implementations§
impl<'a> Freeze for CommentedToken<'a>
impl<'a> RefUnwindSafe for CommentedToken<'a>
impl<'a> Send for CommentedToken<'a>
impl<'a> Sync for CommentedToken<'a>
impl<'a> Unpin for CommentedToken<'a>
impl<'a> UnwindSafe for CommentedToken<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)