`\(\s*(?:\w+\s+)*\*\s*(\w+)\s*\)\s*\(` matched at `open` (which must hold `(`). Returns (name_range, end_after_second_paren). The `(?:\w+\s+)*` group is greedy without backtracking: giving back an iteration repositions `\*` onto a word char, which can never match, so greedy ≡ backtracked.
(s: &[u8], open: usize)
| 303 | /// `(`). Returns (name_range, end_after_second_paren). The `(?:\w+\s+)*` |
| 304 | /// group is greedy without backtracking: giving back an iteration repositions |
| 305 | /// `\*` onto a word char, which can never match, so greedy ≡ backtracked. |
| 306 | fn fnptr_paren_tail(s: &[u8], open: usize) -> Option<((usize, usize), usize)> { |
| 307 | let mut i = skip_jsws(s, open + 1); |
| 308 | loop { |
| 309 | if !is_word_at(s, i) { |
| 310 | break; |
| 311 | } |
| 312 | let we = word_end(s, i); |
| 313 | let wse = skip_jsws(s, we); |
| 314 | if wse == we { |
| 315 | break; // \w+ not followed by \s+ — the iteration fails, word not consumed |
| 316 | } |
| 317 | i = wse; |
| 318 | } |
| 319 | if s.get(i) != Some(&b'*') { |
| 320 | return None; |
| 321 | } |
| 322 | i = skip_jsws(s, i + 1); |
| 323 | if !is_word_at(s, i) { |
| 324 | return None; |
| 325 | } |
| 326 | let name = (i, word_end(s, i)); |
| 327 | i = skip_jsws(s, name.1); |
| 328 | if s.get(i) != Some(&b')') { |
| 329 | return None; |
| 330 | } |
| 331 | i = skip_jsws(s, i + 1); |
| 332 | if s.get(i) != Some(&b'(') { |
| 333 | return None; |
| 334 | } |
| 335 | Some((name, i + 1)) |
| 336 | } |
| 337 | |
| 338 | /// `\s*\)?\s*\(` at `i` → position after the `(`. The optional `)` needs no |
no test coverage detected