Skip to content

Commit ee0ffd0

Browse files
author
Maarten Staa
committed
Handle T_ELLIPSIS in argument lists.
Note: partial usage such as 'str_contains($text, ...)' is not (yet) allowed.
1 parent 65ce959 commit ee0ffd0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parser/function.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ module.exports = {
365365
read_argument_list: function () {
366366
let result = [];
367367
this.expect("(") && this.next();
368-
if (this.token !== ")") {
368+
if (this.token === this.tok.T_ELLIPSIS && this.peek() === ")") {
369+
result.push(this.token);
370+
this.next();
371+
} else if (this.token !== ")") {
369372
result = this.read_non_empty_argument_list();
370373
}
371374
this.expect(")") && this.next();

0 commit comments

Comments
 (0)