Length of the Javadoc reference at s: a (qualified) type, `#member`, * `module/`, type arguments, array brackets and a parameter list. A parameter * list that does not close takes the rest (the reference is malformed, and * the resolver says so). */
| 333 | * list that does not close takes the rest (the reference is malformed, and |
| 334 | * the resolver says so). */ |
| 335 | static size_t jv_java_ref_len(const char *s, size_t n) { |
| 336 | size_t j = 0; |
| 337 | while (j < n) { |
| 338 | char c = s[j]; |
| 339 | if (jv_ident_char(c) || c == '.' || c == '#' || c == '/') { |
| 340 | j++; |
| 341 | } else if (c == '<') { |
| 342 | size_t e = jv_group_end(s, n, j, '<', '>'); |
| 343 | if (e >= n && (n == 0 || s[n - SKIP_ONE] != '>')) { |
| 344 | break; |
| 345 | } |
| 346 | j = e; |
| 347 | } else if (c == '[' && j + SKIP_ONE < n && s[j + SKIP_ONE] == ']') { |
| 348 | j += PAIR_LEN; |
| 349 | } else { |
| 350 | break; |
| 351 | } |
| 352 | } |
| 353 | if (j < n && s[j] == '(') { |
| 354 | j = jv_group_end(s, n, j, '(', ')'); |
| 355 | } |
| 356 | return j; |
| 357 | } |
| 358 | |
| 359 | /* The reference at s[0, n): what the doc tool reads as one reference. Text |
| 360 | * glued to it (`Foo,`, `http://x`) makes the whole word the (malformed) |
no test coverage detected