pub struct SourceMapBuilder { /* private fields */ }Expand description
Builder for constructing a SourceMap during parsing.
Implementations§
Source§impl SourceMapBuilder
impl SourceMapBuilder
Sourcepub fn add_entry(&mut self, span: Span, kind: EntryKind, name: Option<String>)
pub fn add_entry(&mut self, span: Span, kind: EntryKind, name: Option<String>)
Add an arbitrary entry to the source map.
Sourcepub fn add_entry_with_type(
&mut self,
span: Span,
kind: EntryKind,
name: Option<String>,
ty_info: String,
)
pub fn add_entry_with_type( &mut self, span: Span, kind: EntryKind, name: Option<String>, ty_info: String, )
Add an entry with type information.
Sourcepub fn add_definition(&mut self, span: Span, name: &str)
pub fn add_definition(&mut self, span: Span, name: &str)
Add a definition entry.
Sourcepub fn add_definition_with_type(
&mut self,
span: Span,
name: &str,
ty_info: &str,
)
pub fn add_definition_with_type( &mut self, span: Span, name: &str, ty_info: &str, )
Add a definition entry with type info.
Sourcepub fn add_reference(&mut self, span: Span, name: &str)
pub fn add_reference(&mut self, span: Span, name: &str)
Add a reference entry.
Sourcepub fn add_binder(&mut self, span: Span, name: &str)
pub fn add_binder(&mut self, span: Span, name: &str)
Add a binder entry.
Sourcepub fn add_constructor(&mut self, span: Span, name: &str)
pub fn add_constructor(&mut self, span: Span, name: &str)
Add a constructor entry.
Sourcepub fn add_keyword(&mut self, span: Span)
pub fn add_keyword(&mut self, span: Span)
Add a keyword entry.
Sourcepub fn add_literal(&mut self, span: Span)
pub fn add_literal(&mut self, span: Span)
Add a literal entry.
Sourcepub fn add_operator(&mut self, span: Span, symbol: &str)
pub fn add_operator(&mut self, span: Span, symbol: &str)
Add an operator entry.
Sourcepub fn add_comment(&mut self, span: Span)
pub fn add_comment(&mut self, span: Span)
Add a comment entry.
Sourcepub fn add_doc_comment(&mut self, span: Span, text: &str)
pub fn add_doc_comment(&mut self, span: Span, text: &str)
Add a doc comment entry.
Sourcepub fn add_tactic(&mut self, span: Span, name: &str)
pub fn add_tactic(&mut self, span: Span, name: &str)
Add a tactic entry.
Sourcepub fn add_pattern(&mut self, span: Span, name: Option<&str>)
pub fn add_pattern(&mut self, span: Span, name: Option<&str>)
Add a pattern entry.
Sourcepub fn add_type_annotation(&mut self, span: Span)
pub fn add_type_annotation(&mut self, span: Span)
Add a type annotation entry.
Sourcepub fn add_semantic_token(&mut self, token: SemanticToken)
pub fn add_semantic_token(&mut self, token: SemanticToken)
Add a pre-computed semantic token.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get the current number of entries.
Auto Trait Implementations§
impl Freeze for SourceMapBuilder
impl RefUnwindSafe for SourceMapBuilder
impl Send for SourceMapBuilder
impl Sync for SourceMapBuilder
impl Unpin for SourceMapBuilder
impl UnsafeUnpin for SourceMapBuilder
impl UnwindSafe for SourceMapBuilder
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