Doc of a Function/Method/Class-like definition. */
| 2807 | |
| 2808 | /* Doc of a Function/Method/Class-like definition. */ |
| 2809 | static const char *extract_docstring(CBMExtractCtx *ctx, TSNode node, const char *name) { |
| 2810 | CBMLanguage lang = ctx->language; |
| 2811 | if (lang == CBM_LANG_PERL) { |
| 2812 | const char *pod = pod_doc_by_name(ctx, name); |
| 2813 | if (pod) { |
| 2814 | return pod; |
| 2815 | } |
| 2816 | } |
| 2817 | if (lang == CBM_LANG_GO && |
| 2818 | (doc_kind_is(node, "type_spec") || doc_kind_is(node, "type_alias"))) { |
| 2819 | return doc_go_type(ctx, node); |
| 2820 | } |
| 2821 | const char *doc = doc_for_anchor(ctx, doc_anchor(ctx, node)); |
| 2822 | if (!doc && lang == CBM_LANG_PYTHON) { |
| 2823 | return extract_python_docstring(ctx->arena, node, ctx->source); |
| 2824 | } |
| 2825 | return doc; |
| 2826 | } |
| 2827 | |
| 2828 | /* Doc of a Field, Variable, enum member or Macro (code languages only). */ |
| 2829 | static const char *extract_member_docstring_status(CBMExtractCtx *ctx, TSNode node, |
no test coverage detected