| 780 | } |
| 781 | |
| 782 | static pr_res_t pr_member(const pr_ctx_t *c, int ti, const pr_ref_t *r) { |
| 783 | pr_search_t s = {.c = c, .name = r->mem, .len = r->mem_len, .owner = CBM_NOT_FOUND}; |
| 784 | s.want = r->prop ? 'p' : r->call ? 'm' : 'c'; |
| 785 | bool hit = pr_search(&s, ti, 0); |
| 786 | if (!hit && s.want == 'c') { |
| 787 | /* `Type::name` without parentheses names a method as often as a |
| 788 | * constant: no constant or case of that name, then a method */ |
| 789 | bool open = s.open; |
| 790 | bool amb = s.amb; |
| 791 | s.want = 'm'; |
| 792 | s.nvisited = 0; |
| 793 | hit = pr_search(&s, ti, 0); |
| 794 | s.open = s.open || open; |
| 795 | s.amb = s.amb || amb; |
| 796 | } |
| 797 | if (hit) { |
| 798 | return pr_member_node(c, &s); |
| 799 | } |
| 800 | return pr_mk(s.amb ? PR_AMBIGUOUS : s.open ? PR_EXTERNAL : PR_MISSING); |
| 801 | } |
| 802 | |
| 803 | /* ── Functions ───────────────────────────────────────────────────── */ |
| 804 |
no test coverage detected