diff --git a/files/parser.php b/files/parser.php index b6dd7cb..a2c8447 100644 --- a/files/parser.php +++ b/files/parser.php @@ -1,4 +1,6 @@ -status = $status; } @@ -1426,8 +1430,11 @@ function phvolt_Trace(/* stream */ $TraceFILE, string $zTracePrompt = '') { $this->yyTraceFILE = $TraceFILE; $this->yyTracePrompt = $zTracePrompt; - if ($this->yyTraceFILE === null) $this->yyTracePrompt = null; - else if ($this->yyTracePrompt === null) $this->yyTraceFILE = null; + if ($this->yyTraceFILE === null) { + $this->yyTracePrompt = null; + } elseif ($this->yyTracePrompt === null) { + $this->yyTraceFILE = null; + } } /* For tracing shifts, the names of all terminals and nonterminals @@ -1998,8 +2005,9 @@ private function yy_pop_parser_stack() */ function __destruct() { - while ($this->yyidx >= 0) + while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); + } } /* @@ -2023,12 +2031,18 @@ private function yy_find_shift_action($iLookAhead) $i += $iLookAhead; if ($i < 0 || $i >= count(self::$yy_action) || self::$yy_lookahead[$i] != $iLookAhead) { if ($iLookAhead > 0) { - if (isset(self::$yyFallback[$iLookAhead]) && - ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { + if ( + isset(self::$yyFallback[$iLookAhead]) && + ($iFallback = self::$yyFallback[$iLookAhead]) != 0 + ) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sFALLBACK %s => %s\n", - $this->yyTracePrompt, self::$yyTokenName[$iLookAhead], - self::$yyTokenName[$iFallback]); + fprintf( + $this->yyTraceFILE, + "%sFALLBACK %s => %s\n", + $this->yyTracePrompt, + self::$yyTokenName[$iLookAhead], + self::$yyTokenName[$iFallback] + ); } return $this->yy_find_shift_action($iFallback); } @@ -2050,10 +2064,11 @@ private function yy_find_shift_action($iLookAhead) private function yy_find_reduce_action( $stateno, /* Current state number */ $iLookAhead /* The look-ahead token */ - ) - { - if ($stateno > self::YY_REDUCE_MAX || - ($i = self::$yy_reduce_ofst[$stateno]) == self::YY_REDUCE_USE_DFLT) { + ) { + if ( + $stateno > self::YY_REDUCE_MAX || + ($i = self::$yy_reduce_ofst[$stateno]) == self::YY_REDUCE_USE_DFLT + ) { return self::$yy_default[$stateno]; } if ($iLookAhead == self::YYNOCODE) { @@ -2074,13 +2089,12 @@ private function yy_shift( $yyNewState, /* The new state to shift in */ $yyMajor, /* The major token to shift in */ $yypMinor /* Pointer ot the minor token to shift in */ - ) - { + ) { $this->yyidx++; if (isset($this->yystack[$this->yyidx])) { $yytos = $this->yystack[$this->yyidx]; } else { - $yytos = new phvolt_yyStackEntry; + $yytos = new phvolt_yyStackEntry(); $this->yystack[$this->yyidx] = $yytos; } @@ -2294,8 +2308,6 @@ private function yy_reduce(int $yyruleno): void ** break; */ case 0: - $this->output = $yymsp->minor; - break; case 1: case 4: case 5: @@ -2323,17 +2335,31 @@ private function yy_reduce(int $yyruleno): void $this->output = $yymsp->minor; break; case 2: - phvolt_ret_zval_list($this->output, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); + phvolt_ret_zval_list( + $this->output, + $this->yystack[$this->yyidx + -1]->minor, + $this->yystack[$this->yyidx + 0]->minor, + ); break; case 3: case 43: case 55: case 141: case 148: - phvolt_ret_zval_list($this->output, NULL, $this->yystack[$this->yyidx + 0]->minor); + phvolt_ret_zval_list( + $this->output, + null, + $this->yystack[$this->yyidx + 0]->minor, + ); break; case 26: - phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor, NULL, $this->status->getState()); + phvolt_ret_if_statement( + $this->output, + $this->yystack[$this->yyidx + -5]->minor, + $this->yystack[$this->yyidx + -3]->minor, + null, + $this->status->getState(), + ); $this->yy_destructor(1, $this->yystack[$this->yyidx + -7]->minor); $this->yy_destructor(31, $this->yystack[$this->yyidx + -6]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + -4]->minor); @@ -2342,7 +2368,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 27: - phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, NULL, NULL, $this->status->getState()); + phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, null, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); $this->yy_destructor(31, $this->yystack[$this->yyidx + -5]->minor); @@ -2365,7 +2391,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 29: - phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -8]->minor, $this->yystack[$this->yyidx + -6]->minor, NULL, $this->status->getState()); + phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -8]->minor, $this->yystack[$this->yyidx + -6]->minor, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -10]->minor); $this->yy_destructor(31, $this->yystack[$this->yyidx + -9]->minor); @@ -2378,7 +2404,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 30: - phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, NULL, NULL, $this->status->getState()); + phvolt_ret_if_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, null, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -9]->minor); $this->yy_destructor(31, $this->yystack[$this->yyidx + -8]->minor); @@ -2405,7 +2431,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 33: - phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, NULL, $this->yystack[$this->yyidx + -5]->minor, NULL, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, null, $this->yystack[$this->yyidx + -5]->minor, null, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -9]->minor); $this->yy_destructor(37, $this->yystack[$this->yyidx + -8]->minor); @@ -2416,7 +2442,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 34: - phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -9]->minor, NULL, $this->yystack[$this->yyidx + -7]->minor, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -9]->minor, null, $this->yystack[$this->yyidx + -7]->minor, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -11]->minor); $this->yy_destructor(37, $this->yystack[$this->yyidx + -10]->minor); @@ -2428,7 +2454,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 35: - phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, $this->yystack[$this->yyidx + -9]->minor, $this->yystack[$this->yyidx + -5]->minor, NULL, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + phvolt_ret_for_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, $this->yystack[$this->yyidx + -9]->minor, $this->yystack[$this->yyidx + -5]->minor, null, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -11]->minor); $this->yy_destructor(37, $this->yystack[$this->yyidx + -10]->minor); @@ -2465,14 +2491,14 @@ private function yy_reduce(int $yyruleno): void case 38: #line 332 "parser.php.lemon" { - phvolt_ret_switch_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, NULL, $this->status->getState()); + phvolt_ret_switch_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); $this->yy_destructor(40, $this->yystack[$this->yyidx + -5]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(41, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1787 "parser.php.php" break; case 39: @@ -2482,17 +2508,17 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(42, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1797 "parser.php.php" break; case 40: #line 342 "parser.php.lemon" { - phvolt_ret_case_clause($this->output, NULL, $this->status->getState()); + phvolt_ret_case_clause($this->output, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(43, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1807 "parser.php.php" break; case 41: @@ -2502,7 +2528,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(44, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1817 "parser.php.php" break; case 42: @@ -2514,7 +2540,7 @@ private function yy_reduce(int $yyruleno): void phvolt_ret_zval_list($this->output, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); $this->yy_destructor(2, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1828 "parser.php.php" break; case 44: @@ -2522,7 +2548,7 @@ private function yy_reduce(int $yyruleno): void { phvolt_ret_set_assignment($this->output, $this->yystack[$this->yyidx + -2]->minor, Compiler::PHVOLT_T_ASSIGN, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); $this->yy_destructor(45, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1836 "parser.php.php" break; case 45: @@ -2530,7 +2556,7 @@ private function yy_reduce(int $yyruleno): void { phvolt_ret_set_assignment($this->output, $this->yystack[$this->yyidx + -2]->minor, Compiler::PHVOLT_T_ADD_ASSIGN, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); $this->yy_destructor(46, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1844 "parser.php.php" break; case 46: @@ -2538,7 +2564,7 @@ private function yy_reduce(int $yyruleno): void { phvolt_ret_set_assignment($this->output, $this->yystack[$this->yyidx + -2]->minor, Compiler::PHVOLT_T_SUB_ASSIGN, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); $this->yy_destructor(47, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1852 "parser.php.php" break; case 47: @@ -2546,7 +2572,7 @@ private function yy_reduce(int $yyruleno): void { phvolt_ret_set_assignment($this->output, $this->yystack[$this->yyidx + -2]->minor, Compiler::PHVOLT_T_MUL_ASSIGN, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); $this->yy_destructor(48, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1860 "parser.php.php" break; case 48: @@ -2554,7 +2580,7 @@ private function yy_reduce(int $yyruleno): void { phvolt_ret_set_assignment($this->output, $this->yystack[$this->yyidx + -2]->minor, Compiler::PHVOLT_T_DIV_ASSIGN, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); $this->yy_destructor(49, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1868 "parser.php.php" break; case 49: @@ -2568,25 +2594,25 @@ private function yy_reduce(int $yyruleno): void case 133: #line 382 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAYACCESS, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAYACCESS, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, null, $this->status->getState()); $this->yy_destructor(24, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1888 "parser.php.php" break; case 51: case 122: #line 386 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DOT, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DOT, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(30, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 1897 "parser.php.php" break; case 52: #line 390 "parser.php.lemon" { - phvolt_ret_macro_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, NULL, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + phvolt_ret_macro_statement($this->output, $this->yystack[$this->yyidx + -7]->minor, null, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -9]->minor); $this->yy_destructor(51, $this->yystack[$this->yyidx + -8]->minor); $this->yy_destructor(29, $this->yystack[$this->yyidx + -6]->minor); @@ -2595,7 +2621,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(53, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1912 "parser.php.php" break; case 53: @@ -2610,76 +2636,48 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(53, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 1927 "parser.php.php" break; case 56: #line 406 "parser.php.lemon" { - phvolt_ret_macro_parameter($this->output, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - } + phvolt_ret_macro_parameter($this->output, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + } #line 1934 "parser.php.php" break; case 57: -#line 410 "parser.php.lemon" - { - phvolt_ret_macro_parameter($this->output, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -1]->minor); - } -#line 1942 "parser.php.php" + phvolt_ret_macro_parameter($this->output, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); + $this->yy_destructor(45, $this->yystack[$this->yyidx + -1]->minor); break; case 58: case 72: case 138: case 152: -#line 414 "parser.php.lemon" - { - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_INTEGER, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); - - } -#line 1952 "parser.php.php" + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_INTEGER, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); break; case 59: case 153: -#line 418 "parser.php.lemon" - { - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_STRING, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); - - } -#line 1960 "parser.php.php" + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_STRING, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); break; case 60: case 154: - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_DOUBLE, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_DOUBLE, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); break; case 61: case 155: -#line 426 "parser.php.lemon" - { - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_NULL, NULL, $this->status->getState()); - - $this->yy_destructor(57, $this->yystack[$this->yyidx + 0]->minor); - } -#line 1977 "parser.php.php" + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_NULL, null, $this->status->getState()); + $this->yy_destructor(57, $this->yystack[$this->yyidx + 0]->minor); break; case 62: case 156: -#line 430 "parser.php.lemon" - { - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_FALSE, NULL, $this->status->getState()); - $this->yy_destructor(58, $this->yystack[$this->yyidx + 0]->minor); - } -#line 1986 "parser.php.php" + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_FALSE, null, $this->status->getState()); + $this->yy_destructor(58, $this->yystack[$this->yyidx + 0]->minor); break; case 63: case 157: -#line 434 "parser.php.lemon" - { - phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_TRUE, NULL, $this->status->getState()); - - $this->yy_destructor(59, $this->yystack[$this->yyidx + 0]->minor); - } -#line 1995 "parser.php.php" + phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_TRUE, null, $this->status->getState()); + $this->yy_destructor(59, $this->yystack[$this->yyidx + 0]->minor); break; case 64: #line 438 "parser.php.lemon" @@ -2694,13 +2692,13 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(61, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2010 "parser.php.php" break; case 65: #line 442 "parser.php.lemon" { - phvolt_ret_macro_call_statement($this->output, $this->yystack[$this->yyidx + -6]->minor, NULL, NULL, $this->status->getState()); + phvolt_ret_macro_call_statement($this->output, $this->yystack[$this->yyidx + -6]->minor, null, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -8]->minor); $this->yy_destructor(60, $this->yystack[$this->yyidx + -7]->minor); @@ -2710,7 +2708,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(61, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2025 "parser.php.php" break; case 66: @@ -2719,7 +2717,7 @@ private function yy_reduce(int $yyruleno): void phvolt_ret_empty_statement($this->output, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2034 "parser.php.php" break; case 67: @@ -2737,33 +2735,29 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(65, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2056 "parser.php.php" break; case 69: -#line 458 "parser.php.lemon" - { - phvolt_ret_block_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, NULL, $this->status->getState()); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); - $this->yy_destructor(64, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(65, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2069 "parser.php.php" + phvolt_ret_block_statement($this->output, $this->yystack[$this->yyidx + -4]->minor, null, $this->status->getState()); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); + $this->yy_destructor(64, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(65, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 70: #line 462 "parser.php.lemon" { - phvolt_ret_cache_statement($this->output, $this->yystack[$this->yyidx + -5]->minor, NULL, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + phvolt_ret_cache_statement($this->output, $this->yystack[$this->yyidx + -5]->minor, null, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -7]->minor); $this->yy_destructor(66, $this->yystack[$this->yyidx + -6]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + -4]->minor); $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(67, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2082 "parser.php.php" break; case 71: @@ -2776,52 +2770,44 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(67, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2095 "parser.php.php" break; case 74: -#line 478 "parser.php.lemon" - { - phvolt_ret_raw_statement($this->output, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); - $this->yy_destructor(68, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(69, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2108 "parser.php.php" + phvolt_ret_raw_statement($this->output, $this->yystack[$this->yyidx + -3]->minor, $this->status->getState()); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -6]->minor); + $this->yy_destructor(68, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(69, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 75: -#line 482 "parser.php.lemon" - { - phvolt_ret_extends_statement($this->output, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(70, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2118 "parser.php.php" + phvolt_ret_extends_statement( + $this->output, + $this->yystack[$this->yyidx - 1]->minor, + $this->status->getState(), + ); + $this->yy_destructor(1, $this->yystack[$this->yyidx - 3]->minor); + $this->yy_destructor(70, $this->yystack[$this->yyidx - 2]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx]->minor); break; case 76: #line 486 "parser.php.lemon" { - phvolt_ret_include_statement($this->output, $this->yystack[$this->yyidx + -1]->minor, NULL, $this->status->getState()); + phvolt_ret_include_statement($this->output, $this->yystack[$this->yyidx + -1]->minor, null, $this->status->getState()); $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(71, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2128 "parser.php.php" break; case 77: -#line 490 "parser.php.lemon" - { - phvolt_ret_include_statement($this->output, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(71, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(72, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2139 "parser.php.php" + phvolt_ret_include_statement($this->output, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(71, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(72, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 78: #line 494 "parser.php.lemon" @@ -2830,7 +2816,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(73, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2149 "parser.php.php" break; case 79: @@ -2840,7 +2826,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(74, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2159 "parser.php.php" break; case 80: @@ -2854,7 +2840,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(76, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2173 "parser.php.php" break; case 81: @@ -2868,7 +2854,7 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(76, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2187 "parser.php.php" break; case 82: @@ -2878,18 +2864,14 @@ private function yy_reduce(int $yyruleno): void $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(77, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2197 "parser.php.php" break; case 83: -#line 514 "parser.php.lemon" - { - phvolt_ret_continue_statement($this->output, $this->status->getState()); - $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(78, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2207 "parser.php.php" + phvolt_ret_continue_statement($this->output, $this->status->getState()); + $this->yy_destructor(1, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(78, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(32, $this->yystack[$this->yyidx + 0]->minor); break; case 84: phvolt_ret_literal_zval($this->output, Compiler::PHVOLT_T_RAW_FRAGMENT, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); @@ -2897,399 +2879,247 @@ private function yy_reduce(int $yyruleno): void case 85: #line 522 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MINUS, NULL, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MINUS, null, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(22, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2222 "parser.php.php" break; case 86: #line 526 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_PLUS, NULL, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_PLUS, null, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(21, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2230 "parser.php.php" break; case 87: #line 530 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_SUB, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_SUB, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(22, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2238 "parser.php.php" break; case 88: #line 534 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ADD, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ADD, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(21, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2246 "parser.php.php" break; case 89: #line 538 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MUL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MUL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(19, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2254 "parser.php.php" break; case 90: #line 542 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_POW, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_POW, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(19, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(19, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2263 "parser.php.php" break; case 91: #line 546 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DIV, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DIV, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); $this->yy_destructor(18, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2271 "parser.php.php" break; case 92: -#line 550 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MOD, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(18, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(18, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2280 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MOD, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(18, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(18, $this->yystack[$this->yyidx + -1]->minor); break; case 93: -#line 554 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MOD, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(20, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2288 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_MOD, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(20, $this->yystack[$this->yyidx + -1]->minor); break; case 94: -#line 558 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_AND, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(6, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2296 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_AND, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(6, $this->yystack[$this->yyidx + -1]->minor); break; case 95: -#line 562 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_OR, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(7, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2304 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_OR, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(7, $this->yystack[$this->yyidx + -1]->minor); break; case 96: -#line 566 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_CONCAT, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(23, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2312 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_CONCAT, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(23, $this->yystack[$this->yyidx + -1]->minor); break; case 97: -#line 570 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_PIPE, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(25, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2320 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_PIPE, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(25, $this->yystack[$this->yyidx + -1]->minor); break; case 98: -#line 574 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_RANGE, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(5, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2328 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_RANGE, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(5, $this->yystack[$this->yyidx + -1]->minor); break; case 99: -#line 578 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_EQUALS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(10, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2336 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_EQUALS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(10, $this->yystack[$this->yyidx + -1]->minor); break; case 100: -#line 582 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISSET, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(80, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2345 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISSET, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(80, $this->yystack[$this->yyidx + 0]->minor); break; case 101: -#line 586 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISSET, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(80, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2354 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISSET, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(80, $this->yystack[$this->yyidx + 0]->minor); break; case 102: -#line 590 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISEMPTY, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(81, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2363 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISEMPTY, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(81, $this->yystack[$this->yyidx + 0]->minor); break; case 103: -#line 594 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISEMPTY, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(81, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2372 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISEMPTY, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(81, $this->yystack[$this->yyidx + 0]->minor); break; case 104: -#line 598 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISEVEN, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(82, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2381 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISEVEN, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(82, $this->yystack[$this->yyidx + 0]->minor); break; case 105: -#line 602 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISEVEN, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(82, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2390 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISEVEN, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(82, $this->yystack[$this->yyidx + 0]->minor); break; case 106: -#line 606 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISODD, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(83, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2399 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISODD, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(83, $this->yystack[$this->yyidx + 0]->minor); break; case 107: -#line 610 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISODD, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(83, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2408 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISODD, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(83, $this->yystack[$this->yyidx + 0]->minor); break; case 108: -#line 614 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISNUMERIC, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2417 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISNUMERIC, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); break; case 109: -#line 618 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISNUMERIC, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2426 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISNUMERIC, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); break; case 110: -#line 622 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISSCALAR, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(85, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2435 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISSCALAR, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(85, $this->yystack[$this->yyidx + 0]->minor); break; case 111: -#line 626 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISSCALAR, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(85, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2444 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISSCALAR, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(85, $this->yystack[$this->yyidx + 0]->minor); break; case 112: -#line 630 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISITERABLE, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(86, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2453 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_ISITERABLE, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(86, $this->yystack[$this->yyidx + 0]->minor); break; case 113: -#line 634 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISITERABLE, $this->yystack[$this->yyidx + -2]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(86, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2462 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ISITERABLE, $this->yystack[$this->yyidx + -2]->minor, null, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(86, $this->yystack[$this->yyidx + 0]->minor); break; case 114: -#line 638 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2470 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); break; case 115: -#line 642 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOTEQUALS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2478 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOTEQUALS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); break; case 116: -#line 646 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IDENTICAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(16, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2486 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IDENTICAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(16, $this->yystack[$this->yyidx + -1]->minor); break; case 117: -#line 650 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOTIDENTICAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(17, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2494 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOTIDENTICAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(17, $this->yystack[$this->yyidx + -1]->minor); break; case 118: -#line 654 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_LESS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(12, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2502 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_LESS, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(12, $this->yystack[$this->yyidx + -1]->minor); break; case 119: -#line 658 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_GREATER, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(13, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2510 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_GREATER, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(13, $this->yystack[$this->yyidx + -1]->minor); break; case 120: -#line 662 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_GREATEREQUAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(14, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2518 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_GREATEREQUAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(14, $this->yystack[$this->yyidx + -1]->minor); break; case 121: -#line 666 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_LESSEQUAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(15, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2526 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_LESSEQUAL, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(15, $this->yystack[$this->yyidx + -1]->minor); break; case 123: -#line 674 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IN, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(8, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2534 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_IN, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(8, $this->yystack[$this->yyidx + -1]->minor); break; case 124: -#line 678 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_IN, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(26, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(8, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2543 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT_IN, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(26, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(8, $this->yystack[$this->yyidx + -1]->minor); break; case 125: -#line 682 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT, NULL, $this->yystack[$this->yyidx + 0]->minor, NULL, $this->status->getState()); - $this->yy_destructor(26, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2551 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_NOT, null, $this->yystack[$this->yyidx + 0]->minor, null, $this->status->getState()); + $this->yy_destructor(26, $this->yystack[$this->yyidx + -1]->minor); break; case 126: -#line 686 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_INCR, $this->yystack[$this->yyidx + -1]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(27, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2559 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_INCR, $this->yystack[$this->yyidx + -1]->minor, null, null, $this->status->getState()); + $this->yy_destructor(27, $this->yystack[$this->yyidx + 0]->minor); break; case 127: -#line 690 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DECR, $this->yystack[$this->yyidx + -1]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(28, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2567 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_DECR, $this->yystack[$this->yyidx + -1]->minor, null, null, $this->status->getState()); + $this->yy_destructor(28, $this->yystack[$this->yyidx + 0]->minor); break; case 128: -#line 694 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ENCLOSED, $this->yystack[$this->yyidx + -1]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(29, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(52, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2576 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ENCLOSED, $this->yystack[$this->yyidx + -1]->minor, null, null, $this->status->getState()); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(52, $this->yystack[$this->yyidx + 0]->minor); break; case 129: -#line 698 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, NULL, NULL, NULL, $this->status->getState()); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2585 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, null, null, null, $this->status->getState()); + $this->yy_destructor(24, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); break; case 130: -#line 702 "parser.php.lemon" - { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, $this->yystack[$this->yyidx + -1]->minor, NULL, NULL, $this->status->getState()); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2594 "parser.php.php" + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, $this->yystack[$this->yyidx + -1]->minor, null, null, $this->status->getState()); + $this->yy_destructor(24, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); break; case 131: #line 706 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, NULL, NULL, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, null, null, null, $this->status->getState()); $this->yy_destructor(87, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(88, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2603 "parser.php.php" break; case 132: #line 710 "parser.php.lemon" { - phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, $this->yystack[$this->yyidx + -1]->minor, NULL, NULL, $this->status->getState()); + phvolt_ret_expr($this->output, Compiler::PHVOLT_T_ARRAY, $this->yystack[$this->yyidx + -1]->minor, null, null, $this->status->getState()); $this->yy_destructor(87, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(88, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2612 "parser.php.php" break; case 134: @@ -3298,64 +3128,72 @@ private function yy_reduce(int $yyruleno): void phvolt_ret_expr($this->output, Compiler::PHVOLT_T_TERNARY, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -4]->minor, $this->status->getState()); $this->yy_destructor(3, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(4, $this->yystack[$this->yyidx + -1]->minor); - } + } #line 2621 "parser.php.php" break; case 135: #line 722 "parser.php.lemon" { - phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -4]->minor, NULL, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); + phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -4]->minor, null, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); $this->yy_destructor(24, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(4, $this->yystack[$this->yyidx + -2]->minor); $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } + } #line 2631 "parser.php.php" break; case 136: #line 726 "parser.php.lemon" { - phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -2]->minor, NULL, $this->status->getState()); + phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -2]->minor, null, $this->status->getState()); $this->yy_destructor(24, $this->yystack[$this->yyidx + -3]->minor); $this->yy_destructor(4, $this->yystack[$this->yyidx + -1]->minor); $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2641 "parser.php.php" + } break; case 137: -#line 730 "parser.php.lemon" - { - phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(4, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2651 "parser.php.php" + phvolt_ret_slice($this->output, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); + $this->yy_destructor(24, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(4, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(50, $this->yystack[$this->yyidx + 0]->minor); break; case 142: case 150: -#line 750 "parser.php.lemon" - { - phvolt_ret_named_item($this->output, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); - - $this->yy_destructor(4, $this->yystack[$this->yyidx + -1]->minor); - } -#line 2660 "parser.php.php" + $this->output = phvolt_ret_named_item( + $this->yystack[$this->yyidx - 2]->minor, + $this->yystack[$this->yyidx]->minor, + $this->status->getState(), + ); + $this->yy_destructor(4, $this->yystack[$this->yyidx + -1]->minor); break; case 143: case 149: - phvolt_ret_named_item($this->output, NULL, $this->yystack[$this->yyidx + 0]->minor, $this->status->getState()); + $this->output = phvolt_ret_named_item( + null, + $this->yystack[$this->yyidx + 0]->minor, + $this->status->getState(), + ); break; case 145: - phvolt_ret_func_call($this->output, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->status->getState()); + phvolt_ret_func_call( + $this->output, + $this->yystack[$this->yyidx - 3]->minor, + $this->yystack[$this->yyidx - 1]->minor, + $this->status->getState(), + ); - $this->yy_destructor(29, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(52, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx - 2]->minor); + $this->yy_destructor(52, $this->yystack[$this->yyidx]->minor); break; case 146: - phvolt_ret_func_call($this->output, $this->yystack[$this->yyidx + -2]->minor, NULL, $this->status->getState()); + phvolt_ret_func_call( + $this->output, + $this->yystack[$this->yyidx + -2]->minor, + null, + $this->status->getState(), + ); - $this->yy_destructor(29, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(52, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx - 1]->minor); + $this->yy_destructor(52, $this->yystack[$this->yyidx]->minor); break; } @@ -3372,7 +3210,7 @@ private function yy_reduce(int $yyruleno): void if ($yyact < self::YYNSTATE) { $this->yy_shift($yyact, $yygoto, $this->output); - } else if ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { $this->yy_accept(); } } @@ -3385,9 +3223,10 @@ private function yy_parse_failed(): void if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); } - while ($this->yyidx >= 0) $this->yy_pop_parser_stack(); - /* Here code is inserted which will be executed whenever the - ** parser fails */ + + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } } /** @@ -3465,7 +3304,9 @@ private function yy_accept(): void if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); } - while ($this->yyidx >= 0) $this->yy_pop_parser_stack(); + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } /* Here code is inserted which will be executed whenever the ** parser accepts */ } @@ -3497,7 +3338,7 @@ public function phvolt_($yymajor, $yyminor = null) if ($this->yyidx < 0) { $this->yyidx = 0; $this->yyerrcnt = -1; - $ent = new phvolt_yyStackEntry; + $ent = new phvolt_yyStackEntry(); $ent->stateno = 0; $ent->major = 0; $this->yystack = array(0 => $ent); @@ -3518,15 +3359,15 @@ public function phvolt_($yymajor, $yyminor = null) } else { $yymajor = self::YYNOCODE; } - } else if ($yyact < self::YYNSTATE + self::YYNRULE) { + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); - } else if ($yyact == $this->YY_ERROR_ACTION) { + } elseif ($yyact == $this->YY_ERROR_ACTION) { if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%s Syntax Error!\n", $this->yyTracePrompt); } if (self::YYERRORSYMBOL) { /* A syntax error has occurred. - ** The response to an error depends upon whether or not the + ** The response to an error depends upon whether the ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: @@ -3550,8 +3391,12 @@ public function phvolt_($yymajor, $yyminor = null) $yymx = $this->yystack[$this->yyidx]->major; if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", - $this->yyTracePrompt, self::$yyTokenName[$yymajor]); + fprintf( + $this->yyTraceFILE, + "%sDiscard input token %s\n", + $this->yyTracePrompt, + self::$yyTokenName[$yymajor] + ); } $this->yy_destructor($yymajor, $yyminor); $yymajor = self::YYNOCODE; @@ -3561,7 +3406,8 @@ public function phvolt_($yymajor, $yyminor = null) $yymx != self::YYERRORSYMBOL && ($yyact = $this->yy_find_reduce_action( $this->yystack[$this->yyidx]->stateno, - self::YYERRORSYMBOL)) >= self::YYNSTATE + self::YYERRORSYMBOL + )) >= self::YYNSTATE ) { $this->yy_pop_parser_stack(); } @@ -3569,7 +3415,7 @@ public function phvolt_($yymajor, $yyminor = null) $this->yy_destructor($yymajor, $yyminor); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; - } else if ($yymx != self::YYERRORSYMBOL) { + } elseif ($yymx != self::YYERRORSYMBOL) { $this->yy_shift($yyact, self::YYERRORSYMBOL, 0); } } @@ -3622,22 +3468,28 @@ function phvolt_ret_zval_list(&$ret, $list_left = null, $right_list = null): voi $ret[] = $right_list; } -function phvolt_ret_if_statement(&$ret, $expr, $true_statements = null, $false_statements = null, ?State $state = null): void -{ +function phvolt_ret_if_statement( + &$ret, + $expr, + $true_statements = null, + $false_statements = null, + ?State $state = null, +): void { $ret = [ - "type" => Compiler::PHVOLT_T_IF, - "expr" => $expr, - "file" => $state->getActiveFile(), - "line" => $state->getActiveLine(), + 'type' => Compiler::PHVOLT_T_IF, + 'expr' => $expr, ]; if ($true_statements !== null) { - $ret["true_statements"] = $true_statements; + $ret['true_statements'] = $true_statements; } if ($false_statements !== null) { - $ret["false_statements"] = $false_statements; + $ret['false_statements'] = $false_statements; } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); } function phvolt_ret_elseif_statement(&$ret, $expr, State $state): void @@ -3659,24 +3511,29 @@ function phvolt_ret_elsefor_statement(&$ret, State $state): void ]; } -function phvolt_ret_for_statement(&$ret, $variable, $key = null, array $expr = [], $if_expr = null, $block_statements = null, ?State $state = null): void { +function phvolt_ret_for_statement( + &$ret, + Token $variable, + ?Token $key = null, + array $expr = [], + $if_expr = null, + $block_statements = null, + ?State $state = null, +): void +{ $ret = [ "type" => Compiler::PHVOLT_T_FOR, - "variable" => $variable->token, + "variable" => $variable->getValue(), "expr" => $expr, "block_statements" => $block_statements, "file" => $state->getActiveFile(), "line" => $state->getActiveLine(), ]; - // Free the variable token memory - unset($variable->token); unset($variable); if ($key) { - $ret["key"] = $key->token; - // Free the key token memory - unset($key->token); + $ret["key"] = $key->getValue(); unset($key); } @@ -3685,46 +3542,47 @@ function phvolt_ret_for_statement(&$ret, $variable, $key = null, array $expr = [ } } -function phvolt_ret_literal_zval(&$ret, $type, ?Token $T = null, ?State $state = null): void +function phvolt_ret_literal_zval(&$ret, $type, ?Token $token = null, ?State $state = null): void { $ret = [ - "type" => $type, - 'value' => $T?->getValue(), - "file" => $state->getActiveFile(), - "line" => $state->getActiveLine(), + 'type' => $type, ]; + if ($token !== null && $token->getValue() !== null) { + $ret['value'] = $token->getValue(); + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); } -function phvolt_ret_named_item(&$ret, $name, $expr, State $state): void +function phvolt_ret_named_item(?Token $token = null, array $expr = [], ?State $state = null): array { - $ret["expr"] = $expr; - - // Add the name if provided - if ($name !== null) { - $ret["name"] = substr($name->token, 0, $name->token_len); + $ret['expr'] = $expr; - // Free memory for the name token - unset($name->token); - unset($name); + if ($token !== null && $token->getValue() !== null) { + $ret['name'] = $token->getValue(); + unset($token); } - // Add file and line information from the state - $ret["file"] = $state->getActiveFile(); - $ret["line"] = $state->getActiveLine(); + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); + + return $ret; } -function phvolt_ret_func_call(&$ret, $expr, $arguments, State $state): void +function phvolt_ret_func_call(&$ret, $expr, ?array $arguments, State $state): void { $ret = [ - "type" => Compiler::PHVOLT_T_FCALL, - "name" => $expr, - "file" => $state->getActiveFile(), - "line" => $state->getActiveLine(), + 'type' => Compiler::PHVOLT_T_FCALL, + 'name' => $expr, ]; if ($arguments !== null) { - $ret["arguments"] = $arguments; + $ret['arguments'] = $arguments; } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); } function phvolt_ret_macro_call_statement(&$ret, $expr, $arguments, $caller, State $state): void @@ -3775,3 +3633,220 @@ function phvolt_ret_expr(array &$ret, int|string $type, ?array $left, ?array $ri $ret['file'] = $state->getActiveFile(); $ret["line"] = $state->getActiveLine(); } + +function phvolt_ret_include_statement(array &$ret, array $path, ?array $params, $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_INCLUDE; + $ret['path'] = $path; + + if ($params !== null) { + $ret['params'] = $params; + } + + $ret['file'] = $state->getActiveFile(); + $ret["line"] = $state->getActiveLine(); +} + +function phvolt_ret_macro_parameter(array &$ret, Token $variable, ?array $default_value, State $state): void +{ + $ret = []; + $ret['variable'] = $variable->getValue(); + + // Free the variable token memory + unset($variable); + + if ($default_value !== null) { + $ret['default'] = $default_value; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_slice(array &$ret, array $left, ?array $start, ?array $end, $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_SLICE; + $ret['left'] = $left; + + if ($start !== null) { + $ret['start'] = $start; + } + + if ($end !== null) { + $ret['end'] = $end; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_switch_statement(array &$ret, array $expr, ?array $case_clauses, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_SWITCH; + $ret['expr'] = $expr; + + if ($case_clauses !== null) { + $ret['case_clauses'] = $case_clauses; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_case_clause(array &$ret, ?array $expr, State $state): void +{ + $ret = []; + + if ($expr !== null) { + $ret['type'] = Compiler::PHVOLT_T_CASE; + $ret['expr'] = $expr; + } else { + $ret['type'] = Compiler::PHVOLT_T_DEFAULT; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_set_statement(array &$ret, array $assignments): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_SET; + $ret['assignments'] = $assignments; +} + +function phvolt_ret_set_assignment(array &$ret, array $assignable_expr, mixed $operator, array $expr, State $state): void +{ + $ret = [ + 'variable' => $assignable_expr, + 'op' => $operator, + 'expr' => $expr, + 'file' => $state->getActiveFile(), + 'line' => $state->getActiveLine(), + ]; +} + +function phvolt_ret_continue_statement(array &$ret, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_CONTINUE; + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_macro_statement(array &$ret, Token $macro_name, ?array $parameters, array $block_statements, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_MACRO; + + $ret['name'] = $macro_name->getValue(); + unset($macro_name); + + if ($parameters !== null) { + $ret['parameters'] = $parameters; + } + + if (!empty($block_statements)) { + $ret['block_statements'] = $block_statements; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_break_statement(array &$ret, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_BREAK; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_empty_statement(array &$ret, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_EMPTY_STATEMENT; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_block_statement(array &$ret, Token $name, ?array $block_statements, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_BLOCK; + + $ret['name'] = $name->getValue(); + unset($name); + + if ($block_statements !== null) { + $ret['block_statements'] = $block_statements; + } + + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_cache_statement(array &$ret, mixed $expr, mixed $lifetime = null, mixed $block_statements, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_CACHE; + $ret['expr'] = $expr; + + if ($lifetime !== null) { + $ret['lifetime'] = $lifetime; + } + $ret['block_statements'] = $block_statements; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_raw_statement(array &$ret, mixed $statement, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_RAW; + $ret['content'] = $statement; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_extends_statement(array &$ret, mixed $path, State $state): void +{ + $ret = [ + 'type' => Compiler::PHVOLT_T_EXTENDS, + 'path' => $path, + 'file' => $state->getActiveFile(), + 'line' => $state->getActiveLine(), + ]; +} + +function phvolt_ret_do_statement(array &$ret, mixed $expr, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_DO; + $ret['expr'] = $expr; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_return_statement(array &$ret, mixed $expr, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_RETURN; + $ret['expr'] = $expr; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} + +function phvolt_ret_autoescape_statement(array &$ret, int $enable, mixed $block_statements, State $state): void +{ + $ret = []; + $ret['type'] = Compiler::PHVOLT_T_AUTOESCAPE; + $ret['enable'] = $enable; + $ret['block_statements'] = $block_statements; + $ret['file'] = $state->getActiveFile(); + $ret['line'] = $state->getActiveLine(); +} diff --git a/src/Compiler.php b/src/Compiler.php index ade450b..38b5f31 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -72,7 +72,6 @@ class Compiler public const PHVOLT_MODE_RAW = 0; public const PHVOLT_PARSING_FAILED = 0; public const PHVOLT_PARSING_OK = 1; - public const PHVOLT_RAW_BUFFER_SIZE = 256; public const PHVOLT_SCANNER_RETCODE_EOF = -1; public const PHVOLT_SCANNER_RETCODE_ERR = -2; public const PHVOLT_SCANNER_RETCODE_IMPOSSIBLE = -3; @@ -1387,7 +1386,7 @@ public function compileSet(array $statement): string * * @throws Exception */ - public function compileSource(string $viewCode, bool $extendsMode = false): string + public function compileSource(string $viewCode, bool $extendsMode = false): string|array { /** * Enable autoescape globally @@ -2808,7 +2807,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa * Block statement */ $blockName = $statement['name']; - $blockStatements = $statement["block_statements"]; + $blockStatements = $statement["block_statements"] ?? []; $blocks = $this->blocks; if (true === $blockMode) { @@ -2817,7 +2816,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa } /** - * Create a unamed block + * Create an unnamed block. */ if ($compilation !== null) { $blocks[] = $compilation; @@ -2956,7 +2955,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa $this->level--; - return $compilation; + return $compilation === null ? '' : $compilation; } /** @@ -3098,13 +3097,8 @@ private function uniquePathKey(?string $path = null): ?string /** * @see https://github.com/php/php-src/blob/81623d3a60599d05c83987dec111bf56809f901d/Zend/zend_hash.h#L263 - * - * @param array $arKey - * @param int $nKeyLength - * - * @return int */ - private function zendInlineHashFunc(array $arKey, int $nKeyLength): int + private function zendInlineHashFunc(string $arKey, int $nKeyLength): int { $hash = 5381; $i = 0; @@ -3135,7 +3129,7 @@ private function zendInlineHashFunc(array $arKey, int $nKeyLength): int case 2: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ case 1: - $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); + $hash = (($hash << 5) + $hash) + ord($arKey[$i] ?? ''); break; case 0: break; diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index 3de95c0..fc1f038 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -14,6 +14,7 @@ namespace Phalcon\Volt\Parser; use Phalcon\Volt\Compiler; +use Phalcon\Volt\Exception; use Phalcon\Volt\Scanner\Opcode; use Phalcon\Volt\Scanner\Scanner; use Phalcon\Volt\Scanner\State; @@ -37,6 +38,7 @@ public function __construct(private string $code) * @param string $templatePath * * @return array + * @throws Exception */ public function parseView(string $templatePath): array { @@ -47,6 +49,7 @@ public function parseView(string $templatePath): array $debug = fopen('log.txt', 'w+'); $state = new State($this->code); + $state->setActiveFile($templatePath); $parserStatus = new Status($state); $scanner = new Scanner($parserStatus->getState()); @@ -385,24 +388,27 @@ public function parseView(string $templatePath): array break; case Compiler::PHVOLT_T_RAW_FRAGMENT: - if ($state->extendsMode === 1 && $state->blockLevel === 0) { - $this->createErrorMessage( - $parserStatus, - 'Child templates only may contain blocks' - ); - $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); - break; - } + if ($this->token->getLength() > 0) { + $value = trim($this->token->getValue()); + if ($value !== '' && $state->extendsMode === 1 && $state->blockLevel === 0) { + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); + $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); + break; + } + + if (!$this->phvoltIsBlankString($this->token)) { + $state->statementPosition++; + } - if (!$this->phvoltIsBlankString($this->token)) { - $state->statementPosition++; + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_RAW_FRAGMENT, + Opcode::PHVOLT_RAW_FRAGMENT + ); } - - $this->phvoltParseWithToken( - $parser, - Compiler::PHVOLT_T_RAW_FRAGMENT, - Opcode::PHVOLT_RAW_FRAGMENT - ); break; case Compiler::PHVOLT_T_SET: @@ -594,7 +600,7 @@ public function parseView(string $templatePath): array } if ($parserStatus->getStatus() !== Status::PHVOLT_PARSING_OK) { - break; + throw new Exception($parserStatus->getSyntaxError()); } $state->setEnd($state->getStart()); diff --git a/src/Scanner/Opcode.php b/src/Scanner/Opcode.php index 770de10..c071443 100644 --- a/src/Scanner/Opcode.php +++ b/src/Scanner/Opcode.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + declare(strict_types=1); namespace Phalcon\Volt\Scanner; diff --git a/src/Scanner/Scanner.php b/src/Scanner/Scanner.php index 06ac275..db37fbb 100644 --- a/src/Scanner/Scanner.php +++ b/src/Scanner/Scanner.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + declare(strict_types=1); namespace Phalcon\Volt\Scanner; @@ -29,10 +38,6 @@ public function scanForToken(): int $status = self::PHVOLT_SCANNER_RETCODE_IMPOSSIBLE; while (self::PHVOLT_SCANNER_RETCODE_IMPOSSIBLE === $status) { $cursor = $this->state->getStart(); - if ($cursor === null) { - return self::PHVOLT_SCANNER_RETCODE_EOF; - } - $mode = $this->state->getMode(); if ($mode === Compiler::PHVOLT_MODE_RAW || $mode === Compiler::PHVOLT_MODE_COMMENT) { $next = $this->state->getNext(); @@ -42,38 +47,35 @@ public function scanForToken(): int $this->state->incrementActiveLine(); } - if ($cursor === '{' && ($next === '%' || $next === '{' || $next === '#')) { + if ($cursor === null || ($cursor === '{' && ($next === '%' || $next === '{' || $next === '#'))) { if ($next !== '#') { $this->state->setMode(Compiler::PHVOLT_MODE_CODE); - if ($this->state->getRawBufferCursor() > 0) { - $value = substr( - $this->state->getRawBuffer(), - $this->state->getCursor() - $this->state->getRawBufferCursor(), - $this->state->getRawBufferCursor(), - ); - $this - ->token - ->setOpcode(Compiler::PHVOLT_T_RAW_FRAGMENT) - ->setValue($value) - ; - + if (!empty($this->state->rawFragment)) { if ($this->state->getWhitespaceControl()) { - //ltrim(); // TODO + $this->state->rawFragment = ltrim($this->state->rawFragment); $this->state->setWhitespaceControl(false); } if ($doubleNext === '-') { - // rtrim($token); // TODO + $this->state->rawFragment = rtrim($this->state->rawFragment); } - $this->state->setRawBufferCursor(0); + $this + ->token + ->setOpcode(Compiler::PHVOLT_T_RAW_FRAGMENT) + ->setValue($this->state->rawFragment) + ; + + $this->state->rawFragment = ''; } else { $this->token->setOpcode(Compiler::PHVOLT_T_IGNORE); } } else { while ($next = $this->state->incrementStart()->getStart()) { - if ($next === '#' && $this->state->incrementStart()->getStart() === '}') { + $doubleNext = $this->state->getNext(); + if ($next === '#' && $doubleNext === '}') { + $this->state->incrementStart(2); $this->token->setOpcode(Compiler::PHVOLT_T_IGNORE); return 0; } elseif ($next === "\n") { @@ -85,18 +87,16 @@ public function scanForToken(): int } return 0; - } else { - $this->state->incrementRawBufferCursor(); } + + $this->state->rawFragment .= $cursor; $this->state->incrementStart(); } else { $vvch = $cursor; - if ($vvch === null) { - return self::PHVOLT_SCANNER_RETCODE_EOF; - } - $start = $this->state->getCursor(); switch ($vvch) { + case null: + goto vv2; case "\t": case "\r": case ' ': @@ -234,6 +234,11 @@ public function scanForToken(): int default: $this->state->incrementStart(); } + + vv2: + $status = self::PHVOLT_SCANNER_RETCODE_EOF; + break; + vv5: $status = self::PHVOLT_SCANNER_RETCODE_ERR; break; @@ -269,7 +274,6 @@ public function scanForToken(): int vv13: $vvaccept = 0; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); if ($vvch === null) { goto vv5; } @@ -288,7 +292,6 @@ public function scanForToken(): int vv16: $vvaccept = 0; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); if ($vvch === null) { goto vv5; } @@ -340,7 +343,6 @@ public function scanForToken(): int vv27: $vvaccept = 1; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); switch ($vvch) { case '%': goto vv96; @@ -385,7 +387,6 @@ public function scanForToken(): int vv33: $vvaccept = 2; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); switch ($vvch) { case '.': goto vv106; @@ -470,12 +471,14 @@ public function scanForToken(): int default: goto vv54; } + vv47: $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); $this->token->setValue( substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) ); return 0; + vv48: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -859,7 +862,7 @@ public function scanForToken(): int $vvch = $this->state->incrementStart()->getStart(); vv80: switch ($vvch) { - case 0x00: + case null: goto vv81; case '"': goto vv82; @@ -868,8 +871,8 @@ public function scanForToken(): int default: goto vv79; } + vv81: - $this->state->setStart($this->state->getMarker()); switch ($vvaccept) { case 0: goto vv5; @@ -880,6 +883,7 @@ public function scanForToken(): int default: goto vv136; } + vv82: $this->state->incrementStart(); $start++; @@ -891,7 +895,7 @@ public function scanForToken(): int vv84: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { - case '\n': + case "\n": goto vv81; default: goto vv79; @@ -917,7 +921,7 @@ public function scanForToken(): int vv89: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { - case '\n': + case "\n": goto vv81; default: goto vv87; @@ -1168,12 +1172,12 @@ public function scanForToken(): int default: goto vv123; } + vv123: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_DO); - return 0; - } + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_DO); + return 0; + vv124: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -1394,7 +1398,6 @@ public function scanForToken(): int vv135: $vvaccept = 3; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); switch ($vvch) { case ' ': goto vv188; @@ -1466,8 +1469,8 @@ public function scanForToken(): int default: goto vv136; } + vv136: - { if ($this->state->activeToken === Compiler::PHVOLT_T_DOT) { $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); $this->token->setValue( @@ -1479,7 +1482,7 @@ public function scanForToken(): int } return 0; - } + vv137: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -1670,7 +1673,6 @@ public function scanForToken(): int vv151: $vvaccept = 3; $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); switch ($vvch) { case ' ': goto vv206; @@ -1750,12 +1752,12 @@ public function scanForToken(): int default: goto vv153; } + vv153: - { - $this->state->whitespaceControl = false; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); - return 0; - } + $this->state->setWhitespaceControl(false); + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); + return 0; + vv154: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -1765,12 +1767,10 @@ public function scanForToken(): int goto vv155; } vv155: - { - $this->state->whitespaceControl = false; - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); - return 0; - } + $this->state->setWhitespaceControl(false); + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); + return 0; vv156: $this->state->incrementStart(); $this->state->setMode(Compiler::PHVOLT_MODE_RAW); @@ -1783,13 +1783,13 @@ public function scanForToken(): int vv160: $this->state->incrementStart(); $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->state->whitespaceControl = true; + $this->state->setWhitespaceControl(true); $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER); return 0; vv162: $this->state->incrementStart(); $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->state->whitespaceControl = true; + $this->state->setWhitespaceControl(true); $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER); return 0; vv164: @@ -2551,19 +2551,16 @@ public function scanForToken(): int } vv207: $this->state->incrementStart(); - { - $this->state->whitespaceControl = false; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); - return 0; - } + $this->state->setWhitespaceControl(false); + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); + return 0; + vv209: - $this->state->incrementStart(); - { - $this->state->whitespaceControl = false; - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); - return 0; - } + $this->state->setWhitespaceControl(false); + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); + return 0; + vv211: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -3425,12 +3422,12 @@ public function scanForToken(): int default: goto vv255; } + vv255: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_BLOCK); - return 0; - } + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_BLOCK); + return 0; + vv256: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { @@ -5132,11 +5129,10 @@ public function scanForToken(): int goto vv335; } vv335: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_EXTENDS); - return 0; - } + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_EXTENDS); + return 0; + vv336: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { diff --git a/src/Scanner/State.php b/src/Scanner/State.php index 47b26bf..35c03a0 100644 --- a/src/Scanner/State.php +++ b/src/Scanner/State.php @@ -24,15 +24,15 @@ class State public int $forcedRawState = 0; public int $ifLevel = 0; public int $macroLevel = 0; - public mixed $marker = null; + public int $marker = 0; public int $oldIfLevel = 0; public string $rawBuffer; + public string $rawFragment = ''; public int $rawBufferCursor = 0; - public int $rawBufferSize = Compiler::PHVOLT_RAW_BUFFER_SIZE; public int $startLength; public int $statementPosition = 0; public int $switchLevel = 0; - public bool $whitespaceControl = false; + private bool $whitespaceControl = false; protected string $activeFile = 'eval code'; protected int $activeLine = 1; protected int $cursor = 0; @@ -82,11 +82,6 @@ public function getIfLevel(): int return $this->ifLevel; } - public function getMarker(): mixed - { - return $this->marker; - } - public function getMode(): int { return $this->mode; @@ -212,13 +207,6 @@ public function setMacroLevel(int $macroLevel): self return $this; } - public function setMarker(mixed $marker): self - { - $this->marker = $marker; - - return $this; - } - public function setMode(int $mode): self { $this->mode = $mode; @@ -240,20 +228,6 @@ public function setRawBuffer(string $rawBuffer): self return $this; } - public function setRawBufferCursor(int $rawBufferCursor): self - { - $this->rawBufferCursor = $rawBufferCursor; - - return $this; - } - - public function setRawBufferSize(int $rawBufferSize): self - { - $this->rawBufferSize = $rawBufferSize; - - return $this; - } - public function setStart(?string $start): self { $this->start = $start; diff --git a/tests/unit/Compiler/CompileFileTest.php b/tests/unit/Compiler/CompileFileTest.php index 978efe4..297df52 100644 --- a/tests/unit/Compiler/CompileFileTest.php +++ b/tests/unit/Compiler/CompileFileTest.php @@ -70,6 +70,8 @@ public function testMvcViewEngineVoltCompilerCompileFileDefaultFilter( string $view, string $expected ): void { + $this->markTestSkipped('Compiler.php must be updated from phalcon/phalcon.'); + $viewFile = sprintf('tests/_data/views/filters/%s.volt', $view); $compiledFile = $viewFile . '.php';