Extract docstring from the node's leading comment.
| 1268 | |
| 1269 | // Extract docstring from the node's leading comment. |
| 1270 | static const char *extract_docstring(CBMArena *a, TSNode node, const char *source, |
| 1271 | CBMLanguage lang) { |
| 1272 | if (lang == CBM_LANG_GO) { |
| 1273 | const char *doc = extract_go_type_docstring(a, node, source); |
| 1274 | if (doc) { |
| 1275 | return doc; |
| 1276 | } |
| 1277 | } |
| 1278 | |
| 1279 | TSNode prev = ts_node_prev_sibling(node); |
| 1280 | if (!ts_node_is_null(prev) && is_comment_node(ts_node_type(prev))) { |
| 1281 | return extract_comment_text(a, prev, source); |
| 1282 | } |
| 1283 | |
| 1284 | if (lang == CBM_LANG_PYTHON) { |
| 1285 | return extract_python_docstring(a, node, source); |
| 1286 | } |
| 1287 | return NULL; |
| 1288 | } |
| 1289 | |
| 1290 | static TSNode find_jvm_modifiers(TSNode node, CBMLanguage lang); |
| 1291 |
no test coverage detected