Neos\Eel\EelParser::match_ConditionalExpression PHP Method

match_ConditionalExpression() public method

public match_ConditionalExpression ( $stack = [] )
    function match_ConditionalExpression($stack = array())
    {
        $matchrule = "ConditionalExpression";
        $result = $this->construct($matchrule, $matchrule, null);
        $_105 = NULL;
        do {
            $matcher = 'match_' . 'Disjunction';
            $key = $matcher;
            $pos = $this->pos;
            $subres = $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->{$matcher}(array_merge($stack, array($result))));
            if ($subres !== FALSE) {
                $this->store($result, $subres, "cond");
            } else {
                $_105 = FALSE;
                break;
            }
            $res_104 = $result;
            $pos_104 = $this->pos;
            $_103 = NULL;
            do {
                if (($subres = $this->whitespace()) !== FALSE) {
                    $result["text"] .= $subres;
                }
                if (substr($this->string, $this->pos, 1) == '?') {
                    $this->pos += 1;
                    $result["text"] .= '?';
                } else {
                    $_103 = FALSE;
                    break;
                }
                if (($subres = $this->whitespace()) !== FALSE) {
                    $result["text"] .= $subres;
                }
                $matcher = 'match_' . 'Expression';
                $key = $matcher;
                $pos = $this->pos;
                $subres = $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->{$matcher}(array_merge($stack, array($result))));
                if ($subres !== FALSE) {
                    $this->store($result, $subres, "then");
                } else {
                    $_103 = FALSE;
                    break;
                }
                if (($subres = $this->whitespace()) !== FALSE) {
                    $result["text"] .= $subres;
                }
                if (substr($this->string, $this->pos, 1) == ':') {
                    $this->pos += 1;
                    $result["text"] .= ':';
                } else {
                    $_103 = FALSE;
                    break;
                }
                if (($subres = $this->whitespace()) !== FALSE) {
                    $result["text"] .= $subres;
                }
                $matcher = 'match_' . 'Expression';
                $key = $matcher;
                $pos = $this->pos;
                $subres = $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->{$matcher}(array_merge($stack, array($result))));
                if ($subres !== FALSE) {
                    $this->store($result, $subres, "else");
                } else {
                    $_103 = FALSE;
                    break;
                }
                $_103 = TRUE;
                break;
            } while (0);
            if ($_103 === FALSE) {
                $result = $res_104;
                $this->pos = $pos_104;
                unset($res_104);
                unset($pos_104);
            }
            $_105 = TRUE;
            break;
        } while (0);
        if ($_105 === TRUE) {
            return $this->finalise($result);
        }
        if ($_105 === FALSE) {
            return FALSE;
        }
    }