Skip to main content

perl_parser/incremental/
checkpoint.rs

1use perl_lexer::LexerMode;
2
3/// Stable restart points to avoid re-lexing the whole world
4#[derive(Clone, Copy, Debug)]
5pub struct LexCheckpoint {
6    pub byte: usize,
7    pub mode: LexerMode,
8    pub line: usize,
9    pub column: usize,
10}
11
12/// Scope information at a parse checkpoint
13#[derive(Clone, Debug, Default)]
14pub struct ScopeSnapshot {
15    pub package_name: String,
16    pub locals: Vec<String>,
17    pub our_vars: Vec<String>,
18    pub parent_isa: Vec<String>,
19}
20
21/// Parse checkpoint with scope context
22#[derive(Clone, Debug)]
23pub struct ParseCheckpoint {
24    pub byte: usize,
25    pub scope_snapshot: ScopeSnapshot,
26    pub node_id: usize,
27}