Compiles the given string containing Blade pseudo-code into valid PHP.

@param  string  $value
@param  View    $view
@return string
546848
public static function compile_string($value, $view = null)
	{
		foreach (static::$compilers as $compiler)
		{
			$method = "compile_{$compiler}";

			$value = static::$method($value, $view);
		}

		return $value;
	}
862227
protected function compileLanguage($value)
	{
		$pattern = $this->createMatcher('lang');

		$value = preg_replace($pattern, '$1<?php echo \Fly\Support\Facades\Lang::get$2; ?>', $value);

		$pattern = $this->createMatcher('choice');

		return preg_replace($pattern, '$1<?php echo \Fly\Support\Facades\Lang::choice$2; ?>', $value);
	}
141555
public function compileWiths($value, array $args = array())
    {
        $generated = parent::compileString($value);

        ob_start() and extract($args, EXTR_SKIP);

        try {
            eval('?>'.$generated);
        } catch (\Exception $e) {
            ob_get_clean();
            throw $e;
        }

        $content = ob_get_clean();

        return $content;
    }
383671
protected function _compileRawEchos($value)
    {
        $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->_rawTags[0], $this->_rawTags[1]);

        $callback = function ($matches) {
            $whitespace = empty($matches[3]) ? '' : $matches[3];

            return $matches[1] ? substr($matches[0], 1) : '<?= ' . $this->_compileEchoDefaults($matches[2]) . '; ?>' . $whitespace;
        };

        return preg_replace_callback($pattern, $callback, $value);
    }
391941
public function compile($value)
    {
        // Only continue is shortcodes have been registered
        if(!$this->enabled || !$this->hasShortcodes())
            return $value;

        // Set empty result
        $result = '';

        // Here we will loop through all of the tokens returned by the Zend lexer and
        // parse each one into the corresponding valid PHP. We will then have this
        // template as the correctly rendered PHP that can be rendered natively.
        foreach (token_get_all($value) as $token)
        {
            $result .= is_array($token) ? $this->parseToken($token) : $token;
        }

        return $result;
    }
281356
public static function compileBlade($str, $data = [])
    {
        if (view()->exists($str)) {
            return view($str, $data)->render();
        }

        ob_start() && extract($data, EXTR_SKIP);
        eval('?>' . app('blade.compiler')->compileString($str));
        $str = ob_get_contents();
        ob_end_clean();

        return $str;
    }
754084
public function compileString($value)
    {
        if (strpos($value, '@verbatim') !== false) {
            $value = $this->storeVerbatimBlocks($value);
        }

        $this->footer = [];

        if (strpos($value, '@php') !== false) {
            $value = $this->storePhpBlocks($value);
        }

        $result = '';

        // Here we will loop through all of the tokens returned by the Zend lexer and
        // parse each one into the corresponding valid PHP. We will then have this
        // template as the correctly rendered PHP that can be rendered natively.
        foreach (token_get_all($value) as $token) {
            $result .= is_array($token) ? $this->parseToken($token) : $token;
        }

        if (! empty($this->rawBlocks)) {
            $result = $this->restoreRawContent($result);
        }

        // If there are any footer lines that need to get added to a template we will
        // add them here at the end of the template. This gets used mainly for the
        // template inheritance via the extends keyword that should be appended.
        if (count($this->footer) > 0) {
            $result = $this->addFooters($result);
        }

        return $result;
    }
1328429
public function prepareValue($value)
    {
        return $value === null ? null : Carbon::createFromFormat($this->format, $value)->toDateString();
    }
976984
public function compile(&$view=NULL, $view_var='script_foot', $script_tags=TRUE) {
		$bs=$this->_bootstrap;
		if (isset($bs)&&isset($view)) {
			$bs->compileHtml($this, $view);
		}
		$sem=$this->_semantic;
		if (isset($sem)&&isset($view)) {
			$sem->compileHtml($this, $view);
		}
		return $this->js->_compile($view, $view_var, $script_tags);
	}
822745
public function parseTemplateText($viewText, &$model) {

        // Extract all template parameters into scope.
        extract($model);

        // Store defined variables before we evaluate
        $preVariables = get_defined_vars() ? get_defined_vars() : array();
        unset($preVariables["model"]);

        // Now use an object buffer to get the result.
        ob_start();
        include $viewText;
        $result = ob_get_contents();
        ob_end_clean();

        // Add any newly scoped variables
        $postVariables = get_defined_vars() ? get_defined_vars() : array();
        foreach ($postVariables as $key => $value) {
            if ($key == "model") continue;
            if (!isset($preVariables[$key]) || ($value != $preVariables[$key])) {
                $model[$key] = $value;
            }
        }


        return $result;
    }
547501
protected function extension( $view ) {
		$extensions = $this->extensions();

		// Return if a valid extension exists in the template string.
		$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
		if ( preg_match( $ext_reg, $view ) ) {
			return $template;
		}

		// Add extension to template string if it don't exists.
		return substr( $view, -strlen( $extensions[0] ) ) === $extensions[0]
			? $view : $view . $extensions[0];
	}
1237514
public function compileString( $value )
	{
		$result = '';

		if ( strpos( $value, '@verbatim' ) !== false )
		{
			$value = $this->storeVerbatimBlocks( $value );
		}

		$this->footer = [];

		// Here we will loop through all of the tokens returned by the Zend lexer and
		// parse each one into the corresponding valid PHP. We will then have this
		// template as the correctly rendered PHP that can be rendered natively.
		foreach ( token_get_all( $value ) as $token )
		{
			$result .= is_array( $token ) ? $this->parseToken( $token ) : $token;
		}

		if ( !empty( $this->verbatimBlocks ) )
		{
			$result = $this->restoreVerbatimBlocks( $result );
		}

		// If there are any footer lines that need to get added to a template we will
		// add them here at the end of the template. This gets used mainly for the
		// template inheritance via the extends keyword that should be appended.
		if ( count( $this->footer ) > 0 )
		{
			$result = ltrim( $result, PHP_EOL ) . PHP_EOL . implode( PHP_EOL, array_reverse( $this->footer ) );
		}

		return $result;
	}
1056184
private function generateView($view)
    {
        return $this->indenter
            ->indent(view('scaffold-interface::template.views.'.$this->parser->getTemplate().'.'.$view,
                ['parser' => $this->parser, 'dataSystem' => $this->dataSystem])->render());
    }
1113027
private function compile_phptag( $view )
	{
		// I hate this workaround
		$that = $this;

		return preg_replace_callback('/\{\%(.*?)\%\}/s', function( $match ) use( $that )
		{ 
			$expression = trim( $match[1] );

			// repair it 
			$expression = $that->repair_expression( $expression );

			return '<?php '.$expression.' ?>'; 
		}, $view );
	}
377150
public function template(ViewFactory $view)
    {
        $markup = $view->make('Fielder::Tinymce/Tinymce', [
            'fingerprint' => $this->getFingerprint(),
        ])->render();

        return str_replace('name=', ':name=', $markup);
    }
1311961
public function rawClosure($value, BlockView $view)
    {
        if ($value instanceof \Closure) {
            $value = $value($view);
        }

        return $value;
    }
791696
protected function compileComments($value)
    {
        // comment with < %-- --% > or {{-- --}}

        $pattern = sprintf('/%s#((.|\s)*?)%s/', $this->contentTags[0], $this->contentTags[1]);

        $value = preg_replace($pattern, '<?php /* $1 */ ?>', $value);

        $pattern = sprintf('/%s--((.|\s)*?)--%s/', '{{', '}}');

        $value = preg_replace($pattern, '<?php /* $1 */ ?>', $value);

        return $value;
    }