Faz a análise de expressões no formato inline.
Como nos argumentos de funções:
minha_funcao (   $arg_one, $arg_two   );
|____Função_____| |____Expressão____|

@param  string $expression
@return array
433754
protected function parseInlineArguments(string $expression) : array
    {
        $splited = explode(',', $expression);
        $arguments = [];
        $function_part = false;
        $current = 0;
        foreach ($splited as $part){

            if(!isset($arguments[$current])) {
                $arguments[$current] = '';
            }

            // Função: string seguida de (
            if(preg_match('#[a-zA-Z] ?\(#', $part) && strpos($part, ')', -1) === false) {
                $function_part = true;
                $arguments[$current] = trim($part);
                continue;

            } elseif($function_part == true && strpos($part, ')', -1) !== false) {
                // Função: string terminando com )
                $function_part = false;
                $arguments[$current] .= "," . trim($part);

            } elseif($function_part == true) {
                // Função: argumentos internos
                $arguments[$current] .= "," . trim($part);
                continue;

            } else {
                $arguments[$current] = $part;
            }
            $current++;
        }

        return $arguments;
    }
711252
private function parseExpression($expression)
    {
        // Check for URI operators
        $operator = '';

        if (isset(self::$operatorHash[$expression[0]])) {
            $operator = $expression[0];
            $expression = substr($expression, 1);
        }

        $values = explode(',', $expression);
        foreach ($values as &$value) {
            $value = trim($value);
            $varspec = array();
            $substrPos = strpos($value, ':');
            if ($substrPos) {
                $varspec['value'] = substr($value, 0, $substrPos);
                $varspec['modifier'] = ':';
                $varspec['position'] = (int) substr($value, $substrPos + 1);
            } elseif (substr($value, -1) == '*') {
                $varspec['modifier'] = '*';
                $varspec['value'] = substr($value, 0, -1);
            } else {
                $varspec['value'] = (string) $value;
                $varspec['modifier'] = '';
            }
            $value = $varspec;
        }

        return array(
            'operator' => $operator,
            'values'   => $values
        );
    }
154004
private function parseRequestValueExpression(string $expression, RequestInterface $request): string
    {
        $expression = preg_replace_callback(
            '/(\$\w+)/',
            function ($matches) use ($request) {
                $variable = $request->get(substr($matches[1], 1));

                if (is_array($variable) || is_object($variable)) {
                    throw new \InvalidArgumentException(
                        sprintf(
                            'Cannot use %s ($%s) as parameter in expression.',
                            gettype($variable),
                            $matches[1]
                        )
                    );
                }

                return is_string($variable) ? sprintf('"%s"', $variable)
                    : $variable;
            },
            $expression
        );

        return $this->expression->evaluate(
            $expression,
            ['container' => $this->container]
        );
    }
247299
public function passExpression(array $expression)
    {
        switch ($expression['type']) {
            case 'bool':
            case 'double':
            case 'int':
            case 'uint':
            case 'long':
            case 'ulong':
            case 'string':
            case 'istring':
            case 'null':
            case 'char':
            case 'uchar':
            case 'empty-array':
            case 'variable':
            case 'constant':
            case 'static-constant-access':
            case 'closure':
            case 'closure-arrow':
            case 'reference':
                break;

            case 'sub':
            case 'add':
            case 'div':
            case 'mul':
            case 'mod':
            case 'and':
            case 'or':
            case 'concat':
            case 'equals':
            case 'identical':
            case 'not-identical':
            case 'not-equals':
            case 'less':
            case 'greater':
            case 'greater-equal':
            case 'less-equal':
            case 'bitwise_and':
            case 'bitwise_or':
            case 'bitwise_xor':
            case 'bitwise_shiftleft':
            case 'bitwise_shiftright':
            case 'irange':
            case 'erange':
                $this->passExpression($expression['left']);
                $this->passExpression($expression['right']);
                break;

            case 'typeof':
            case 'not':
                $this->passExpression($expression['left']);
                break;

            case 'mcall':
            case 'fcall':
            case 'scall':
                $this->passCall($expression);
                break;

            case 'array':
                $this->passArray($expression);
                break;

            case 'new':
                $this->passNew($expression);
                break;

            case 'property-access':
            case 'property-dynamic-access':
            case 'property-string-access':
            case 'static-property-access':
            case 'array-access':
                $this->passExpression($expression['left']);
                break;

            case 'isset':
            case 'empty':
            case 'instanceof':
            case 'require':
            case 'clone':
            case 'likely':
            case 'unlikely':
            case 'ternary':
                /* do special pass later */
                $this->passExpression($expression['left']);
                break;

            case 'fetch':
                $this->increaseMutations($expression['left']['value']);
                $this->passExpression($expression['right']);
                break;

            case 'minus':
                $this->passExpression($expression['left']);
                break;

            case 'list':
                $this->passExpression($expression['left']);
                break;

            case 'cast':
            case 'type-hint':
                $this->passExpression($expression['right']);
                break;

            default:
                echo 'MutateGathererPassType=', $expression['type'], PHP_EOL;
                break;
        }
    }
420921
private function getArgumentsFromMatch($match = array())
    {
        if (is_array($match['params']) && count($match['params'])) {
            $params = $match['params'];
            return is_array($params) ? $params : array($params);
        }

        return array();
    }
1360000
protected function compileInject($expression) {
        $segments = explode(',', preg_replace("/[\(\)\\\"\']/", '', $expression));

        return '<?php $'.trim($segments[0])." = app('".trim($segments[1])."'); ?>";
    }
1185705
public final CALC expression(String expression) throws ParseException {
        detectImplmentedExtension();
        
        if (infixParser == null)
            infixParser = new InfixParser();
        
        CList infix = infixParser.parse(useExtensions, getProperties(), expression);
        expression(infix, false);
        return getThis();
    }
380892
function resolveExpression(expression) {
    // return empty string for undefined
    if (expression === undefined) {
        return "";
    }
    // return placeholder for promise
    if (isPromise(expression)) {
        // recursively resolve
        return "[promise]";
    }
    // return placeholder for function
    if (typeof expression === "function") {
        return "[function]";
    }
    // handle arrays
    if (Array.isArray(expression)) {
        var items = [];
        // resolve each item (might be promises as well)
        for (var _i = 0, expression_1 = expression; _i < expression_1.length; _i++) {
            var expressionItem = expression_1[_i];
            items.push(resolveExpression(expressionItem));
        }
        // join with newline
        return items.join("\n");
    }
    // return unmodified if got a string
    if (typeof expression === "string") {
        return expression;
    }
    // convert to string if got a number
    if (typeof expression === "number") {
        return expression.toString();
    }
    // return stringified value, handles circular references
    return flatted_1.stringify(expression, undefined, 2);
}
75122
private static function treeStruct(string $expression): array
    {
        if (\strpos($expression, '<?') === 0 || $expression[-1] === ';') {
            throw new \InvalidArgumentException('Expression syntax error');
        }

        $expression = '<?php ' . $expression . ';';

        $tokens = \token_get_all($expression);

        $temp = [];
        $level = 0;

        $n = \count($tokens);
        $i = 1; // skip T_OPEN_TAG
        for (; $i < $n; ++$i) {
            $token = $tokens[$i];

            $type = null;
            if (\is_array($token)) {
                $type = $token[0];

                if ($type === T_WHITESPACE) {
                    continue;
                }

                if (!\in_array($type, self::SUPPORT_TOKEN, true)) {
                    throw new \InvalidArgumentException('Expression contains not support token "' . \token_name($type) . '""');
                }

                if ($type === T_INC && ($tokens[$i - 1] === '+' || $tokens[$i + 1] === '+')) {
                    throw new \InvalidArgumentException('Expression contains error code: "+++');
                }

                if ($type === T_DEC && ($tokens[$i - 1] === '-' || $tokens[$i + 1] === '-')) {
                    throw new \InvalidArgumentException('Expression contains error code: "---');
                }
            }

            switch ($token) {
                case '?':
                    $part = $temp[$level];

                    if ($level === 0) {
                        $temp[$level++] = [$part, new Token($token)];
                    } else {
                        $parentLevel = $level - 1;
                        $temp[$parentLevel][] = $part;
                        $temp[$parentLevel][] = new Token($token);
                    }

                    $temp[$level] = [];
                    break;

                case ':':
                    if ($level === 0) {
                        throw new \InvalidArgumentException('Expression ternary syntax error');
                    }

                    $part = $temp[$level];

                    $parentLevel = $level - 1;
                    $temp[$parentLevel][] = $part;
                    $temp[$parentLevel][] = new Token($token);

                    $temp[$level] = [];
                    break;

                case ';':
                    if ($level > 0) {
                        $part = $temp[$level];
                        unset($temp[$level]);

                        $temp[--$level][] = $part;
                    }
                    ++$i;
                    break 2;
                case ')':
                case ']':
                    $temp[$level][] = new Token($token);
                    $part = $temp[$level];
                    unset($temp[$level]);

                    $temp[--$level][] = $part;
                    break;

                case '(':
                case '[':
                    $temp[++$level] = [new Token($token)];
                    break;

                default:
                    $temp[$level][] = new Token($token);
            }
        }

        if ($i !== $n) {
            throw new \InvalidArgumentException('The code has multi-line expression');
        }

        if (\count($temp) > 1) {
            throw new \InvalidArgumentException('Expression syntax error');
        }

        return $temp[0];
    }
176315
public static function line($expression, $export = false)
    {
        $trace = static::whereCall(__CLASS__ . '::line()', 'debug_line()');

        if ($export === true) {
            $trace->expression = var_export($expression, true);
        } else {
            $trace->expression = var_format($expression);
        }

        static::$chronology[] = $trace;
    }
1097992
protected function compileBlock($expression)
    {
        $output = preg_replace_callback(
            "/\n*\#block\s*\((.+?)(?:,(.+?))?\)\n*/m",
            function ($match) {
                array_shift($match);

                $content = null;

                if (count($match) == 2) {
                    $content = $match[1];
                }

                if (is_null($content)) {
                    return "<?php \$__tintin->getStackManager()->startStack({$match[0]}); ?>";
                } else {
                    return "<?php \$__tintin->getStackManager()->startStack({$match[0]}, $content); ?>";
                }
            },
            $expression
        );

        return $output == $expression ? '' : $output;
    }
56760
protected function buildExpression(Expression $expression)
    {
        $template = $expression instanceof Subquery ? '(%s)' : '%s';
        $expressionString = $this->stringifyExpression($expression);
        
        return trim(sprintf($template, $expressionString));
    }
235158
public function quoteExpression($expression)
    {
        if ($expression instanceof FieldInterface) {
            $this->_quoteComparison($expression);

            return;
        }

        if ($expression instanceof OrderByExpression) {
            $this->_quoteOrderBy($expression);

            return;
        }

        if ($expression instanceof IdentifierExpression) {
            $this->_quoteIdentifierExpression($expression);

            return;
        }
    }
843691
protected function convertToString($type, $expression)
	{
		switch($type)
		{
			case Type::STRING:
			case Type::TEXT:
				return $expression;
			case Type::BIGINT:
			case Type::DECIMAL:
			case Type::FLOAT:
			case Type::INTEGER:
			case Type::SMALLINT:
			case Type::DATE:
			case Type::DATETIME:
			case Type::DATETIMETZ:
			case Type::TIME:
				return 'CAST(' . $expression . ' AS CHAR)';
			default :
				return '\'\'';
		}
	}
121959
protected function extractEchoType($expression)
    {
        $echoType = self::ECHO_TEXT;
        $expression = trim($expression);
        if (preg_match('/^(text|structure)\s+(.*?)$/ism', $expression, $m)) {
            list(, $echoType, $expression) = $m;
        }
        $this->_echoType = strtolower($echoType);
        return trim($expression);
    }
146703
public function stripParentheses($expression)
    {
        if (Str::startsWith($expression, '(') && Str::endsWith($expression, ')')) {
            $expression = substr($expression, 1, -1);
        }

        return $expression;
    }
4451
public function evaluateExpression($expression)
    {
        if ($this->getTalesMode() === 'php') {
            return PHPTAL_Php_TalesInternal::php($expression);
        }
        return PHPTAL_Php_TalesInternal::compileToPHPExpressions($expression, false);
    }