compile accordion group
548917
protected function compile()
	{
		if($this->objWrapper->getType() == ContentWrapper\Model::TYPE_START)
		{
			$GLOBALS['accordionGroup'] = 'accordion-group-' . $this->id;
			$GLOBALS['accordionGroupFirst'] = true;
			$this->Template->groupId = $GLOBALS['accordionGroup'];
		}
		else
		{
			$GLOBALS['accordionGroup'] = null;
			$GLOBALS['accordionGroupFirst'] = null;
		}
	}
1317359
public function compile()
    {
        $indent         = '    ';
        $caseStatements = array();
        $getters        = array();
        $instances      = $this->dumper->getAllInjectedDefinitions();

        /* @var $instance GeneratorInstance */
        foreach ($instances as $name => $instance) {
            $getter = $this->normalizeAlias($name);
            $constructor = $instance->getConstructor();
            $instantiatorParams = $this->buildParams($instance->getParams());

            if ('__construct' !== $constructor) {
                // Constructor callback
                if (is_callable($constructor)) {
                    $callback = $constructor;

                    if (is_array($callback)) {
                        $class = (is_object($callback[0])) ? get_class($callback[0]) : $callback[0];
                        $method = $callback[1];
                    } elseif (is_string($callback) && strpos($callback, '::') !== false) {
                        list($class, $method) = explode('::', $callback, 2);
                    }

                    $callback = var_export(array($class, $method), true);

                    if (count($instantiatorParams)) {
                        $creation = sprintf('$object = call_user_func(%s, %s);', $callback, implode(', ', $instantiatorParams));
                    } else {
                        $creation = sprintf('$object = call_user_func(%s);', $callback);
                    }
                } else if (is_string($constructor) && strpos($constructor, '->') !== false) {
                    list($class, $method) = explode('->', $constructor, 2);

                    if (!class_exists($class)) {
                        throw new InvalidArgumentException('No class found: ' . $class);
                    }

                    $factoryGetter = $this->normalizeAlias($class);

                    if (count($instantiatorParams)) {
                        $creation = sprintf('$object = $this->' . $factoryGetter . '()->%s(%s);', $method, implode(', ', $instantiatorParams));
                    } else {
                        $creation = sprintf('$object = $this->' . $factoryGetter . '()->%s();', $method);
                    }
                } else {
                    throw new InvalidArgumentException('Invalid instantiator supplied for class: ' . $name);
                }
            } else {
                $className = '\\' . trim($this->reduceAlias($name), '\\');

                if (count($instantiatorParams)) {
                    $creation = sprintf('$object = new %s(%s);', $className, implode(', ', $instantiatorParams));
                } else {
                    $creation = sprintf('$object = new %s();', $className);
                }
            }


            // Create method call code
            if ($instance->isShared()) {
                $creation .= "\n\nif (\$isShared) {\n" . $indent
                    . '$this->instanceManager->addSharedInstance($object, \'' . $instance->getName() . '\');'
                    . "\n}\n";
            }
            $methods = '';

            foreach ($instance->getMethods() as $methodData) {
                $methodName   = $methodData['method'];
                $methodParams = $methodData['params'];
                // Create method parameter representation
                $params = $this->buildParams($methodParams);

                if (count($params)) {
                    $methods .= sprintf("\$object->%s(%s);\n", $methodName, implode(', ', $params));
                }
            }

            $storage = '';

            // Start creating getter
            $getterBody = '';

            // Creation and method calls
            $getterBody .= sprintf("%s\n", $creation);
            $getterBody .= $methods;

            // Stored service
            $getterBody .= $storage;

            // End getter body
            $getterBody .= "return \$object;\n";

            $getterDef = new MethodGenerator();
            $getterDef->setName($getter);
            $getterDef->setParameter('isShared');
            $getterDef->setVisibility(MethodGenerator::VISIBILITY_PROTECTED);
            $getterDef->setBody($getterBody);
            $getters[] = $getterDef;

            // Build case statement and store
            $statement = '';
            $statement .= sprintf("%scase '%s':\n", $indent, $name);
            $statement .= sprintf("%sreturn \$this->%s(%s);\n", str_repeat($indent, 2), $getter, '$isShared');

            $caseStatements[] = $statement;
        }

        // Build switch statement
        $switch = sprintf(
            "if (%s) {\n%sreturn parent::newInstance(%s, %s, %s);\n}\n",
            '$params',
            $indent,
            '$name',
            '$params',
            '$isShared'
        );
        $switch .= sprintf(
            "switch (%s) {\n%s\n", '$name', implode("\n", $caseStatements)
        );
        $switch .= sprintf(
            "%sdefault:\n%sreturn parent::newInstance(%s, %s, %s);\n",
            $indent,
            str_repeat($indent, 2),
            '$name',
            '$params',
            '$isShared'
        );
        $switch .= "}\n\n";

        // Build newInstance() method
        $nameParam   = new ParameterGenerator();
        $nameParam->setName('name');

        $paramsParam = new ParameterGenerator();
        $paramsParam
            ->setName('params')
            ->setType('array')
            ->setDefaultValue(array());

        $isSharedParam = new ParameterGenerator();
        $isSharedParam
            ->setName('isShared')
            ->setDefaultValue(true);

        $get = new MethodGenerator();
        $get->setName('newInstance');
        $get->setParameters(array(
            $nameParam,
            $paramsParam,
            $isSharedParam,
        ));
        $get->setBody($switch);

        // Create class code generation object
        $container = $this->getClassGenerator();
        $container
            ->setName($this->containerClass)
            ->setExtendedClass('Di')
            ->addMethods(array($get))
            ->addMEthods($getters);

        // Create PHP file code generation object
        $classFile = $this->getFileGenerator();

        $classFile->setClass($container);
        $classFile->setUse('Zend\Di\Di');

        if (null !== $this->namespace) {
            $classFile->setNamespace($this->namespace);
        }

        return $classFile;
    }
515116
protected function buildCheckboxRadioGroup()
    {
        $optHtml = '';
        $props = &$this->props;
        $optTemplate = '<div {{attribsPair}}>'
            .'<label {{attribsLabel}}>'
                .'{{input}}'
                .'{{label}}'
            .'</label>'
            .'</div>'."\n";
        $values = $props['attribs']['type'] == 'radio'
            ? (array) $props['attribs']['value']
            : $props['values'];
        $isMultiple = \count($props['options']) > 1;
        foreach ($props['options'] as $i => $optProps) {
            // unset($optProps['attribs']['tagname']);
            $optProps = $this->mergeProps(array(
                array(
                    'attribs' => $props['attribs'], // name, type, & other "global" attributes
                ),
                array(
                    'attribs' => array(
                        'checked' => \in_array($optProps['attribs']['value'], $values),
                    ),
                    'attribsLabel' => array(),
                    'attribsPair' => array( 'class' => $props['attribs']['type'] ),
                ),
                $optProps,
                array(
                    'attribs' => array(
                        'id' => $props['attribs']['id']
                            ? $props['attribs']['id'].($isMultiple ? '_'.($i+1) : '')
                            : null,
                    ),
                ),
            ));
            if (!empty($optProps['attribs']['disabled'])) {
                $this->classAdd($optProps['attribsPair'], 'disabled');
            }
            $attribStrings = $this->buildAttribStrings($optProps);
            $optProps['input'] = '<input '.$attribStrings['attribs'].' />';
            $props['options'][$i] = $optProps;
            $optProps = \array_merge($optProps, $attribStrings);
            $optProps['label'] = \htmlspecialchars($optProps['label']);
            $optHtml .= Str::quickTemp($optTemplate, $optProps);
        }
        return $optHtml;
    }
1293860
function(opacity) {
        return function(g, i) {
          gEnter.selectAll(".chord")
              .filter(function(d) {
                return d.source.index != i && d.target.index != i;
              })
            .transition()
              .style("opacity", opacity);
          var groups = [];
          gEnter.selectAll(".chord")
              .filter(function(d) {
                if (d.source.index == i) {
                  groups.push(d.target.index);
                }
                if (d.target.index == i) {
                  groups.push(d.source.index);
                }
              });
          groups.push(i);
          var length = groups.length;
          gEnter.selectAll('.group')
              .filter(function(d) {
                for (var i = 0; i < length; i++) {
                  if(groups[i] == d.index) return false;
                }
                return true;
              })
              .transition()
                .style("opacity", opacity);
        };
      }
829392
function compile_fancy(block, scope) {
    var fns= block.toString().replace(css_matcher, function(src, tag_name, classes, hash, empty){
      var result= src.replace(classes, ''), tag_start,
          class_names= (classes || "").split(' ').join('').split('.').splice(1).join(' ');
      if(!tagset[tag_name]) {
        result= src;
      } else if(class_names !== "") {
        tag_start= tag_name +'({"class":"'+ class_names +'"';
        if(hash) {
          result= tag_start +', '+ result.substring((result.indexOf('{') + 1));
        } else if(empty) {
          result= tag_start +'})';
        } else {
          result= tag_start +'},'+ result.substring((result.indexOf('(') + 1));
        }
      } 
      return result;
    });
    return compile_scope(fns, scope);
  }
914518
def accordions(self, form):
        
        fixed = []
        accordions = OrderedDict()

        for child in form.children:
            section = getattr(child.schema, 'section', '')
            if not section:
                fixed.append(child)
            else:
                if section not in accordions.keys():
                    accordions[section] = {
                        'tag_id': random_tag_id(),
                        'children': [],
                        'name': section,
                        "error": False,
                    }
                if child.error:
                    accordions[section]['error'] = True
                accordions[section]['children'].append(child)

        grids = getattr(self, "grids", {})
        named_grids = getattr(self, 'named_grids', {})

        if grids != {}:
            method = self._childgroup
        elif named_grids != {}:
            method = self._childgroup_by_name
            grids = named_grids
        else:
            warnings.warn(u"Missing both grids and named_grids argument")

        for accordion in accordions.values():
            name = accordion['name']
            grid = grids.get(name)
            if grid is not None:
                children = accordion.pop('children')
                accordion['rows'] = method(children, grid)

        return fixed, accordions
1107265
function Group(options) {

	this.__proto__ = new Control();

	this.init = function(options) {
		this.type = options.type = 'Group';
		this.parent = options.parent;

		this.childopts = {};
		for (var o in options) {
			if ((o != 'childopts') && (o != 'type')) this.childopts[o] = options[o];
		}
		if (options.childopts) {
			for (var o in options.childopts) this.childopts[o] = options.childopts[o];
		}
		if (this.childopts.type == 'Group') this.childopts.type = 'Button';

		this.defaults = {
			x:48, y:48,
			w: this.childopts.w || 120,
			h: this.childopts.h || 48,

			value: 0,
			text: '',
			script: undefined,
			onload: undefined,
			fill: this.parent.fill,
			stroke: this.parent.stroke,
			'stroke-width': this.parent.control_stroke,
			fontsize: this.parent.fontsize,
			repeat: 0,
			running: 0,
			corner: this.parent.button_corner,
			subtype: undefined,
			group: undefined,
			row: undefined,
			col: undefined,
			autorun: undefined,
			highlighttrue: undefined,
			source: undefined,
			refresh: 0,

			noreadout: undefined,
			radio: undefined,
			//r: options.r || this.w/2,
			reversebits: undefined,
			numx: 1,
			numy: 3
		};
		this.fill_highlight = this.parent.lighter(this.stroke);
		this.setoptions(options);

		if (options.gutterx !== undefined) this.gutterx = options.gutterx;
		else if (options.gutter !== undefined) this.gutterx = options.gutter;
		else this.gutterx = 20;
		if (options.guttery !== undefined) this.guttery = options.guttery;
		else if (options.gutter !== undefined) this.guttery = options.gutter;
		else this.guttery = 20;

		this.nextstroke = 0;
		this.strokes = this.childopts.stroke || this.stroke;
		if (!(this.strokes instanceof Array)) this.strokes = [this.strokes];

		this.nextfill = 0;
		this.fills = this.childopts.fill || this.fill;
		if (!(this.fills instanceof Array)) this.fills = [this.fills];

		this.nexttext = 0;
		this.texts = this.childopts.text || this.text;
		if (!(this.texts instanceof Array)) this.texts = [this.texts];

		this.nextscript = 0;
		this.scripts = this.childopts.script || this.script;
		if (!(this.scripts instanceof Array)) this.scripts = [this.scripts];

		this.nextsource = 0;
		this.sources = this.childopts.source || this.source;
		if (!(this.sources instanceof Array)) this.sources = [this.sources];

		this.render();
		return this;
	};

	this.layout = function() {
		this.outerh = this.numy * (this.h + this.guttery) + this.guttery;
		if (this.childopts.type == 'Slider') {
			this.outerh += 3 * this.fontsize;
		}
	};

	this.render = function() {
		this.layout();

console.log('New group:', this);

		// bug: we don't have accurate this.w and this.h for path buttons here
		this.elt = this.parent.paper.rect(
			this.x - this.gutterx,
			this.y - this.guttery,
			this.numx * (this.w + this.gutterx) + this.gutterx,
			this.outerh, this.corner)
				.attr({fill:this.fill, stroke:this.stroke, 'stroke-width': this['stroke-width']});

		this.elts.push(this.elt);
		this.sethandlers();

		var x;
		var y = this.y;
		for (var row = 0; row < this.numy; row++) {
			x = this.x;
			for (var col=0; col< this.numx; col++) {
				var opts = {};
				for (var o in this.childopts) opts[o] = this.childopts[o];
				opts.id = this.itemid(row, col);
				opts.group = this.id;
				opts.x = x;
				opts.y = y;
				opts.row = row;
				opts.col = col;

				opts.stroke = this.strokes[this.nextstroke];
				if (++this.nextstroke >= this.strokes.length) this.nextstroke = 0;

				opts.fill = this.fills[this.nextfill];
				if (++this.nextfill >= this.fills.length) this.nextfill = 0;

				opts.text = this.texts[this.nexttext];
				if (++this.nexttext >= this.texts.length) this.nexttext = 0;

				opts.script = this.scripts[this.nextscript];
				if (++this.nextscript >= this.scripts.length) this.nextscript = 0;

				opts.source = this.sources[this.nextsource];
				if (++this.nextsource >= this.sources.length) this.nextsource = 0;

	console.log('Group add:', opts.type, opts);
				if (opts.type) this.parent.add([opts]);
				else this.parent.addButton(opts);
				x += (this.w + this.gutterx);
			}
			y += (this.h + this.guttery);
		}
	};

	this.itemid = function(row, col) {
		return  '' + this.id + '-' + row + '-' + col;
	};

	this.each = function(callback) {
		for (var row = 0; row < this.numy; row++) {
			for (var col = 0; col < this.numx; col++) {
				callback(this.parent.controls[this.itemid(row, col)]);
			}
		}
	};

	this.remove = function() {
		this.each(function(control) { control.parent.deletecontrol(control.id); });
		this.__proto__.remove.call(this);
	};

	this.attr = function(attrs) {
		this.each(function(control) { control.attr(attrs); });
		this.__proto__.attr.call(this);
	};

	// when a button in our group moves, it calls here to notify
	this.dragNotify = function(moved) {
		// calculate x,y of group from row, col of button[id]
		var newx = moved.x - moved.col * (this.w + this.gutterx);
		var newy = moved.y - moved.row * (this.h + this.guttery);
		console.log('dragNotify', moved, this.x, this.y, newx, newy);
		this.move(newx, newy);
	};

	this.move = function(newx, newy) {
		this.options.x = this.x = newx;
		this.options.y = this.y = newy;
		this.elt.attr({x:this.x - this.gutterx, y:this.y - this.guttery, width:this.w, height:this.h});

		var x;
		var y = this.y;
		for (var row = 0; row < this.numy; row++) {
			x = this.x;
			for (var col=0; col< this.numx; col++) {
				var control = this.parent.controls[this.itemid(row, col)];
				control.move(x, y);
				control.toFront();
				x += (this.w + this.gutterx);
			}
			y += (this.h + this.guttery);
		}
	};

	this.setValue = function(value) {
		console.log('Group setValue:', value);
		var bit = 0;
		this.value = value;
		if (typeof value == 'string') {
			for (var row = 0; row < this.numy; row++) {
				for (var col = 0; col < this.numx; col++) {
					var control = this.parent.controls[this.itemid(row, col)];
					if (this.value == control.text) control.highlight();
					else control.dehighlight();
				}
			}
		}
		else if (typeof value == 'number') {
			if (this.reversebits) {
				//console.log('reversing bits');
				for (var row = this.numy-1; row >= 0; row--) {
					for (var col = this.numx-1; col >= 0; col--) {
						var control = this.parent.controls[this.itemid(row, col)];
						var bitvalue = ((value & (1<<bit++)) !== 0) ? 1 : 0;
						if (bitvalue) control.highlight();
						else control.dehighlight();
					}
				}
			}
			else {
				for (var row = 0; row < this.numy; row++) {
					for (var col = 0; col < this.numx; col++) {
						var control = this.parent.controls[this.itemid(row, col)];
						var bitvalue = ((value & (1<<bit++)) !== 0) ? 1 : 0;
						if (bitvalue) control.highlight();
						else control.dehighlight();
					}
				}
			}
		}
		var update = {id: this.id, value: this.value};
		this.fire('update', update);
	};

	return this.init(options || {});
}
349956
function compileTemplate () {
    var template = $attrs.$mdTabsTemplate,
        element  = angular.element($element[0].querySelector('md-tab-data'));

    element.html(template);
    $compile(element.contents())(ctrl.parent);
    delete $attrs.$mdTabsTemplate;
  }
794532
public function compile() {
		foreach ($this->_params as $key => $value) {
			if (!strpos($key, ':')) {
				continue;
			}
			unset($this->_params[$key]);
			$this->_meta[$key] = $value;
		}

		$this->_match = $this->_params;

		if ($this->_template === '/' || $this->_template === '') {
			$this->_pattern = '@^/*$@';
			return;
		}
		$this->_pattern = "@^{$this->_template}\$@";
		$match = '@([/.])?\{:([^:}]+):?((?:[^{]+?(?:\{[0-9,]+\})?)*?)\}@S';

		if ($this->_config['unicode']) {
			$this->_pattern .= 'u';
		}
		preg_match_all($match, $this->_pattern, $m);

		if (!$tokens = $m[0]) {
			return;
		}
		$slashes = $m[1];
		$params = $m[2];
		$regexs = $m[3];
		unset($m);
		$this->_keys = [];

		foreach ($params as $i => $param) {
			$this->_keys[$param] = $param;
			$this->_pattern = $this->_regex($regexs[$i], $param, $tokens[$i], $slashes[$i]);
		}
		$this->_defaults += array_intersect_key($this->_params, $this->_keys);
		$this->_match = array_diff_key($this->_params, $this->_defaults);
	}
420641
function compileElement(options) {

          var compiled = !options.skipCompile ? $mdCompiler.compile(options) : null;

          return compiled || $q(function (resolve) {
              resolve({
                locals: {},
                link: function () {
                  return options.element;
                }
              });
            });
        }
1245581
public function compile()
	{
		if ($this->multiSelect)
		{
			if (is_array($arrData = \StringUtil::deserialize($this->data->multiSelectField)))
			{
				foreach ($arrData as &$data)
				{
					$data = substr($data,1); // Remove the alphabetic character
				}
				
				$this->writeToTemplate($arrData);
			}
		}
		else
		{
			$this->writeToTemplate(substr($this->data->singleSelectField,1)); // Remove the alphabetic character
		}
	}
725174
function expandableClickHandler() {
  this.transition.toggleExpandable();
  this.toggleTargetState( this.ui.target );

  if ( this.isAccordionGroup ) {
    if ( this.activeAccordion ) {
      this.activeAccordion = false;
    } else {
      Events.trigger( 'accordionActivated', { target: this } );
      this.activeAccordion = true;
    }
  }
}
741686
protected function compile()
	{
		$buttons = new Helper\Buttons();
		$buttons->loadFromFieldset($this->buttons);
		$buttons->buttonStyle = $this->buttonStyle;

		$this->Template->buttons = $buttons;
	}
330485
function compileJs(srcDir, srcFilename, destDir, options) {
  options = options || {};

  if (options.minify) {
    const startTime = Date.now();
    return closureCompile(
        srcDir + srcFilename + '.js', destDir, options.minifiedName, options)
        .then(function() {
          fs.writeFileSync(destDir + '/version.txt', internalRuntimeVersion);
          if (options.latestName) {
            fs.copySync(
                destDir + '/' + options.minifiedName,
                destDir + '/' + options.latestName);
          }
        })
        .then(() => {
          endBuildStep('Minified', srcFilename + '.js', startTime);
        });
  }

  var bundler = browserify(srcDir + srcFilename + '-babel.js', {debug: true})
      .transform(babel, {loose: 'all'});
  if (options.watch) {
    bundler = watchify(bundler);
  }

  var wrapper = options.wrapper || '<%= contents %>';

  var lazybuild = lazypipe()
      .pipe(source, srcFilename + '-babel.js')
      .pipe(buffer)
      .pipe($$.replace, /\$internalRuntimeVersion\$/g, internalRuntimeVersion)
      .pipe($$.wrap, wrapper)
      .pipe($$.sourcemaps.init.bind($$.sourcemaps), {loadMaps: true});

  var lazywrite = lazypipe()
      .pipe($$.sourcemaps.write.bind($$.sourcemaps), './')
      .pipe(gulp.dest.bind(gulp), destDir);

  var destFilename = options.toName || srcFilename + '.js';
  function rebundle() {
    const startTime = Date.now();
    return toPromise(bundler.bundle()
      .on('error', function(err) {
        if (err instanceof SyntaxError) {
          console.error($$.util.colors.red('Syntax error:', err.message));
        } else {
          console.error($$.util.colors.red(err.message));
        }
      })
      .pipe(lazybuild())
      .pipe($$.rename(destFilename))
      .pipe(lazywrite())
      .on('end', function() {
      })).then(() => {
        endBuildStep('Compiled', srcFilename, startTime);
      });
  }

  if (options.watch) {
    bundler.on('update', function() {
      rebundle();
      // Touch file in unit test set. This triggers rebundling of tests because
      // karma only considers changes to tests files themselves re-bundle
      // worthy.
      touch('test/_init_tests.js');
    });
  }

  if (options.watch === false) {
    // Due to the two step build process, compileJs() is called twice, once with
    // options.watch set to true and, once with it set to false. However, we do
    // not need to call rebundle() twice. This avoids the duplicate compile seen
    // when you run `gulp watch` and touch a file.
    return Promise.resolve();
  } else {
    // This is the default options.watch === true case, and also covers the
    // `gulp build` / `gulp dist` cases where options.watch is undefined.
    return rebundle();
  }
}
1201847
function compileCoffeeTemplate(moduleName, content, quoteChar, indentString, htmlmin) {
        var contentModified = getContent(content, quoteChar, indentString, htmlmin);
        var doubleIndent = indentString + indentString;

        var module = 'angular.module(' + quoteChar + moduleName +
            quoteChar + ', []).run([' + quoteChar + '$templateCache' + quoteChar + ', ($templateCache) ->\n' +
            indentString + '$templateCache.put(' + quoteChar + moduleName + quoteChar + ',\n' + doubleIndent + quoteChar + contentModified +
            quoteChar + ')\n])\n';

        return module;
    }
1318922
function compile() {
		$code = $this->match_code($this->value) ;

		$id = $this->varid() ;

		if ( $this->optional ) {
			$code = PHPBuilder::build()
				->l(
				$this->save($id),
				$code->replace( array( 'FAIL' => $this->restore($id,true) ))
				);
		}

		if ( $this->zero_or_more ) {
			$code = PHPBuilder::build()
				->b( 'while (true)',
					$this->save($id),
					$code->replace( array(
						'MATCH' => NULL,
						'FAIL' =>
							$this->restore($id,true)
							->l( 'break;' )
					))
				)
				->l(
				'MATCH'
				);
		}

		if ( $this->one_or_more ) {
			$code = PHPBuilder::build()
				->l(
				'$count = 0;'
				)
				->b( 'while (true)',
					$this->save($id),
					$code->replace( array(
						'MATCH' => NULL,
						'FAIL' =>
							$this->restore($id,true)
							->l( 'break;' )
					)),
					'$count += 1;'
				)
				->b( 'if ($count > 0)', 'MATCH' )
				->b( 'else',            'FAIL' );
		}

		if ( $this->positive_lookahead ) {
			$code = PHPBuilder::build()
				->l(
				$this->save($id),
				$code->replace( array(
					'MATCH' =>
						$this->restore($id)
						->l( 'MATCH' ),
					'FAIL' =>
						$this->restore($id)
						->l( 'FAIL' )
				)));
		}

		if ( $this->negative_lookahead ) {
			$code = PHPBuilder::build()
				->l(
				$this->save($id),
				$code->replace( array(
					'MATCH' =>
						$this->restore($id)
						->l( 'FAIL' ),
					'FAIL' =>
						$this->restore($id)
						->l( 'MATCH' )
				)));
		}

		if ( $this->tag && !($this instanceof TokenRecurse ) ) {
			$code = PHPBuilder::build()
				->l(
				'$stack[] = $result; $result = $this->construct( $matchrule, "'.$this->tag.'" ); ',
				$code->replace(array(
					'MATCH' => PHPBuilder::build()
						->l(
						'$subres = $result; $result = array_pop($stack);',
						'$this->store( $result, $subres, \''.$this->tag.'\' );',
						'MATCH'
						),
					'FAIL' => PHPBuilder::build()
						->l(
						'$result = array_pop($stack);',
						'FAIL'
						)
				)));
		}

		return $code ;
	}
664797
protected function compile()
    {
        $config  = StringUtil::deserialize($this->bs_navbarModules, true);
        $modules = [];
        $models  = $this->prefetchModules($config);

        foreach ($config as $module) {
            $id = $module['module'];

            if ($id != '' && !$module['inactive'] && array_key_exists($id, $models)) {
                $modules[] = $this->generateModule($module, $models[$id]);
            }
        }

        $cssID = $this->cssID;

        if ($this->cssID[1] == '') {
            $cssID[1] = 'navbar-light bg-light';
        }

        if ($this->bs_isResponsive && $this->bs_toggleableSize) {
            $cssID[1] = trim($cssID[1] . ' navbar-expand-' . $this->bs_toggleableSize);
        }

        $this->cssID             = $cssID;
        $this->Template->modules = $modules;
    }