Extract docstring from the node's leading comment.
| 1219 | |
| 1220 | // Extract docstring from the node's leading comment. |
| 1221 | static const char *extract_docstring(CBMArena *a, TSNode node, const char *source, |
| 1222 | CBMLanguage lang) { |
| 1223 | if (lang == CBM_LANG_GO) { |
| 1224 | const char *doc = extract_go_type_docstring(a, node, source); |
| 1225 | if (doc) { |
| 1226 | return doc; |
| 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | TSNode prev = ts_node_prev_sibling(node); |
| 1231 | if (!ts_node_is_null(prev) && is_comment_node(ts_node_type(prev))) { |
| 1232 | return extract_comment_text(a, prev, source); |
| 1233 | } |
| 1234 | |
| 1235 | if (lang == CBM_LANG_PYTHON) { |
| 1236 | return extract_python_docstring(a, node, source); |
| 1237 | } |
| 1238 | return NULL; |
| 1239 | } |
| 1240 | |
| 1241 | static TSNode find_jvm_modifiers(TSNode node, CBMLanguage lang); |
| 1242 |
no test coverage detected