Skip to main content

state_dist

Function state_dist 

Source
pub fn state_dist(kind: SyntaxKind, state: usize, terminal: SyntaxKind) -> isize
Expand description

Precomputed dist(q, a): minimum insertion cost to reach a point where terminal terminal can be matched, starting from parser state (kind, state). Returns 0 as the conservative default (admissible — parent context might accept the terminal after a pop).