Expand description
Incremental parsing support for Perl.
This crate provides efficient incremental parsing capabilities for Perl code, enabling Language Server Protocol features to respond quickly to document edits by reusing portions of the previous parse tree.
§Overview
The incremental parser minimizes re-parsing overhead when documents change by:
- Identifying which portions of the AST are affected by an edit
- Reusing unaffected subtrees from the previous parse
- Only re-parsing the modified regions and their dependent nodes
§Usage
use perl_incremental_parsing::incremental;
use perl_parser_core::Parser;
// Initial parse
let source = "sub foo { return 42; }";
let mut parser = Parser::new(source);
let ast = parser.parse();
// After edit, incrementally reparse only affected portions
// (specific APIs depend on incremental module implementation)Re-exports§
pub use perl_edit as edit;pub use incremental::*;
Modules§
- ast
- Abstract Syntax Tree (AST) definitions for Perl parsing. AST facade for the core parser engine.
- error
- Error types and recovery strategies for parser failures. Error types and recovery helpers for the parser engine.
- incremental
- Incremental parsing implementation and helpers.
- parser
- Core parser implementation for Perl source. Recursive descent Perl parser.
- position
- Position tracking types and UTF-16 mapping utilities. Enhanced position tracking for incremental parsing
Structs§
- Node
- Core AST node representing any Perl language construct within parsing workflows.
- Parser
- Parser state for a single Perl source input.
Enums§
- Node
Kind - Comprehensive enumeration of all Perl language constructs supported by the parser.
Type Aliases§
- Source
Location - Type alias for backward compatibility with
SourceLocation.