| 1 |
import imports.link14074z; |
| 2 |
|
| 3 |
void replaceAllWith(RE)(RE re) |
| 4 |
if (is(RE == S!()) || true) |
| 5 |
{ |
| 6 |
auto m = RegexMatch!()(re); |
| 7 |
} |
| 8 |
|
| 9 |
struct RegexMatch() |
| 10 |
{ |
| 11 |
this(RE)(RE prog) |
| 12 |
{ |
| 13 |
enum x = is(RE == S!()); |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
struct S() // StaticRegex |
| 18 |
{ |
| 19 |
alias Matcher = BTM!(); |
| 20 |
alias M = Matcher!(); |
| 21 |
} |
| 22 |
|
| 23 |
struct Input() |
| 24 |
{ |
| 25 |
struct L |
| 26 |
{ |
| 27 |
auto loopBack() |
| 28 |
{ |
| 29 |
return Input(); |
| 30 |
} |
| 31 |
} |
| 32 |
auto loopBack() |
| 33 |
{ |
| 34 |
return L(); |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
template BTM() // BacktrackingMatcher |
| 39 |
{ |
| 40 |
struct BTM(Stream = Input!()) |
| 41 |
{ |
| 42 |
Stream s; |
| 43 |
dchar front; |
| 44 |
|
| 45 |
this(Stream stream) |
| 46 |
{ |
| 47 |
} |
| 48 |
|
| 49 |
auto bwdMatcher(ref BTM matcher) |
| 50 |
{ |
| 51 |
alias BMTempl = .BTM!(); |
| 52 |
alias BM = BMTempl!(typeof(s.loopBack())); |
| 53 |
auto m = BM(s.loopBack()); |
| 54 |
} |
| 55 |
} |
| 56 |
} |