Skip to content

Commit

Permalink
fix misplaced comma exception when calling a function
Browse files Browse the repository at this point in the history
the corresponding regression test is in the previous commit
  • Loading branch information
felixdorn committed Nov 5, 2021
1 parent 98994d6 commit 3b22716
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Tokens/Comma.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@

class Comma extends Token
{
public function __construct(public string $value = ',')
{

}

public function consume(Runtime $runtime): void
{
// If the token is a function argument separator (e.g., a comma):
$pe = false;

while ($runtime->operatorStack->isEmpty()) {
while (!$runtime->operatorStack->isEmpty()) {
$token = $runtime->operatorStack->top();

if ($token instanceof OpenParenthesis) {
Expand Down

0 comments on commit 3b22716

Please sign in to comment.