protected function argumentDef(&$args, &$isVararg, $delim = ',')
    {
        $s = $this->seek();
        if (!$this->literal('(')) {
            return false;
        }

        $values = array();

        $isVararg = false;
        while (true) {
            if ($this->literal('...')) {
                $isVararg = true;
                break;
            }

            if ($this->variable($vname)) {
                $arg = array('arg', $vname);
                $ss = $this->seek();
                if ($this->assign() && $this->expressionList($value)) {
                    $arg[] = $value;
                } else {
                    $this->seek($ss);
                    if ($this->literal('...')) {
                        $arg[0] = 'rest';
                        $isVararg = true;
                    }
                }
                $values[] = $arg;
                if ($isVararg) {
                    break;
                }
                continue;
            }

            if ($this->value($literal)) {
                $values[] = array('lit', $literal);
            }

            if (!$this->literal($delim)) {
                break;
            }
        }

        if (!$this->literal(')')) {
            $this->seek($s);

            return false;
        }

        $args = $values;

        return true;
    }
protected function argumentDef(&$args, &$isVararg, $delim = ',')
    {
        $s = $this->seek();
        if (!$this->literal('(')) {
            return false;
        }

        $values = array();

        $isVararg = false;
        while (true) {
            if ($this->literal('...')) {
                $isVararg = true;
                break;
            }

            if ($this->variable($vname)) {
                $arg = array('arg', $vname);
                $ss = $this->seek();
                if ($this->assign() && $this->expressionList($value)) {
                    $arg[] = $value;
                } else {
                    $this->seek($ss);
                    if ($this->literal('...')) {
                        $arg[0] = 'rest';
                        $isVararg = true;
                    }
                }
                $values[] = $arg;
                if ($isVararg) {
                    break;
                }
                continue;
            }

            if ($this->value($literal)) {
                $values[] = array('lit', $literal);
            }

            if (!$this->literal($delim)) {
                break;
            }
        }

        if (!$this->literal(')')) {
            $this->seek($s);

            return false;
        }

        $args = $values;

        return true;
    }
protected function argumentDef ( & $ args , & $ isVararg , $ delim = ',' ) { $ s = $ this -> seek ( ) ; if ( ! $ this -> literal ( '(' ) ) { return false ; } $ values = array ( ) ; $ isVararg = false ; while ( true ) { if ( $ this -> literal ( '...' ) ) { $ isVararg = true ; break ; } if ( $ this -> variable ( $ vname ) ) { $ arg = array ( 'arg' , $ vname ) ; $ ss = $ this -> seek ( ) ; if ( $ this -> assign ( ) && $ this -> expressionList ( $ value ) ) { $ arg [ ] = $ value ; } else { $ this -> seek ( $ ss ) ; if ( $ this -> literal ( '...' ) ) { $ arg [ 0 ] = 'rest' ; $ isVararg = true ; } } $ values [ ] = $ arg ; if ( $ isVararg ) { break ; } continue ; } if ( $ this -> value ( $ literal ) ) { $ values [ ] = array ( 'lit' , $ literal ) ; } if ( ! $ this -> literal ( $ delim ) ) { break ; } } if ( ! $ this -> literal ( ')' ) ) { $ this -> seek ( $ s ) ; return false ; } $ args = $ values ; return true ; }
or at the end a ... or a variable named followed by ...
or at the end a ... or a variable named followed by ...