parsing: DISABLE reusing upper nodes portion. Reuse an extra non-modified node from the lower portion to avoid a desync when a root decl gets split up. #3
! DISABLES upper nodes portion reuse until extensive testing is done !
I'm seeing false positive syntax errors when inserting or removing braces (usually, when editing switch cases). Fallback to reusing all tokens and lower portion of nodes to catch up on a few other areas on maintenance.
The desync case is finicky to reduce, but can be reliably reproduced at analysis.zig:2203 (as of this commit) .enum_literal => return try Type.typeValFromIP(analyser, .enum_literal_type), Insert a { between => and return .. then undo/backspace over it. Scroll up to 1400-1411 - observe constants marked as unused. The root decl ends up being split and the nodes duplicated.
To overcome this issue, mark one additional non-modified node for reparsing.
! DISABLES upper nodes portion reuse until extensive testing is done !
I'm seeing false positive syntax errors when inserting or removing braces (usually, when editing switch cases). Fallback to reusing all tokens and lower portion of nodes to catch up on a few other areas on maintenance.
The desync case is finicky to reduce, but can be reliably reproduced at analysis.zig:2203 (as of this commit)
.enum_literal => return try Type.typeValFromIP(analyser, .enum_literal_type),
Insert a{
between=>
andreturn ..
then undo/backspace over it. Scroll up to 1400-1411 - observe constants marked as unused. The root decl ends up being split and the nodes duplicated.To overcome this issue, mark one additional non-modified node for reparsing.