()
| 270 | |
| 271 | // maxCap() walks the regexp to find the maximum capture index. |
| 272 | int maxCap() { |
| 273 | int m = 0; |
| 274 | if (op == Op.CAPTURE) { |
| 275 | m = cap; |
| 276 | } |
| 277 | if (subs != null) { |
| 278 | for (Regexp sub : subs) { |
| 279 | int n = sub.maxCap(); |
| 280 | if (m < n) { |
| 281 | m = n; |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | return m; |
| 286 | } |
| 287 | |
| 288 | @Override |
| 289 | public int hashCode() { |