Skip to content

Commit 87f3096

Browse files
committed
Re-align grammar and parser whitespace after recent changes
Adopts phpcbf's trivial whitespace alignment fixes in the grammar and parser source to keep `composer run check-cs` clean after the prior optimisation commits added new local variables and reshaped the selector-build code.
1 parent bf43a04 commit 87f3096

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ private function inline_single_branch_fragments() {
203203
}
204204

205205
// Depth-first expansion memoized per rule, with cycle detection.
206-
$expanded = array();
207-
$visiting = array();
206+
$expanded = array();
207+
$visiting = array();
208208
$expand_branch = function ( array $branch ) use ( &$expand_branch, &$expanded, &$visiting, $rules, $low_nt, $inlinable ) {
209209
$out = array();
210210
foreach ( $branch as $sym ) {
@@ -222,8 +222,8 @@ private function inline_single_branch_fragments() {
222222
continue;
223223
}
224224
if ( ! isset( $expanded[ $sym ] ) ) {
225-
$visiting[ $sym ] = true;
226-
$expanded[ $sym ] = $expand_branch( $rules[ $sym ][0] );
225+
$visiting[ $sym ] = true;
226+
$expanded[ $sym ] = $expand_branch( $rules[ $sym ][0] );
227227
unset( $visiting[ $sym ] );
228228
}
229229
foreach ( $expanded[ $sym ] as $s ) {
@@ -254,12 +254,12 @@ private function inline_single_branch_fragments() {
254254
* of the branch attempts that the parser used to try and fail.
255255
*/
256256
private function build_branch_selectors() {
257-
$rules = $this->rules;
258-
$low_nt = $this->lowest_non_terminal_id;
259-
$empty_rule = self::EMPTY_RULE_ID;
260-
$rule_ids = array_keys( $rules );
261-
$nullable = array();
262-
$first_sets = array();
257+
$rules = $this->rules;
258+
$low_nt = $this->lowest_non_terminal_id;
259+
$empty_rule = self::EMPTY_RULE_ID;
260+
$rule_ids = array_keys( $rules );
261+
$nullable = array();
262+
$first_sets = array();
263263

264264
foreach ( $rule_ids as $rule_id ) {
265265
$nullable[ $rule_id ] = false;

packages/mysql-on-sqlite/src/parser/class-wp-parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class WP_Parser {
2424
private $select_statement_rule_id;
2525

2626
public function __construct( WP_Parser_Grammar $grammar, array $tokens ) {
27-
$this->grammar = $grammar;
28-
$this->token_count = count( $tokens );
27+
$this->grammar = $grammar;
28+
$this->token_count = count( $tokens );
2929
// Append an end-of-input sentinel token whose id is EMPTY_RULE_ID
3030
// (0). The hot path can then read $tokens[$pos]->id unconditionally
3131
// when $pos is the current cursor, because the sentinel naturally

0 commit comments

Comments
 (0)