Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -110,19 +110,19 @@ if ( ! class_exists( 'Plural_Forms', false ) ) :
|
||||
// Ignore whitespace.
|
||||
case ' ':
|
||||
case "\t":
|
||||
$pos++;
|
||||
++$pos;
|
||||
break;
|
||||
|
||||
// Variable (n).
|
||||
case 'n':
|
||||
$output[] = array( 'var' );
|
||||
$pos++;
|
||||
++$pos;
|
||||
break;
|
||||
|
||||
// Parentheses.
|
||||
case '(':
|
||||
$stack[] = $next;
|
||||
$pos++;
|
||||
++$pos;
|
||||
break;
|
||||
|
||||
case ')':
|
||||
@@ -144,7 +144,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) :
|
||||
throw new Exception( 'Mismatched parentheses' );
|
||||
}
|
||||
|
||||
$pos++;
|
||||
++$pos;
|
||||
break;
|
||||
|
||||
// Operators.
|
||||
@@ -189,7 +189,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) :
|
||||
$o2 = $stack[ $s_pos ];
|
||||
if ( '?' !== $o2 ) {
|
||||
$output[] = array( 'op', array_pop( $stack ) );
|
||||
$s_pos--;
|
||||
--$s_pos;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) :
|
||||
if ( ! $found ) {
|
||||
throw new Exception( 'Missing starting "?" ternary operator' );
|
||||
}
|
||||
$pos++;
|
||||
++$pos;
|
||||
break;
|
||||
|
||||
// Default - number or invalid.
|
||||
@@ -264,7 +264,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) :
|
||||
$total = count( $this->tokens );
|
||||
while ( $i < $total ) {
|
||||
$next = $this->tokens[ $i ];
|
||||
$i++;
|
||||
++$i;
|
||||
if ( 'var' === $next[0] ) {
|
||||
$stack[] = $n;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user