Skip to content

Commit c123f08

Browse files
committed
Fix #372 - re-implement CALL statements parsing
Signed-off-by: William Desportes <[email protected]>
1 parent ebb63a6 commit c123f08

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/Components/FunctionCall.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ public static function parse(Parser $parser, TokensList $list, array $options =
8888
}
8989

9090
if ($state === 0) {
91-
$ret->name = $token->value;
92-
$state = 1;
93-
} elseif ($state === 1) {
94-
if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
95-
$ret->parameters = ArrayObj::parse($parser, $list);
91+
if ($token->type === Token::TYPE_OPERATOR && $token->value === '(') {
92+
--$list->idx; // ArrayObj needs to start with `(`
93+
$state = 1;
94+
continue;// do not add this token to the name
9695
}
9796

97+
$ret->name .= $token->value;
98+
} elseif ($state === 1) {
99+
$ret->parameters = ArrayObj::parse($parser, $list);
98100
break;
99101
}
100102
}

0 commit comments

Comments
 (0)