| 463 | } |
| 464 | |
| 465 | static int tokenize_node(const cbm_gbuf_node_t *n, const cbm_gbuf_t *gbuf, char **tokens, |
| 466 | int max_tokens) { |
| 467 | int count = 0; |
| 468 | count += cbm_sem_tokenize(n->name, tokens + count, max_tokens - count); |
| 469 | if (n->qualified_name && count < max_tokens) { |
| 470 | count += cbm_sem_tokenize(n->qualified_name, tokens + count, max_tokens - count); |
| 471 | } |
| 472 | if (n->file_path && count < max_tokens) { |
| 473 | count += cbm_sem_tokenize(n->file_path, tokens + count, max_tokens - count); |
| 474 | } |
| 475 | if (n->properties_json) { |
| 476 | count = |
| 477 | tokenize_json_string_field(n->properties_json, "signature", tokens, count, max_tokens); |
| 478 | count = tokenize_json_string_field(n->properties_json, "return_type", tokens, count, |
| 479 | max_tokens); |
| 480 | count = |
| 481 | tokenize_json_string_field(n->properties_json, "docstring", tokens, count, max_tokens); |
| 482 | count = |
| 483 | tokenize_json_array_field(n->properties_json, "param_names", tokens, count, max_tokens); |
| 484 | count = |
| 485 | tokenize_json_array_field(n->properties_json, "param_types", tokens, count, max_tokens); |
| 486 | count = |
| 487 | tokenize_json_array_field(n->properties_json, "decorators", tokens, count, max_tokens); |
| 488 | count = tokenize_json_string_field(n->properties_json, "bt", tokens, count, max_tokens); |
| 489 | } |
| 490 | count = tokenize_call_neighbors(n, gbuf, /*outbound=*/true, tokens, count, max_tokens); |
| 491 | |
| 492 | /* Caller names: what CALLS this function (contextual vocabulary). |
| 493 | * Functions called by error handlers inherit "error" context. */ |
| 494 | count = tokenize_call_neighbors(n, gbuf, /*outbound=*/false, tokens, count, max_tokens); |
| 495 | return count; |
| 496 | } |
| 497 | |
| 498 | /* ── Build per-function semantic data ────────────────────────────── */ |
| 499 |
no test coverage detected