Where the reference's last segment starts an operator, a conversion or an * indexer: its offset in `s`, or CS_NONE. */
| 3601 | /* Where the reference's last segment starts an operator, a conversion or an |
| 3602 | * indexer: its offset in `s`, or CS_NONE. */ |
| 3603 | static int operator_start(const char *s, char name[CS_OP_NAME]) { |
| 3604 | int depth = 0; |
| 3605 | for (size_t i = 0; s[i]; i++) { |
| 3606 | if ((i == 0 || (s[i - SKIP_ONE] == '.' && depth == 0)) && operator_at(s + i, name)) { |
| 3607 | return (int)i; |
| 3608 | } |
| 3609 | if (is_open_bracket(s[i])) { |
| 3610 | depth++; |
| 3611 | } else if (is_close_bracket(s[i])) { |
| 3612 | depth--; |
| 3613 | } |
| 3614 | } |
| 3615 | return CS_NONE; |
| 3616 | } |
| 3617 | |
| 3618 | /* A doc ID writes a type parameter by its position: `0 (of the type and the |
| 3619 | * types around it), ``0 (of the method). Such a parameter is kept as it |
no test coverage detected