Matcher/CommentMatcher.php 1 location
|
@@ 71-73 (lines=3) @@
|
| 68 |
|
$regex = $comment[1]; |
| 69 |
|
|
| 70 |
|
if (preg_match_all($regex, $source, $matches, PREG_OFFSET_CAPTURE)) { |
| 71 |
|
foreach ($matches[0] as $match) { |
| 72 |
|
yield $factory->create(['pos' => $match[1], 'length' => strlen($match[0]), 'index' => $i, $name]); |
| 73 |
|
} |
| 74 |
|
} |
| 75 |
|
} |
| 76 |
|
} |
Matcher/RegexMatcher.php 1 location
|
@@ 54-60 (lines=7) @@
|
| 51 |
|
foreach ($matches as $id => $group) { |
| 52 |
|
$name = $this->groups[$id]; |
| 53 |
|
|
| 54 |
|
foreach ($group as $match) { |
| 55 |
|
if (empty($match) || $match[1] === -1) { |
| 56 |
|
continue; |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
yield $factory->create([$name, 'pos' => $match[1], 'length' => strlen($match[0])]); |
| 60 |
|
} |
| 61 |
|
} |
| 62 |
|
} |
| 63 |
|
} |