Skip to content

Commit 8a97baa

Browse files
committed
fix(extract): parse the first-branch projection under the terminated-last-line rule
Merging main brought DeusData#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>
1 parent ea2a8f1 commit 8a97baa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎internal/cbm/cbm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,10 +2571,10 @@ static void cbm_rescue_defs_from_projection(CBMExtractCtx *raw_ctx, const TSLang
25712571
TSTree *tree = NULL;
25722572
if (parser) {
25732573
ts_parser_reset(parser);
2574-
CBMStringInput input = {projected, (uint32_t)raw_ctx->source_len};
2575-
TSInput ts_input = {&input, cbm_string_read, TSInputEncodingUTF8, NULL};
25762574
TSParseOptions opts = {0};
2577-
tree = ts_parser_parse_with_options(parser, NULL, ts_input, opts);
2575+
/* The projection keeps the raw source's length and line structure,
2576+
* so it is parsed under the same terminated-last-line rule (#2078). */
2577+
tree = cbm_parse_source(parser, projected, (uint32_t)raw_ctx->source_len, opts);
25782578
}
25792579
CBMHashTable *held = tree ? cbm_ht_create(CBM_SZ_256) : NULL;
25802580
if (held) {

0 commit comments

Comments
 (0)