| 208 | `x`. Subranges passed to `f` are non-overlapping. */ |
| 209 | template<typename FwdIter, typename Sentinel, typename T, typename Func> |
| 210 | Func foreach_subrange_of(FwdIter first, Sentinel last, T const & x, Func f) |
| 211 | { |
| 212 | while (first != last) { |
| 213 | first = boost::parser::detail::text::find(first, last, x); |
| 214 | auto const next = boost::parser::detail::text::find_not(first, last, x); |
| 215 | if (first != next) { |
| 216 | f(boost::parser::detail::text::foreach_subrange_range<FwdIter, Sentinel>( |
| 217 | first, next)); |
| 218 | } |
| 219 | first = next; |
| 220 | } |
| 221 | return f; |
| 222 | } |
| 223 | |
| 224 | /** Calls `f(sub)` for each subrange `sub` in `[first, last)`. A subrange |
| 225 | is a contiguous subsequence of elements `ei` for which `p(ei)` is |