parse lang :
{{lang:id:vars}}
{{lang[absolute]:id:vars}}
{_{lang:id:vars}_}
{_{lang[template]:id:vars}_}
@access protected
@return void
@since 3.0
@package Gcs\Framework\Core\Template
358847
protected function _parseLang() {
        $this->_content = preg_replace_callback('`' . preg_quote($this->markup['vars'][7]) . '(\:)(.*)' . preg_quote($this->markup['vars'][2]) . '`isU', ['Gcs\Framework\Core\Template\Parser', '_parseLangCallBack'], $this->_content);
        $this->_content = preg_replace_callback('`' . preg_quote($this->markup['vars'][7]) . '(\[template\]\:)(.+)' . preg_quote($this->markup['vars'][2]) . '`isU', ['Gcs\Framework\Core\Template\Parser', '_parseLangCallBack'], $this->_content);
        $this->_content = preg_replace_callback('`' . preg_quote($this->markup['vars'][9]) . '(\:)(.*)' . preg_quote($this->markup['vars'][3]) . '`isU', ['Gcs\Framework\Core\Template\Parser', '_parseLangCallBackNoEcho'], $this->_content);
        $this->_content = preg_replace_callback('`' . preg_quote($this->markup['vars'][9]) . '(\[template\]\:)(.+)' . preg_quote($this->markup['vars'][3]) . '`isU', ['Gcs\Framework\Core\Template\Parser', '_parseLangCallBackNoEcho'], $this->_content);
    }
1302820
public function parse(){
		if(!preg_match('/(.+?)\s*{/is', $this->parser->getText(), $matches)) throw new \Exception("Invalid selector at '".substr($this->getText(), 0, 20)."'");
		$this->parser->move(strlen($matches[0]));
		
		$selectors = array();
		foreach(explode(',', $matches[1]) as $selector){
			$selectors[] = self::parseSelector(trim($selector));
		}
		
		$ruleSet = new \csslib\RuleSet($selectors);
		$this->parent->add($ruleSet);
		
		$this->setPropertySet($ruleSet);
		parent::parse();
	}
1038831
protected function _parseArgs()
    {
        $inString = false;
        $cpt = 0;
        $last = $char = $value = $name = '';
        $args = [];
        $body = '';
        while ($token = $this->_stream->current(true)) {
            $body .= $token[1];
            switch ($token[0]) {
                case '(':
                    if ($cpt) {
                        $value .= $token[1];
                    }
                    $cpt++;
                break;
                case '=':
                    $name = $value;
                    $value = '';
                break;
                case ')':
                    $cpt--;
                    if ($cpt) {
                        $value .= $token[1];
                        break;
                    }
                case ',':
                    $value = trim($value);
                    if ($value !== '') {
                        $name ? $args[trim($name)] = $value : $args[] = $value;
                    }
                    $name = $value = '';
                break;
                default:
                    $value .= $token[1];
                break;
            }
            if ($token[1] === ')' && $cpt === 0) {
                break;
            }
            $this->_stream->next();
        }
        return compact('args', 'body');
    }
858478
protected function parse(): void
    {
        // add the root node
        $this->root = new HtmlNode('root');
        $activeNode = $this->root;
        while ( ! is_null($activeNode)) {
            $str = $this->content->copyUntil('<');
            if ($str == '') {
                $info = $this->parseTag();
                if ( ! $info['status']) {
                    // we are done here
                    $activeNode = null;
                    continue;
                }

                // check if it was a closing tag
                if ($info['closing']) {
                    $foundOpeningTag  = true;
                    $originalNode     = $activeNode;
                    while ($activeNode->getTag()->name() != $info['tag']) {
                        $activeNode = $activeNode->getParent();
                        if (is_null($activeNode)) {
                            // we could not find opening tag
                            $activeNode = $originalNode;
                            $foundOpeningTag = false;
                            break;
                        }
                    }
                    if ($foundOpeningTag) {
                        $activeNode = $activeNode->getParent();
                    }
                    continue;
                }

                if ( ! isset($info['node'])) {
                    continue;
                }

                /** @var AbstractNode $node */
                $node = $info['node'];
                $activeNode->addChild($node);

                // check if node is self closing
                if ( ! $node->getTag()->isSelfClosing()) {
                    $activeNode = $node;
                }
            } else if ($this->options->whitespaceTextNode ||
                trim($str) != ''
            ) {
                // we found text we care about
                $textNode = new TextNode($str, $this->options->removeDoubleSpace);
                $activeNode->addChild($textNode);
            }
        }
    }
147061
public function parse_template()
    {
        $self = $this;
        return preg_replace_callback('/\{\{([a-zA-Z\d-_]+)\}\}/', function($a) use($self) {
            $component = $self->get_component($a[1]);
            return $component->render();
        }, $this->model['template']);
    }
510720
public function prepareVars()
    {
        $this->vars['cssClasses'] = implode(' ', $this->cssClasses);
        $this->vars['placeholder'] = Lang::get($this->prompt);
        $this->vars['value'] = $this->getActiveTerm();
        $this->vars['searchOnEnter'] = $this->searchOnEnter;
    }
995567
public function parse(array $vars = [])
    {
        $this->loadVars($vars);

        $output = $this->parsePhp();

        // Run Template Engines
        $output = $this->template->parse($output, $this->vars);

        // Run String Engines
        $output = $this->string->parse($output, $this->vars);

        return $output;
    }
326904
protected function _parseTemplate()
	{
		$matches = array();

		if (preg_match_all('#<jdoc:include\ type="([^"]+)" (.*)\/>#iU', $this->_template, $matches))
		{
			$template_tags_first = array();
			$template_tags_last  = array();

			// Step through the jdocs in reverse order.
			for ($i = count($matches[0]) - 1; $i >= 0; $i--)
			{
				$type = $matches[1][$i];
				$attribs = empty($matches[2][$i]) ? array() : $this->parseAttributes($matches[2][$i]);
				$name = isset($attribs['name']) ? $attribs['name'] : null;

				// Separate buffers to be executed first and last
				if ($type == 'module' || $type == 'modules')
				{
					$template_tags_first[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
				else
				{
					$template_tags_last[$matches[0][$i]]  = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
			}
			// Reverse the last array so the jdocs are in forward order.
			$template_tags_last = array_reverse($template_tags_last);

			$this->_template_tags = $template_tags_first + $template_tags_last;
		}

		return $this;
	}
58807
public function parse(){
		while($this->parser->hasText()){
			// Skip any white-space
			if(preg_match('/^\s+/is', $this->parser->getText(), $matches)){
				$this->parser->move(strlen($matches[0]));
				if(!$this->parser->hasText()) break;
			}
			
			if(preg_match('/^\/\*/', $this->parser->getText())){
				if(!preg_match('/^\/\*(.+?)\*\//s', $this->parser->getText(), $matches)) throw new \Exception('Unterminated comments');
				$this->parser->move(strlen($matches[0]));
			}else if(preg_match('/^@(\S+)/is', $this->parser->getText(), $matches)){
				switch($matches[2]){
					//case 'font-face': $atRule = new CSSFontFaceParser($this->parser, $this->parent); break;
					default: throw new Exception("Unknown At-rule '".$matches[0]."'");
				}
				$atRule->parse();
			}else{
				$ruleset = new RuleSet($this->parser, $this->parent);
				$ruleset->parse();
			}
		}
	}
327580
private function parseValue()
    {
        $this->getNextToken();

        if ($this->tokenIs(T_ARRAY) || $this->tokenIs('[')) {
            // Sub array with key.
            $this->debug('Sub array with key.');
            $subparser = new ArrayParser($this->parser, ($this->level + 1));
            $subparser->parse();
        } else {
            // String item with key.
            $this->debug('String item with key.');
            $subparser = new StringValue($this->parser, ($this->level + 1));
            $subparser->parse();

            $this->parser->setValue($this->parser->getStack(), $subparser->getValue());
        }
    }
633760
private function parseItem()
    {
        $subparser = new StringValue($this->parser, ($this->level + 1));
        $subparser->parse();

        $key = $subparser->getValue();

        $this->debug('key: ' . var_export($key, true));

        if ($this->tokenIs(T_DOUBLE_ARROW)) {
            // We MUST have an key when double arrow is encountered.
            if ($key === null) {
                $this->bailUnexpectedToken();
            }

            $this->pushStack($key);
            $this->parseValue();
            $this->popStack();
        } elseif ($this->tokenIs(',') || $this->tokenIs(')') || $this->tokenIs(']')) {
            // String item without key.
            $this->debug('String item without key.');
            $this->pushStack($this->counter++);
            $this->parser->setValue($this->parser->getStack(), $key);
            $this->popStack();
        }

        if ($this->tokenIs(',')) {
            $this->getNextToken();
            return true;
        }
        if ($this->tokenIs(')') || $this->tokenIs(']')) {
            $this->debug('closing bracket.');
            $this->getNextToken();

            return false;
        }

        return true;
    }
1318689
final public function parse()
    {
        $wsdl = $this->generator->getWsdl();
        if ($wsdl instanceof Wsdl) {
            $content = $wsdl->getContent();
            if ($content instanceof WsdlDocument) {
                if ($this->isWsdlParsed($wsdl) === false) {
                    $this->setWsdlAsParsed($wsdl)->setTags($content->getElementsByName($this->parsingTag()))->parseWsdl($wsdl);
                }
                foreach ($content->getExternalSchemas() as $schema) {
                    if ($this->isSchemaParsed($wsdl, $schema) === false) {
                        $this->setSchemaAsParsed($wsdl, $schema);
                        $schemaContent = $schema->getContent();
                        if ($schemaContent instanceof SchemaDocument) {
                            $this->setTags($schemaContent->getElementsByName($this->parsingTag()))->parseSchema($wsdl, $schema);
                        }
                    }
                }
            }
        }
    }
36419
protected function _parseVarFunc() {
        $this->_content = preg_replace('`' . preg_quote($this->markup['vars'][0]) . $this->_space . $this->_openTag . 'gc:function(.+)' . $this->_closeTag . $this->_space . preg_quote($this->markup['vars'][1]) . '`isU', '<?php echo ' . $this->_openTag . 'gc:function$1' . $this->_closeTag . '; ?>', $this->_content);
    }
534033
public function parse()
    {
        // Fetch the basic values from possible user defined values.
        if ($this->entity->hasConfig("labels")) {
            if ($this->entity->hasConfig("labels.singular_name")) {
                $this->singular = $this->entity->getConfig("labels.singular_name");
            } elseif ($this->entity->hasConfig("labels.name")) {
                $this->plural = $this->entity->getConfig("labels.name");
            }
        }

        if (!empty($this->singular) && empty($this->plural)) {
            $this->plural = Inflector::pluralize($this->singular);
        }

        if (!empty($this->plural) && empty($this->singular)) {
            $this->singular = Inflector::singularize($this->plural);
        }

        // If nothing is sent in, guess the name from the object name.
        if (empty($this->plural) && empty($this->singular)) {
            $this->singular   = ucfirst(Inflector::singularize($this->entity->getShortName()));
            $this->plural     = ucfirst(Inflector::pluralize($this->entity->getShortName()));
        }
    }
1328241
public function parse(): bool
    {
        if ($this->valid === true) {
            /**
             * Before processing through the deltas, generate new deltas by splliting
             * on all new lines, will make it much simpler to work out which
             * delta belong to headings, lists etc.
             */
            $this->quill_json = $this->splitInsertsByNewline($this->quill_json['ops']);

            foreach ($this->quill_json as $quill) {

                if ($quill['insert'] !== null) {
                    if (
                        array_key_exists('attributes', $quill) === true &&
                        is_array($quill['attributes']) === true
                    ) {
                        if (count($quill['attributes']) === 1) {
                            foreach ($quill['attributes'] as $attribute => $value) {
                                switch ($attribute) {
                                    case Options::ATTRIBUTE_BOLD:
                                        $this->attributeBold($quill);
                                        break;

                                    case Options::ATTRIBUTE_COLOR:
                                        $this->attributeColor($quill);
                                        break;

                                    case Options::ATTRIBUTE_HEADER:
                                        $this->attributeHeader($quill);
                                        break;

                                    case Options::ATTRIBUTE_ITALIC:
                                        $this->attributeItalic($quill);
                                        break;

                                    case Options::ATTRIBUTE_LINK:
                                        $this->attributeLink($quill);
                                        break;

                                    case Options::ATTRIBUTE_LIST:
                                        $this->attributeList($quill);
                                        break;

                                    case Options::ATTRIBUTE_SCRIPT:
                                        $this->attributeScript($quill);
                                        break;

                                    case Options::ATTRIBUTE_STRIKE:
                                        $this->attributeStrike($quill);
                                        break;

                                    case Options::ATTRIBUTE_UNDERLINE:
                                        $this->attributeUnderline($quill);
                                        break;

                                    default:
                                        $this->insert($quill);
                                        break;
                                }
                            }
                        } else {
                            $this->compoundInsert($quill);
                        }
                    } else {
                        if (is_string($quill['insert']) === true) {
                            $this->insert($quill);
                        } else {
                            if (is_array($quill['insert']) === true) {
                                if (array_key_exists('image', $quill['insert']) === true) {
                                    $this->image($quill);
                                } else if (array_key_exists('video', $quill['insert']) === true) {
                                    $this->video($quill);
                                }
                            }
                        }
                    }
                }
            }
            return true;
        } else {
            return false;
        }
    }
1079366
private function _parse_variable_to()
    {
        $parts = explode('#', $this->_to);
        empty($parts[1]) && $parts[1] = 'index';
        
        $part = is_int(strpos($parts[0], ':')) ? $parts[0] : $parts[1];
        
        preg_match('/:(\w+)/', $part, $m);
        $type = $m[1];
        
        return $type;
    }
1341801
public function assign_to_var()
    {
        $var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number);
        $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);

        return $var;
    }