From 8a97baabcb5d4a52f2c2439ee58535aaa548db4a Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Thu, 8 Oct 2026 01:37:03 +0200 Subject: [PATCH] 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 --- internal/cbm/cbm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cbm/cbm.c b/internal/cbm/cbm.c index 3dab239d9..e0d5cdd61 100644 --- a/internal/cbm/cbm.c +++ b/internal/cbm/cbm.c @@ -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) {