fix(extract): parse the first-branch projection under the terminated-last-line rule

Merging main brought #2340's virtual_newline field in CBMStringInput. cbm_rescue_defs_from_projection still built its input with the two-field initializer, a missing-field-initializers error under -Werror. The projection keeps the raw source's length and line structure, so it now goes through cbm_parse_source like the raw parse and the C++ branch views: the same virtual newline, and the same edit that removes it again.

extraction pipeline graph_buffer store_search mcp registry edge_types_probe parse_coverage c_lsp test_impact_engine conditional_variants on the merge result: 2277 passed, 4 skipped.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel
2026-10-08 01:37:03 +02:00
parent ea2a8f185f
commit 8a97baabcb
+3 -3
View File
@@ -2571,10 +2571,10 @@ static void cbm_rescue_defs_from_projection(CBMExtractCtx *raw_ctx, const TSLang
TSTree *tree = NULL;
if (parser) {
ts_parser_reset(parser);
CBMStringInput input = {projected, (uint32_t)raw_ctx->source_len};
TSInput ts_input = {&input, cbm_string_read, TSInputEncodingUTF8, NULL};
TSParseOptions opts = {0};
tree = ts_parser_parse_with_options(parser, NULL, ts_input, opts);
/* The projection keeps the raw source's length and line structure,
* so it is parsed under the same terminated-last-line rule (#2078). */
tree = cbm_parse_source(parser, projected, (uint32_t)raw_ctx->source_len, opts);
}
CBMHashTable *held = tree ? cbm_ht_create(CBM_SZ_256) : NULL;
if (held) {