Currently, the number of linearization variations grows exponentially with the number of construction sites (in the worst case where none are nested).
This could be improved by finding parts of the grammar which naturally isolate syntax errors (and corresponding AST nodes) and only reparsing linearized variations of those parts.
In more detail (probably only comprehensible to me):
Find stoppers by finding loops in the grammar. All parents outside the loop are stoppers.
Partition AST based on isolated loops. This isolates syntax errors and reduces the number of linearizations
Within each partition: decompose nodes on paths to (nested) construction sites instead of linearizing complete partition (combats exponential complexity of variations). Still generate exponential number of variations. This way, we can be conservative with the combination of ambiguity and nested construction sites
Currently, the number of linearization variations grows exponentially with the number of construction sites (in the worst case where none are nested). This could be improved by finding parts of the grammar which naturally isolate syntax errors (and corresponding AST nodes) and only reparsing linearized variations of those parts.
In more detail (probably only comprehensible to me):