-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathevaluation.hpp
528 lines (426 loc) · 21.9 KB
/
evaluation.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#ifndef CTRE__EVALUATION__HPP
#define CTRE__EVALUATION__HPP
#include "flags_and_modes.hpp"
#include "atoms.hpp"
#include "atoms_unicode.hpp"
#include "starts_with_anchor.hpp"
#include "utility.hpp"
#include "return_type.hpp"
#include "find_captures.hpp"
#include "first.hpp"
#include <iterator>
// remove me when MSVC fix the constexpr bug
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__GNUC__)
#ifndef CTRE_MSVC_GREEDY_WORKAROUND
#define CTRE_MSVC_GREEDY_WORKAROUND
#endif
#endif
namespace ctre {
template <size_t Limit> constexpr CTRE_FORCE_INLINE bool less_than_or_infinite(size_t i) {
if constexpr (Limit == 0) {
// infinite
return true;
} else {
return i < Limit;
}
}
template <size_t Limit> constexpr CTRE_FORCE_INLINE bool less_than(size_t i) {
if constexpr (Limit == 0) {
// infinite
return false;
} else {
return i < Limit;
}
}
constexpr bool is_bidirectional(const std::bidirectional_iterator_tag &) { return true; }
constexpr bool is_bidirectional(...) { return false; }
// sink for making the errors shorter
template <typename R, typename Iterator, typename EndIterator>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator, const EndIterator, flags, R, ...) noexcept = delete;
// if we found "accept" object on stack => ACCEPT
template <typename R, typename Iterator, typename EndIterator>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator, const EndIterator, flags, R captures, ctll::list<accept>) noexcept {
return captures.matched();
}
// if we found "reject" object on stack => REJECT
template <typename R, typename... Rest, typename Iterator, typename EndIterator>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator, const EndIterator, flags, R, ctll::list<reject, Rest...>) noexcept {
return not_matched;
}
// mark start of outer capture
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<start_mark, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures.set_start_mark(current), ctll::list<Tail...>());
}
// mark end of outer capture
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<end_mark, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures.set_end_mark(current), ctll::list<Tail...>());
}
// mark end of cycle
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator current, const EndIterator, [[maybe_unused]] const flags & f, R captures, ctll::list<end_cycle_mark>) noexcept {
if (cannot_be_empty_match(f)) {
return not_matched;
}
return captures.set_end_mark(current).matched();
}
// matching everything which behave as a one character matcher
template <typename R, typename Iterator, typename EndIterator, typename CharacterLike, typename... Tail, typename = std::enable_if_t<(MatchesCharacter<CharacterLike>::template value<decltype(*std::declval<Iterator>())>)>>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<CharacterLike, Tail...>) noexcept {
if (current == end) return not_matched;
if (!CharacterLike::match_char(*current)) return not_matched;
return evaluate(begin, ++current, end, consumed_something(f), captures, ctll::list<Tail...>());
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<any, Tail...>) noexcept {
if (current == end) return not_matched;
if (multiline_mode(f)) {
// TODO add support for different line ending and unicode (in a future unicode mode)
if (*current == '\n') return not_matched;
}
return evaluate(begin, ++current, end, consumed_something(f), captures, ctll::list<Tail...>());
}
// matching strings in patterns
template <typename Iterator> struct string_match_result {
Iterator position;
bool match;
};
template <typename CharT, typename Iterator, typename EndIterator> constexpr CTRE_FORCE_INLINE bool compare_character(CharT c, Iterator & it, const EndIterator & end) {
if (it != end) {
using char_type = decltype(*it);
return *it++ == static_cast<char_type>(c);
}
return false;
}
template <auto... String, size_t... Idx, typename Iterator, typename EndIterator> constexpr CTRE_FORCE_INLINE string_match_result<Iterator> evaluate_match_string(Iterator current, [[maybe_unused]] const EndIterator end, std::index_sequence<Idx...>) noexcept {
bool same = (compare_character(String, current, end) && ... && true);
return {current, same};
}
template <typename R, typename Iterator, typename EndIterator, auto... String, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, ctll::list<string<String...>, Tail...>) noexcept {
auto result = evaluate_match_string<String...>(current, end, std::make_index_sequence<sizeof...(String)>());
if (!result.match) {
return not_matched;
}
return evaluate(begin, result.position, end, consumed_something(f, sizeof...(String) > 0), captures, ctll::list<Tail...>());
}
// matching select in patterns
template <typename R, typename Iterator, typename EndIterator, typename HeadOptions, typename... TailOptions, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<select<HeadOptions, TailOptions...>, Tail...>) noexcept {
if (auto r = evaluate(begin, current, end, f, captures, ctll::list<HeadOptions, Tail...>())) {
return r;
} else {
return evaluate(begin, current, end, f, captures, ctll::list<select<TailOptions...>, Tail...>());
}
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator, const EndIterator, flags, R, ctll::list<select<>, Tail...>) noexcept {
// no previous option was matched => REJECT
return not_matched;
}
// matching sequence in patterns
template <typename R, typename Iterator, typename EndIterator, typename HeadContent, typename... TailContent, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<sequence<HeadContent, TailContent...>, Tail...>) noexcept {
if constexpr (sizeof...(TailContent) > 0) {
return evaluate(begin, current, end, f, captures, ctll::list<HeadContent, sequence<TailContent...>, Tail...>());
} else {
return evaluate(begin, current, end, f, captures, ctll::list<HeadContent, Tail...>());
}
}
// matching empty in patterns
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<empty, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
// matching asserts
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<assert_subject_begin, Tail...>) noexcept {
if (begin != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<assert_subject_end, Tail...>) noexcept {
if (end != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<assert_subject_end_line, Tail...>) noexcept {
if (multiline_mode(f)) {
if (end == current) {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else if (*current == '\n' && std::next(current) == end) {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else {
return not_matched;
}
} else {
if (end != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<assert_line_begin, Tail...>) noexcept {
if (multiline_mode(f)) {
if (begin == current) {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else if (*std::prev(current) == '\n') {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else {
return not_matched;
}
} else {
if (begin != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
}
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<assert_line_end, Tail...>) noexcept {
if (multiline_mode(f)) {
if (end == current) {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else if (*current == '\n') {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else {
return not_matched;
}
} else {
if (end != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
// TODO properly match line end
if (end != current) {
return not_matched;
}
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
// matching boundary
template <typename R, typename Iterator, typename EndIterator, typename CharacterLike, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<boundary<CharacterLike>, Tail...>) noexcept {
// reason why I need bidirectional iterators or some clever hack
bool before = false;
bool after = false;
static_assert(is_bidirectional(typename std::iterator_traits<Iterator>::iterator_category{}), "To use boundary in regex you need to provide bidirectional iterator or range.");
if (end != current) {
after = CharacterLike::match_char(*current);
}
if (begin != current) {
before = CharacterLike::match_char(*std::prev(current));
}
if (before == after) return not_matched;
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
// matching not_boundary
template <typename R, typename Iterator, typename EndIterator, typename CharacterLike, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<not_boundary<CharacterLike>, Tail...>) noexcept {
// reason why I need bidirectional iterators or some clever hack
bool before = false;
bool after = false;
static_assert(is_bidirectional(typename std::iterator_traits<Iterator>::iterator_category{}), "To use boundary in regex you need to provide bidirectional iterator or range.");
if (end != current) {
after = CharacterLike::match_char(*current);
}
if (begin != current) {
before = CharacterLike::match_char(*std::prev(current));
}
if (before != after) return not_matched;
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
// lazy repeat
template <typename R, typename Iterator, typename EndIterator, size_t A, size_t B, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, ctll::list<lazy_repeat<A,B,Content...>, Tail...>) noexcept {
if constexpr (B != 0 && A > B) {
return not_matched;
}
const Iterator backup_current = current;
size_t i{0};
while (less_than<A>(i)) {
auto outer_result = evaluate(begin, current, end, not_empty_match(f), captures, ctll::list<Content..., end_cycle_mark>());
if (!outer_result) return not_matched;
captures = outer_result.unmatch();
current = outer_result.get_end_position();
++i;
}
if (auto outer_result = evaluate(begin, current, end, consumed_something(f, backup_current != current), captures, ctll::list<Tail...>())) {
return outer_result;
}
while (less_than_or_infinite<B>(i)) {
auto inner_result = evaluate(begin, current, end, not_empty_match(f), captures, ctll::list<Content..., end_cycle_mark>());
if (!inner_result) return not_matched;
auto outer_result = evaluate(begin, inner_result.get_end_position(), end, consumed_something(f), inner_result.unmatch(), ctll::list<Tail...>());
if (outer_result) {
return outer_result;
}
captures = inner_result.unmatch();
current = inner_result.get_end_position();
++i;
}
// rest of regex
return evaluate(begin, current, end, consumed_something(f), captures, ctll::list<Tail...>());
}
// possessive repeat
template <typename R, typename Iterator, typename EndIterator, size_t A, size_t B, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, ctll::list<possessive_repeat<A,B,Content...>, Tail...>) noexcept {
if constexpr ((B != 0) && (A > B)) {
return not_matched;
}
const auto backup_current = current;
for (size_t i{0}; less_than_or_infinite<B>(i); ++i) {
// try as many of inner as possible and then try outer once
auto inner_result = evaluate(begin, current, end, not_empty_match(f), captures, ctll::list<Content..., end_cycle_mark>());
if (!inner_result) {
if (!less_than<A>(i)) break;
return not_matched;
}
captures = inner_result.unmatch();
current = inner_result.get_end_position();
}
return evaluate(begin, current, end, consumed_something(f, backup_current != current), captures, ctll::list<Tail...>());
}
// (gready) repeat
template <typename R, typename Iterator, typename EndIterator, size_t A, size_t B, typename... Content, typename... Tail>
#ifdef CTRE_MSVC_GREEDY_WORKAROUND
constexpr inline void evaluate_recursive(R & result, size_t i, const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, ctll::list<repeat<A,B,Content...>, Tail...> stack) {
#else
constexpr inline R evaluate_recursive(size_t i, const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, ctll::list<repeat<A,B,Content...>, Tail...> stack) {
#endif
if (less_than_or_infinite<B>(i)) {
// a*ab
// aab
if (auto inner_result = evaluate(begin, current, end, not_empty_match(f), captures, ctll::list<Content..., end_cycle_mark>())) {
// TODO MSVC issue:
// if I uncomment this return it will not fail in constexpr (but the matching result will not be correct)
// return inner_result
// I tried to add all constructors to R but without any success
auto tmp_current = current;
tmp_current = inner_result.get_end_position();
#ifdef CTRE_MSVC_GREEDY_WORKAROUND
evaluate_recursive(result, i+1, begin, tmp_current, end, f, inner_result.unmatch(), stack);
if (result) {
return;
}
#else
if (auto rec_result = evaluate_recursive(i+1, begin, tmp_current, end, f, inner_result.unmatch(), stack)) {
return rec_result;
}
#endif
}
}
#ifdef CTRE_MSVC_GREEDY_WORKAROUND
result = evaluate(begin, current, end, consumed_something(f), captures, ctll::list<Tail...>());
#else
return evaluate(begin, current, end, consumed_something(f), captures, ctll::list<Tail...>());
#endif
}
// (greedy) repeat
template <typename R, typename Iterator, typename EndIterator, size_t A, size_t B, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, [[maybe_unused]] const flags & f, R captures, [[maybe_unused]] ctll::list<repeat<A,B,Content...>, Tail...> stack) {
if constexpr ((B != 0) && (A > B)) {
return not_matched;
}
#ifndef CTRE_DISABLE_GREEDY_OPT
if constexpr (!collides(calculate_first(Content{}...), calculate_first(Tail{}...))) {
return evaluate(begin, current, end, f, captures, ctll::list<possessive_repeat<A,B,Content...>, Tail...>());
}
#endif
// A..B
size_t i{0};
while (less_than<A>(i)) {
auto inner_result = evaluate(begin, current, end, not_empty_match(f), captures, ctll::list<Content..., end_cycle_mark>());
if (!inner_result) return not_matched;
captures = inner_result.unmatch();
current = inner_result.get_end_position();
++i;
}
#ifdef CTRE_MSVC_GREEDY_WORKAROUND
R result;
evaluate_recursive(result, i, begin, current, end, f, captures, stack);
return result;
#else
return evaluate_recursive(i, begin, current, end, f, captures, stack);
#endif
}
// capture (numeric ID)
template <typename R, typename Iterator, typename EndIterator, size_t Id, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<capture<Id, Content...>, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures.template start_capture<Id>(current), ctll::list<sequence<Content...>, numeric_mark<Id>, Tail...>());
}
// capture end mark (numeric and string ID)
template <typename R, typename Iterator, typename EndIterator, size_t Id, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<numeric_mark<Id>, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures.template end_capture<Id>(current), ctll::list<Tail...>());
}
// capture (string ID)
template <typename R, typename Iterator, typename EndIterator, size_t Id, typename Name, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<capture_with_name<Id, Name, Content...>, Tail...>) noexcept {
return evaluate(begin, current, end, f, captures.template start_capture<Id>(current), ctll::list<sequence<Content...>, numeric_mark<Id>, Tail...>());
}
// backreference support (match agains content of iterators)
template <typename Iterator, typename EndIterator> constexpr CTRE_FORCE_INLINE string_match_result<Iterator> match_against_range(Iterator current, const EndIterator end, Iterator range_current, const Iterator range_end, flags) noexcept {
while (end != current && range_end != range_current) {
if (*current == *range_current) {
current++;
range_current++;
} else {
return {current, false};
}
}
return {current, range_current == range_end};
}
// backreference with name
template <typename R, typename Id, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<back_reference_with_name<Id>, Tail...>) noexcept {
if (const auto ref = captures.template get<Id>()) {
if (auto result = match_against_range(current, end, ref.begin(), ref.end(), f); result.match) {
return evaluate(begin, result.position, end, consumed_something(f, ref.begin() != ref.end()), captures, ctll::list<Tail...>());
}
}
return not_matched;
}
// backreference
template <typename R, size_t Id, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<back_reference<Id>, Tail...>) noexcept {
if (const auto ref = captures.template get<Id>()) {
if (auto result = match_against_range(current, end, ref.begin(), ref.end(), f); result.match) {
return evaluate(begin, result.position, end, consumed_something(f, ref.begin() != ref.end()), captures, ctll::list<Tail...>());
}
}
return not_matched;
}
// end of lookahead
template <typename R, typename Iterator, typename EndIterator, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator, Iterator, const EndIterator, flags, R captures, ctll::list<end_lookahead_mark>) noexcept {
// TODO check interaction with non-empty flag
return captures.matched();
}
// lookahead positive
template <typename R, typename Iterator, typename EndIterator, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<lookahead_positive<Content...>, Tail...>) noexcept {
if (auto lookahead_result = evaluate(begin, current, end, f, captures, ctll::list<sequence<Content...>, end_lookahead_mark>())) {
captures = lookahead_result.unmatch();
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
} else {
return not_matched;
}
}
// lookahead negative
template <typename R, typename Iterator, typename EndIterator, typename... Content, typename... Tail>
constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list<lookahead_negative<Content...>, Tail...>) noexcept {
if (auto lookahead_result = evaluate(begin, current, end, f, captures, ctll::list<sequence<Content...>, end_lookahead_mark>())) {
return not_matched;
} else {
return evaluate(begin, current, end, f, captures, ctll::list<Tail...>());
}
}
}
#endif