Skip to content

Commit

Permalink
Explore support for SQL_CALC_FOUND_ROWS
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Aug 20, 2024
1 parent 137d6ca commit 0a2440c
Show file tree
Hide file tree
Showing 3 changed files with 519 additions and 465 deletions.
12 changes: 6 additions & 6 deletions custom-parser/parser/DynamicRecursiveDescentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function inflate($grammar)
* rules that are not part of the original grammar. They are useful
*
*/
if($rule_name[0] === '%' || str_ends_with($rule_name, '_fragment')) {
if($rule_name[0] === '%') {
$this->fragment_ids[$rule_index + $grammar['rules_offset']] = true;
}
}
Expand Down Expand Up @@ -165,6 +165,11 @@ public function __construct($rule_id, $rule_name)
$this->rule_name = $rule_name;
}

public function append_child($node)
{
$this->children[] = $node;
}

/**
* Flatten the matched rule fragments as if their children were direct
* descendants of the current rule.
Expand Down Expand Up @@ -237,11 +242,6 @@ public function __construct($rule_id, $rule_name)
* ]
* ]
*/
public function append_child($node)
{
$this->children[] = $node;
}

public function merge_fragment($node)
{
$this->children = array_merge($this->children, $node->children);
Expand Down
2 changes: 1 addition & 1 deletion custom-parser/parser/SQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class SQLiteToken
const TYPE_RAW = 'TYPE_RAW';
const TYPE_IDENTIFIER = 'TYPE_IDENTIFIER';
const TYPE_VALUE = 'TYPE_VALUE';
const TYPE_OPERATOR = 'TYPE_OPERATO';
const TYPE_OPERATOR = 'TYPE_OPERATOR';

public $type;
public $value;
Expand Down
Loading

0 comments on commit 0a2440c

Please sign in to comment.