The Module def spans the whole file, and its end line follows the line * convention for a terminated last line (#1967), so it is compared on its own * rather than through the dump. */
| 1715 | * convention for a terminated last line (#1967), so it is compared on its own |
| 1716 | * rather than through the dump. */ |
| 1717 | static char *dump_extraction(const CBMFileResult *r) { |
| 1718 | dump_buf_t b = {(char *)calloc(1u << 16, 1), 1u << 16, 0}; |
| 1719 | if (!b.buf) { |
| 1720 | return NULL; |
| 1721 | } |
| 1722 | for (int i = 0; i < r->defs.count; i++) { |
| 1723 | const CBMDefinition *d = &r->defs.items[i]; |
| 1724 | if (d->label && strcmp(d->label, "Module") == 0) { |
| 1725 | continue; |
| 1726 | } |
| 1727 | dump_str(&b, "\nD", d->qualified_name); |
| 1728 | dump_str(&b, "name", d->name); |
| 1729 | dump_str(&b, "label", d->label); |
| 1730 | dump_num(&b, "start", d->start_line); |
| 1731 | dump_num(&b, "end", d->end_line); |
| 1732 | dump_num(&b, "lines", d->lines); |
| 1733 | dump_num(&b, "cx", d->complexity); |
| 1734 | dump_num(&b, "params", d->param_count); |
| 1735 | dump_str(&b, "sig", d->signature); |
| 1736 | dump_str(&b, "ret", d->return_type); |
| 1737 | dump_str(&b, "doc", d->docstring); |
| 1738 | dump_str(&b, "prof", d->structural_profile); |
| 1739 | dump_str(&b, "tok", d->body_tokens); |
| 1740 | } |
| 1741 | for (int i = 0; i < r->calls.count; i++) { |
| 1742 | const CBMCall *c = &r->calls.items[i]; |
| 1743 | dump_str(&b, "\nC", c->callee_name); |
| 1744 | dump_str(&b, "in", c->enclosing_func_qn); |
| 1745 | dump_num(&b, "line", c->start_line); |
| 1746 | dump_num(&b, "from", (long)c->site_start_byte); |
| 1747 | dump_num(&b, "to", (long)c->site_end_byte); |
| 1748 | dump_num(&b, "args", c->arg_count); |
| 1749 | } |
| 1750 | for (int i = 0; i < r->imports.count; i++) { |
| 1751 | dump_str(&b, "\nI", r->imports.items[i].local_name); |
| 1752 | dump_str(&b, "path", r->imports.items[i].module_path); |
| 1753 | } |
| 1754 | dump_str(&b, "\nP", r->error_ranges); |
| 1755 | dump_num(&b, "partial", r->parse_incomplete); |
| 1756 | dump_num(&b, "unusable", r->parse_unusable); |
| 1757 | dump_str(&b, "", "\n"); |
| 1758 | return b.buf; |
| 1759 | } |
| 1760 | |
| 1761 | static uint32_t module_end_line(const CBMFileResult *r) { |
| 1762 | for (int i = 0; i < r->defs.count; i++) { |
no test coverage detected