src/Parser.php
protected function func($name, &$func)
    {
        $s = $this->count;

        if ($this->matchChar('(')) {
            if ($name === 'alpha' && $this->argumentList($args)) {
                $func = [Type::T_FUNCTION, $name, [Type::T_STRING, '', $args]];

                return true;
            }

            if ($name !== 'expression' && ! preg_match('/^(-[a-z]+-)?calc$/', $name)) {
                $ss = $this->count;

                if ($this->argValues($args) && $this->matchChar(')')) {
                    $func = [Type::T_FUNCTION_CALL, $name, $args];

                    return true;
                }

                $this->seek($ss);
            }

            if (($this->openString(')', $str, '(') || true) &&
                $this->matchChar(')')
            ) {
                $args = [];

                if (! empty($str)) {
                    $args[] = [null, [Type::T_STRING, '', [$str]]];
                }

                $func = [Type::T_FUNCTION_CALL, $name, $args];

                return true;
            }
        }

        $this->seek($s);

        return false;
    }
protected function func($name, &$func)
    {
        $s = $this->count;

        if ($this->matchChar('(')) {
            if ($name === 'alpha' && $this->argumentList($args)) {
                $func = [Type::T_FUNCTION, $name, [Type::T_STRING, '', $args]];

                return true;
            }

            if ($name !== 'expression' && ! preg_match('/^(-[a-z]+-)?calc$/', $name)) {
                $ss = $this->count;

                if ($this->argValues($args) && $this->matchChar(')')) {
                    $func = [Type::T_FUNCTION_CALL, $name, $args];

                    return true;
                }

                $this->seek($ss);
            }

            if (($this->openString(')', $str, '(') || true) &&
                $this->matchChar(')')
            ) {
                $args = [];

                if (! empty($str)) {
                    $args[] = [null, [Type::T_STRING, '', [$str]]];
                }

                $func = [Type::T_FUNCTION_CALL, $name, $args];

                return true;
            }
        }

        $this->seek($s);

        return false;
    }
protected function func ( $ name , & $ func ) { $ s = $ this -> count ; if ( $ this -> matchChar ( '(' ) ) { if ( $ name === 'alpha' && $ this -> argumentList ( $ args ) ) { $ func = [ Type :: T_FUNCTION , $ name , [ Type :: T_STRING , '' , $ args ] ] ; return true ; } if ( $ name !== 'expression' && ! preg_match ( '/^(-[a-z]+-)?calc$/' , $ name ) ) { $ ss = $ this -> count ; if ( $ this -> argValues ( $ args ) && $ this -> matchChar ( ')' ) ) { $ func = [ Type :: T_FUNCTION_CALL , $ name , $ args ] ; return true ; } $ this -> seek ( $ ss ) ; } if ( ( $ this -> openString ( ')' , $ str , '(' ) || true ) && $ this -> matchChar ( ')' ) ) { $ args = [ ] ; if ( ! empty ( $ str ) ) { $ args [ ] = [ null , [ Type :: T_STRING , '' , [ $ str ] ] ] ; } $ func = [ Type :: T_FUNCTION_CALL , $ name , $ args ] ; return true ; } } $ this -> seek ( $ s ) ; return false ; }
Parse function call

@param string $name
@param array $out

@return boolean
Parse function call