Skip to content

Commit

Permalink
https://github.com/smarty-php/smarty/pull/372#issue-234753751
Browse files Browse the repository at this point in the history
Fix generated lexer code
  • Loading branch information
uwetews committed Jul 21, 2017
1 parent ccaeeca commit f696d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LexerGenerator/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function doLongestMatch($rules, $statename, $ruleindex)
$match = false;
foreach ($yy_yymore_patterns[' . $this->token . '] as $index => $rule) {
if (preg_match(\'/\' . $rule . \'/' . $this->patternFlags . '\',
' . $this->input . ', $yymatches, null, ' . $this->counter . ')) {
' . $this->input . ', $yymatches, 0, ' . $this->counter . ')) {
if (strlen($yysubmatches[0]) < 200) {
$yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
} else {
Expand Down Expand Up @@ -359,7 +359,7 @@ public function doFirstMatch($rules, $statename, $ruleindex)
');
fwrite($this->out, '
do {
if (preg_match($this->yy_global_pattern' . $ruleindex . ',' . $this->input . ', $yymatches, null, ' .
if (preg_match($this->yy_global_pattern' . $ruleindex . ',' . $this->input . ', $yymatches, 0, ' .
$this->counter .
')) {
if (!isset($yymatches[ 0 ][1])) {
Expand Down

0 comments on commit f696d80

Please sign in to comment.