mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-02 07:53:41 +08:00
fix(extraction): parse C++ branch views under the terminated-last-line rule
Merging main brought extract_cpp_branch_views (conditional variants), which built its CBMStringInput with the two-field initializer. With this branch's virtual_newline field that is a missing initializer, an error under GCC's -Wextra -Werror (the shadow job's product build). A branch view keeps the raw source's length and line structure, so it now goes through cbm_parse_source like the raw parse: the same virtual newline, and the same edit that removes it again. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
+3
-3
@@ -2267,8 +2267,6 @@ static void extract_cpp_branch_views(const CBMExtractCtx *raw, const TSLanguage
|
||||
return;
|
||||
}
|
||||
ts_parser_reset(parser);
|
||||
CBMStringInput input = {view, (uint32_t)raw->source_len};
|
||||
TSInput ts_input = {&input, cbm_string_read, TSInputEncodingUTF8, NULL};
|
||||
TSParseOptions opts = {0};
|
||||
CBMParseBudget budget = {0}; // cppcheck-suppress unreadVariable
|
||||
if (timeout_micros > 0) {
|
||||
@@ -2278,7 +2276,9 @@ static void extract_cpp_branch_views(const CBMExtractCtx *raw, const TSLanguage
|
||||
opts.payload = &budget;
|
||||
opts.progress_callback = cbm_timeout_cb;
|
||||
}
|
||||
TSTree *tree = ts_parser_parse_with_options(parser, NULL, ts_input, opts);
|
||||
/* A view keeps the raw source's length and line structure, so it is
|
||||
* parsed under the same terminated-last-line rule (#2078). */
|
||||
TSTree *tree = cbm_parse_source(parser, view, (uint32_t)raw->source_len, opts);
|
||||
if (!tree) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user