Skip to content

Commit 33233ae

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 9b042c9 commit 33233ae

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
@@ -188,8 +188,8 @@ private function inline_single_branch_fragments() {
188188
}
189189

190190
// Depth-first expansion memoized per rule, with cycle detection.
191-
$expanded = array();
192-
$visiting = array();
191+
$expanded = array();
192+
$visiting = array();
193193
$expand_branch = function ( array $branch ) use ( &$expand_branch, &$expanded, &$visiting, $rules, $low_nt, $inlinable ) {
194194
$out = array();
195195
foreach ( $branch as $sym ) {
@@ -207,8 +207,8 @@ private function inline_single_branch_fragments() {
207207
continue;
208208
}
209209
if ( ! isset( $expanded[ $sym ] ) ) {
210-
$visiting[ $sym ] = true;
211-
$expanded[ $sym ] = $expand_branch( $rules[ $sym ][0] );
210+
$visiting[ $sym ] = true;
211+
$expanded[ $sym ] = $expand_branch( $rules[ $sym ][0] );
212212
unset( $visiting[ $sym ] );
213213
}
214214
foreach ( $expanded[ $sym ] as $s ) {
@@ -239,12 +239,12 @@ private function inline_single_branch_fragments() {
239239
* of the branch attempts that the parser used to try and fail.
240240
*/
241241
private function build_branch_selectors() {
242-
$rules = $this->rules;
243-
$low_nt = $this->lowest_non_terminal_id;
244-
$empty_rule = self::EMPTY_RULE_ID;
245-
$rule_ids = array_keys( $rules );
246-
$nullable = array();
247-
$first_sets = array();
242+
$rules = $this->rules;
243+
$low_nt = $this->lowest_non_terminal_id;
244+
$empty_rule = self::EMPTY_RULE_ID;
245+
$rule_ids = array_keys( $rules );
246+
$nullable = array();
247+
$first_sets = array();
248248

249249
foreach ( $rule_ids as $rule_id ) {
250250
$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)