Skip to content

Commit ebb63a6

Browse files
committed
Re-implement #224 in a cleaner way
Signed-off-by: William Desportes <[email protected]>
1 parent 18874bd commit ebb63a6

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

src/Components/FunctionCall.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
7878

7979
// End of statement.
8080
if ($token->type === Token::TYPE_DELIMITER) {
81+
--$list->idx; // Let last token to previous one to avoid "This type of clause was previously parsed."
8182
break;
8283
}
8384

src/Statement.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace PhpMyAdmin\SqlParser;
66

7-
use PhpMyAdmin\SqlParser\Components\FunctionCall;
87
use PhpMyAdmin\SqlParser\Components\OptionsArray;
98
use Stringable;
109

@@ -415,13 +414,6 @@ public function parse(Parser $parser, TokensList $list)
415414
}
416415

417416
$this->after($parser, $list, $token);
418-
419-
// #223 Here may make a patch, if last is delimiter, back one
420-
if ($class !== FunctionCall::class || $list->offsetGet($list->idx)->type !== Token::TYPE_DELIMITER) {
421-
continue;
422-
}
423-
424-
--$list->idx;
425417
}
426418

427419
// This may be corrected by the parser.

0 commit comments

Comments
 (0)