Extract comment text, truncating to MAX_COMMENT_LEN.
| 1169 | |
| 1170 | // Extract comment text, truncating to MAX_COMMENT_LEN. |
| 1171 | static char *extract_comment_text(CBMArena *a, TSNode node, const char *source) { |
| 1172 | char *text = cbm_node_text(a, node, source); |
| 1173 | if (text && strlen(text) > MAX_COMMENT_LEN) { |
| 1174 | text[MAX_COMMENT_LEN] = '\0'; |
| 1175 | } |
| 1176 | return text; |
| 1177 | } |
| 1178 | |
| 1179 | // Go-specific: type_spec/type_alias comment is before the parent type_declaration. |
| 1180 | static const char *extract_go_type_docstring(CBMArena *a, TSNode node, const char *source) { |
no test coverage detected