Skip to content

Commit 0c88682

Browse files
committed
Bugfix: Function expressions without arguments are now possible
1 parent b7d1417 commit 0c88682

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Parser/JsonPathParser.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,15 @@ protected function parseFunction(): FunctionNode
336336

337337
$this->consume(LeftParenthesisToken::class);
338338

339-
$argumentNodes = [
340-
$this->parseFunctionArgument()
341-
];
339+
$argumentNodes = [];
342340

343-
while ($this->getCurrentToken()::class === CommaToken::class) {
344-
$this->consume(CommaToken::class);
341+
if ($this->getCurrentToken()::class !== RightParenthesisToken::class) {
345342
$argumentNodes[] = $this->parseFunctionArgument();
343+
344+
while ($this->getCurrentToken()::class === CommaToken::class) {
345+
$this->consume(CommaToken::class);
346+
$argumentNodes[] = $this->parseFunctionArgument();
347+
}
346348
}
347349

348350
$this->consume(RightParenthesisToken::class);

0 commit comments

Comments
 (0)