Commit fd16358
committed
parser: keep the adoption cache across recovery attempts (#45)
The recovery second pass re-runs the entry rule under a growing bar set, up to 33
attempts. Each attempt cleared adoptPath/adoptBase — the descent cache into the
PRE-EDIT tree — and rebuilt it from the root.
That reset is redundant: adoptRoot is the pre-edit tree, fixed for the whole loop,
so the cache stays valid across attempts; adoptSeek already self-truncates to the
prefix that still contains the current token, and the bars change the adoption
DECISION (re-checked per call), not the navigation. Dropping the per-attempt reset
lets a later attempt reuse the descent past the memo-reused bar-free prefix.
Only the per-attempt run-extension state still resets. recovery / incremental-verify
/ exhaustive-edits confirm every recovered tree stays byte-identical.1 parent b41ee24 commit fd16358
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3950 | 3950 | | |
3951 | 3951 | | |
3952 | 3952 | | |
3953 | | - | |
3954 | | - | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
3955 | 3958 | | |
3956 | 3959 | | |
3957 | 3960 | | |
| |||
3970 | 3973 | | |
3971 | 3974 | | |
3972 | 3975 | | |
3973 | | - | |
3974 | | - | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
3975 | 3981 | | |
3976 | 3982 | | |
3977 | 3983 | | |
| |||
0 commit comments