Skip to content

Commit d258457

Browse files
RazeSoldierMatmaRex
authored andcommitted
Use "break" instead of "continue" inside a switch
"continue" statements in a switch are equivalent to "break". In PHP 7.3, will generate a warning. Also change the indentation. Bug: T206977 Change-Id: I8ad0ef6508e73bcca7dabfe2e88d661dd409bdfb
1 parent b2eacc0 commit d258457

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

includes/ExprParser.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -236,41 +236,41 @@ public function doExpression( $expr ) {
236236
}
237237
$op = $this->words[$word];
238238
switch ( $op ) {
239-
// constant
240-
case EXPR_EXPONENT:
241-
if ( $expecting !== 'expression' ) {
242-
continue;
243-
}
244-
$operands[] = exp( 1 );
245-
$expecting = 'operator';
246-
continue 2;
247-
case EXPR_PI:
248-
if ( $expecting !== 'expression' ) {
249-
throw new ExprError( 'unexpected_number' );
250-
}
251-
$operands[] = pi();
252-
$expecting = 'operator';
253-
continue 2;
254-
// Unary operator
255-
case EXPR_NOT:
256-
case EXPR_SINE:
257-
case EXPR_COSINE:
258-
case EXPR_TANGENS:
259-
case EXPR_ARCSINE:
260-
case EXPR_ARCCOS:
261-
case EXPR_ARCTAN:
262-
case EXPR_EXP:
263-
case EXPR_LN:
264-
case EXPR_ABS:
265-
case EXPR_FLOOR:
266-
case EXPR_TRUNC:
267-
case EXPR_CEIL:
268-
case EXPR_SQRT:
269-
if ( $expecting !== 'expression' ) {
270-
throw new ExprError( 'unexpected_operator', $word );
271-
}
272-
$operators[] = $op;
273-
continue 2;
239+
// constant
240+
case EXPR_EXPONENT:
241+
if ( $expecting !== 'expression' ) {
242+
break;
243+
}
244+
$operands[] = exp( 1 );
245+
$expecting = 'operator';
246+
continue 2;
247+
case EXPR_PI:
248+
if ( $expecting !== 'expression' ) {
249+
throw new ExprError( 'unexpected_number' );
250+
}
251+
$operands[] = pi();
252+
$expecting = 'operator';
253+
continue 2;
254+
// Unary operator
255+
case EXPR_NOT:
256+
case EXPR_SINE:
257+
case EXPR_COSINE:
258+
case EXPR_TANGENS:
259+
case EXPR_ARCSINE:
260+
case EXPR_ARCCOS:
261+
case EXPR_ARCTAN:
262+
case EXPR_EXP:
263+
case EXPR_LN:
264+
case EXPR_ABS:
265+
case EXPR_FLOOR:
266+
case EXPR_TRUNC:
267+
case EXPR_CEIL:
268+
case EXPR_SQRT:
269+
if ( $expecting !== 'expression' ) {
270+
throw new ExprError( 'unexpected_operator', $word );
271+
}
272+
$operators[] = $op;
273+
continue 2;
274274
}
275275
// Binary operator, fall through
276276
$name = $word;

0 commit comments

Comments
 (0)