pub struct PsiBuilder { /* private fields */ }Expand description
Constructed (from recycled buffers) in pool.rs.
Implementations§
Source§impl PsiBuilder
impl PsiBuilder
Sourcepub fn new(text: &str, tokens: &[Token]) -> PsiBuilder
pub fn new(text: &str, tokens: &[Token]) -> PsiBuilder
tokens must tile text exactly (lengths sum to text.len()).
Source§impl PsiBuilder
impl PsiBuilder
pub fn get_original_text(&self) -> &str
Sourcepub fn get_token_type(&mut self) -> Option<SyntaxKind>
pub fn get_token_type(&mut self) -> Option<SyntaxKind>
No remapper is ever installed for Kotlin, so the cached-type machinery reduces to this.
Sourcepub fn is_whitespace_or_comment(&self, kind: SyntaxKind) -> bool
pub fn is_whitespace_or_comment(&self, kind: SyntaxKind) -> bool
Whitespace = KtTokens.WHITESPACES, comments = KtTokens.COMMENTS (KotlinParserDefinition);
the KDoc sub-builder uses the same Kotlin language definition.
pub fn remap_current_token(&mut self, kind: SyntaxKind)
pub fn look_ahead(&mut self, steps: i32) -> Option<SyntaxKind>
pub fn raw_lookup(&self, steps: i32) -> Option<SyntaxKind>
pub fn raw_token_type_start(&self, steps: i32) -> i32
pub fn raw_token_index(&self) -> i32
pub fn raw_advance_lexer(&mut self, steps: i32)
pub fn advance_lexer(&mut self)
pub fn get_current_offset(&mut self) -> i32
pub fn get_token_text(&mut self) -> Option<&str>
Sourcepub fn mark(&mut self) -> Marker
pub fn mark(&mut self) -> Marker
Skips whitespace first unless this is the very first (root) marker.
pub fn eof(&mut self) -> bool
Sourcepub fn error(&mut self, message: &str)
pub fn error(&mut self, message: &str)
Adds an empty error element at the current (possibly pre-whitespace) lexeme; a second error at the same lexeme right after the first is ignored.
Sourcepub fn has_errors_after(&self, marker: Marker) -> bool
pub fn has_errors_after(&self, marker: Marker) -> bool
PsiBuilderImpl.hasErrorsAfter.
Source§impl PsiBuilder
impl PsiBuilder
pub fn get_tree_built(&mut self, lazy: &impl LazyReparse) -> Parse
Sourcepub fn build_tree_into(
&mut self,
root_kind: Option<SyntaxKind>,
sink: &mut TreeSink,
lazy: &impl LazyReparse,
)
pub fn build_tree_into( &mut self, root_kind: Option<SyntaxKind>, sink: &mut TreeSink, lazy: &impl LazyReparse, )
getTreeBuilt into a shared sink; the root node gets root_kind if given.
Trait Implementations§
Source§impl Drop for PsiBuilder
impl Drop for PsiBuilder
Source§impl MarkerHost for PsiBuilder
impl MarkerHost for PsiBuilder
fn psi_builder(&mut self) -> &mut PsiBuilder
Auto Trait Implementations§
impl Freeze for PsiBuilder
impl RefUnwindSafe for PsiBuilder
impl Send for PsiBuilder
impl Sync for PsiBuilder
impl Unpin for PsiBuilder
impl UnsafeUnpin for PsiBuilder
impl UnwindSafe for PsiBuilder
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