An operator, a conversion or an indexer: of the type the path before it * names, or of the nearest enclosing type that declares one. None has a * node: one that is declared is a graph gap. */
| 5521 | * names, or of the nearest enclosing type that declares one. None has a |
| 5522 | * node: one that is declared is a graph gap. */ |
| 5523 | static cs_res_t resolve_operator(const cs_ctx_t *c, const cs_ref_t *r) { |
| 5524 | if (r->nsegs > 0) { |
| 5525 | cs_tp_t tp = resolve_path(c, r->segs, r->nsegs, true); |
| 5526 | if (tp.st == CS_TP_NS) { |
| 5527 | return namespace_unfound(c, tp.ns); |
| 5528 | } |
| 5529 | if (tp.st != CS_TP_TYPE) { |
| 5530 | return path_unfound(c, &tp); |
| 5531 | } |
| 5532 | return special_declared(c, tp.ent, r->op_name) |
| 5533 | ? res_unres(CBM_DOCLINK_REASON_GRAPH_GAP) |
| 5534 | : member_unfound(c, tp.ent, r->op_name, CS_ARITY_NONE); |
| 5535 | } |
| 5536 | for (int t = c->type; t >= 0; t = c->f->types[t].outer) { |
| 5537 | if (special_declared(c, c->f->types[t].entity, r->op_name)) { |
| 5538 | return res_unres(CBM_DOCLINK_REASON_GRAPH_GAP); |
| 5539 | } |
| 5540 | } |
| 5541 | return c->type >= 0 ? member_unfound(c, c->f->types[c->type].entity, r->op_name, CS_ARITY_NONE) |
| 5542 | : res_unres(CBM_DOCLINK_REASON_MISSING); |
| 5543 | } |
| 5544 | |
| 5545 | /* A doc ID names its target by its full name, from the global namespace: |
| 5546 | * `T:` a type, `N:` a namespace, `M:` `P:` `F:` `E:` a member of the kind |
no test coverage detected