pub struct IncrementalParser { /* private fields */ }Expand description
Incremental parsing optimizer.
Tracks changed regions to determine which AST nodes need reparsing.
Implementations§
Source§impl IncrementalParser
impl IncrementalParser
Sourcepub fn new() -> IncrementalParser
pub fn new() -> IncrementalParser
Create a new incremental parser with no changed regions
Sourcepub fn mark_changed(&mut self, start: usize, end: usize)
pub fn mark_changed(&mut self, start: usize, end: usize)
Mark a region as changed.
Overlapping regions are automatically merged.
Sourcepub fn needs_reparse(&self, node_start: usize, node_end: usize) -> bool
pub fn needs_reparse(&self, node_start: usize, node_end: usize) -> bool
Check if a node needs reparsing based on changed regions.
Returns true if the node overlaps with any changed region.
Trait Implementations§
Source§impl Default for IncrementalParser
impl Default for IncrementalParser
Source§fn default() -> IncrementalParser
fn default() -> IncrementalParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IncrementalParser
impl RefUnwindSafe for IncrementalParser
impl Send for IncrementalParser
impl Sync for IncrementalParser
impl Unpin for IncrementalParser
impl UnsafeUnpin for IncrementalParser
impl UnwindSafe for IncrementalParser
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