blob: 4d718d593a1176414ef34fd0637f95280abca526 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <iostream>
#include "Piraha.hpp"
using namespace piraha;
bool Multi::match(Matcher *m) {
unsigned int save;
int iter = 0;
while(true) {
save = m->pos;
if(!pattern->match(m))
break;
if(save-m->pos == 0)
return minv <= iter && iter <= maxv;
iter++;
}
m->pos = save;
return minv <= iter && iter <= maxv;
}
|