Leafo\ScssPhp\Parser::argumentDef PHP Method

argumentDef() protected method

Parse mixin/function definition argument list
protected argumentDef ( array &$out ) : boolean
$out array
return boolean
    protected function argumentDef(&$out)
    {
        $s = $this->seek();
        $this->literal('(');
        $args = [];
        while ($this->variable($var)) {
            $arg = [$var[1], null, false];
            $ss = $this->seek();
            if ($this->literal(':') && $this->genericList($defaultVal, 'expression')) {
                $arg[1] = $defaultVal;
            } else {
                $this->seek($ss);
            }
            $ss = $this->seek();
            if ($this->literal('...')) {
                $sss = $this->seek();
                if (!$this->literal(')')) {
                    $this->throwParseError('... has to be after the final argument');
                }
                $arg[2] = true;
                $this->seek($sss);
            } else {
                $this->seek($ss);
            }
            $args[] = $arg;
            if (!$this->literal(',')) {
                break;
            }
        }
        if (!$this->literal(')')) {
            $this->seek($s);
            return false;
        }
        $out = $args;
        return true;
    }