Skip to content

Commit

Permalink
Allow internal delim runs to match if both have lengths that are mult…
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Mar 24, 2019
1 parent c1a9f7b commit cc96f31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Delimiter/DelimiterStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected function findMatchingOpener(Delimiter $closer, array $openersBottom, D
$opener = $closer->getPrevious();

while ($opener !== null && $opener !== $stackBottom && $opener !== $openersBottom[$closerChar]) {
$oddMatch = ($closer->canOpen() || $opener->canClose()) && ($opener->getOrigDelims() + $closer->getOrigDelims()) % 3 === 0;
$oddMatch = ($closer->canOpen() || $opener->canClose()) && $closer->getOrigDelims() % 3 !== 0 && ($opener->getOrigDelims() + $closer->getOrigDelims()) % 3 === 0;
if ($opener->getChar() === $closerChar && $opener->canOpen() && !$oddMatch) {
return $opener;
}
Expand Down

0 comments on commit cc96f31

Please sign in to comment.