pub struct TermToken {
pub token_id: TokenID,
pub value: Value,
pub span: Option<Span>,
pub op_tab_index: Option<usize>,
}Expand description
Fields§
§token_id: TokenID§value: ValueThe associated value (if any).
span: Option<Span>The line number where the token was recognized.
op_tab_index: Option<usize>Optional operator definition index.
Implementations§
Source§impl TermToken
impl TermToken
Sourcepub fn new(token_id: TokenID, value: Value, span: Option<Span>) -> Self
pub fn new(token_id: TokenID, value: Value, span: Option<Span>) -> Self
Creates a new TermToken with the specified token ID, value, and line number.
§Parameters
token_id: Token identifier from the lexer’s token table.value: Optional value attached to the token.line_no: Source line number where this token was found.
The op_tab_index field is initialized to None by default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TermToken
impl RefUnwindSafe for TermToken
impl Send for TermToken
impl Sync for TermToken
impl Unpin for TermToken
impl UnwindSafe for TermToken
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