Compiler --------
192721
function compile (tree) {
    if (typeof tree === "string") tree = parse(tree);

    // Every compiled function gets called with a reference to the runtime.
    return new Function(["args", "runt"], [
      'var ret = [];',
      compileArgumentList(tree),
      'return ret;'
    ].join('\n'));
  }
1347945
private void compileRoutes() {
        Iterator<RouteRegistration> iterator = routeRegistrations.iterator();

        while (iterator.hasNext()) {
            RouteRegistration routeRegistration = iterator.next();
            iterator.remove();

            //
            // Enforce mode requirements specified for Route
            //
            if (routeRegistration.getModes() != null) {
                // Enforce specified modes for the route
                if (!routeRegistration.getModes().contains(settings.getMode())) {
                    log.debug("Excluding {} '{}' because {} is not specified in mode set {}",
                            routeRegistration.getRequestMethod(), routeRegistration.getUriPattern(), settings.getMode(), routeRegistration.getModes());
                    continue;
                }
            }

            //
            // Enforce annotated requirements on Controllers
            //
            if (routeRegistration.getRouteHandler() instanceof ControllerHandler) {
                // Enforce RequireUtil rules for the controller
                ControllerHandler controllerHandler = (ControllerHandler) routeRegistration.getRouteHandler();
                if (!RequireUtil.allowMethod(settings, controllerHandler.getControllerMethod())) {
                    continue;
                }

                if (Strings.isNullOrEmpty(routeRegistration.getName())) {
                    routeRegistration.setName(Util.toString(controllerHandler.getControllerMethod()));
                }
            }
            //
            // Automatically name Route if name is not specified
            //
            else if (Strings.isNullOrEmpty(routeRegistration.getName())) {
                // try to name the route
                Class<? extends RouteHandler> routeHandlerClass = routeRegistration.getRouteHandler().getClass();
                if (routeHandlerClass.isSynthetic()) {
                    routeRegistration.setName("lambda handler");
                } else if (routeHandlerClass.isAnonymousClass()) {
                    routeRegistration.setName("anonymous handler");
                } else {
                    routeRegistration.setName(routeHandlerClass.getName());
                }
            }

            //
            // Wrap any Route designated to collect Metrics
            //
            RouteHandler routeHandler;
            if (routeRegistration.isMetered()) {
                log.debug("Wrapping {} '{}' handler with {}", routeRegistration.getRequestMethod(), routeRegistration.getUriPattern(),
                        MeteredRouteHandler.class.getSimpleName());
                routeHandler = new MeteredRouteHandler(routeRegistration.getMetricName(), routeRegistration.getRouteHandler(), metricRegistry);
            } else if (routeRegistration.isTimed()) {
                log.debug("Wrapping {} '{}' handler with {}", routeRegistration.getRequestMethod(), routeRegistration.getUriPattern(),
                        TimedRouteHandler.class.getSimpleName());
                routeHandler = new TimedRouteHandler(routeRegistration.getMetricName(), routeRegistration.getRouteHandler(), metricRegistry);
            } else if (routeRegistration.isCounted()) {
                log.debug("Wrapping {} '{}' handler with {}", routeRegistration.getRequestMethod(), routeRegistration.getUriPattern(),
                        CountedRouteHandler.class.getSimpleName());
                routeHandler = new CountedRouteHandler(routeRegistration.getMetricName(), false, routeRegistration.getRouteHandler(), metricRegistry);
            } else {
                routeHandler = routeRegistration.getRouteHandler();
            }

            Route route = new Route(routeRegistration.getRequestMethod(), routeRegistration.getUriPattern(), routeHandler);
            route.setName(routeRegistration.getName());
            if (routeRegistration.isRunAsFinally()) {
                route.runAsFinally();
            }

            router.addRoute(route);
        }
    }
146226
public function compileRenders()
    {
        preg_match_all('/@render\(\'([^\(\\\')]+)\'(.*)?\)/', $this->prepared, $matches);

        if(isset($matches[1][0]))
        {
            foreach($matches[1] as $key => $val)
            {
                if($matches[2][$key])
                {
                    $matches[2][$key] = trim($matches[2][$key], ' ,');

                    $this->prepared = trim(str_replace($matches[0][$key], "<?= \$env->render('{$matches[1][$key]}', array_merge(\$this->allData(), {$matches[2][$key]})); ?>", $this->prepared));
                }
                else
                {
                    $this->prepared = trim(str_replace($matches[0][$key], "<?= \$env->render('{$matches[1][$key]}', \$this->allData()); ?>", $this->prepared));
                }
            }
        }
    }
969887
function compile(name, edbml, options, macros, directives) {
	var result = compiler.compile(edbml, options, macros, directives);
	return assistant.declare(name, result);
}
1275183
function mixin(compiler) {
  compiler._comment = compiler.comment;
  compiler.map = new SourceMap();
  compiler.position = { line: 1, column: 1 };
  compiler.files = {};
  for (var k in exports) compiler[k] = exports[k];
}
567503
public function compile(Compiler $compiler): void
    {
        $runtimeErrorClass = RuntimeError::class;
        $suppressedExceptionClass = SuppressedException::class;

        $compiler
            ->write("try {\n")
            ->indent()
            ->write("ob_start();\n\n")
            ->subcompile($this->getNode('body'))
            ->raw("\n")
            ->write("echo ob_get_clean();\n")
            ->outdent()
            ->write("} catch ({$runtimeErrorClass} \$exception) {\n")
            ->indent()
            ->write("ob_end_clean();\n\n")
            ->write("if (\$exception->getPrevious() === null) {\n")
            ->indent()
            ->write("throw \$exception;\n")
            ->outdent()
            ->write("}\n\n")
            ->write("\$suppressedException = new {$suppressedExceptionClass}(\$exception->getPrevious());\n")
            ->outdent()
            ->write("}\n\n");
    }
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;
    }
586949
function compileParse(templateSource, block, data, callback) {
  if (!callback && typeof block === 'object' && typeof data === 'function') {
    callback = data;
    data = block;
    block = null;
  }
  if (!templateSource) {
    callback('');
    return;
  }

  compileRender(templateSource, data, block)
    .then(
      output => process.nextTick(callback, null, output),
      err => process.nextTick(callback, err),
    );
}
1322602
function FunctionCompiler() {
    var _this;

    _classCallCheck(this, FunctionCompiler);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(FunctionCompiler).call(this));
    /**
     * Compile sequence.
     * @type {Array<function>}
     */

    _this._sequence = [_this._uncomment, _this._validate, _this._extract, _this._direct, _this._compile, _this._definehead, _this._injecthead, _this._macromize];
    /**
     * Options from Grunt.
     * @type {Map}
     */

    _this._options = null;
    /**
     * Hm.
     */

    _this._macros = null;
    /**
     * Mapping script tag attributes.
     * This may be put to future use.
     * @type {Map<string,string>}
     */

    _this._directives = null;
    /**
     * Processing intstructions.
     * @type {Array<Instruction>}
     */

    _this._instructions = null;
    /**
     * Compiled arguments list.
     * @type {Array<string>}
     */

    _this._params = null;
    /**
     * Tracking imported functions.
     * @type {Map<string,string>}
     */

    _this._functions = {};
    /**
     * Did compilation fail just yet?
     * @type {boolean}
     */

    _this._failed = false;
    return _this;
  }
1120233
function preParse(src, output, syntax) {
	const {
		append,
		compilerControl,
		control
	} = output;

	let appendParts = [];
	function pushAppendParts() {
		if (appendParts.length > 0) {
			append(appendParts);
			appendParts = [];
		}
	}

	parse(src, {
		plain(html) {
			appendParts.push('\'' + jsStringEscape(html) + '\'');
		},
		compilerControl(js) {
			pushAppendParts();
			compilerControl(js);
		},
		writeEscaped(js) {
			appendParts.push('__e(' + js + ')');
		},
		writeUnescaped(js) {
			appendParts.push('(' + js + ')');
		},
		control(js) {
			pushAppendParts();
			control(js);
		}
	}, syntax);
	pushAppendParts();
}
227804
def compile_string(string, compiler_class=Compiler, **kwargs):
    
    compiler = compiler_class(**kwargs)
    return compiler.compile_string(string)
523932
function Compiler(moduleConfig, moduleCombineConfigs, moduleMapConfigs) {
    this._moduleConfig = moduleConfig;
    this._moduleCombineConfigs = moduleCombineConfigs || this._moduleConfig.combine || {};
    this._moduleMapConfigs = helper.createKVSortedIndex(moduleMapConfigs, 1);

    u.each(this._moduleMapConfigs, function (item) {
        item.v = helper.createKVSortedIndex(item.v);
    });

    this._idToFileMap = {};

    /**
     * 二维数组.
     * @type {Array.<Array.<string>>}
     */
    this._aliasModules = [];

    /**
     * key 是 module id
     * value 是 _aliasModules 的 index
     * @type {Object.<string, number>}
     */
    this._aliasModulesMap = {};

    /**
     * 缓存模块的定义信息.
     * @type {Object.<string, ModuleDefinition>}
     */
    this._moduleDefinitions = {};
}
1247146
def compile(self, source, options={}):
    
    options = dict(options)
    if "paths" in options:
      options["paths"] += self.paths
    else:
      options["paths"] = self.paths

    if "compress" not in options:
      options["compress"] = self.compress

    return self.context.call("compiler", source, options, self.plugins, self.imports)
148694
function compile(
  source,
  filename = '',
  includeModule = false,
  debugMode = false,
) {
  let res
  let resName
  let errors

  try {
    const [moduleName, bsCode, diagnosticErrors] = Retyped.compile(filename, source, debugMode)
    const fmtCode = format(bsCode)
    res = fmtCode
    resName = moduleName
    errors = diagnosticErrors
  } catch (e) {
    console.error(e)
    throw new Error(`${e[0][0]}`)
  }

  if (res.includes('SYNTAX ERROR>')) {
    throw new Error(res)
  }

  if (!includeModule) {
    return res
  } else {
    return {
      moduleName: resName,
      bsCode: res,
      diagnosticErrors: errors
    }
  }
}
343837
function compile(template) {
        Mustache.parse(template);
        return function (view, partials) {
          return Mustache.render(template, view, partials);
        };
      }
517379
private void compile2() {
        try {
            switch (compilePolicy) {
            case ATTR_ONLY:
                attribute(todo);
                break;

            case CHECK_ONLY:
                flow(attribute(todo));
                break;

            case SIMPLE:
                generate(desugar(flow(attribute(todo))));
                break;

            case BY_FILE: {
                    Queue<Queue<Env<AttrContext>>> q = todo.groupByFile();
                    while (!q.isEmpty() && !shouldStop(CompileState.ATTR)) {
                        generate(desugar(flow(attribute(q.remove()))));
                    }
                }
                break;

            case BY_TODO:
                while (!todo.isEmpty())
                    generate(desugar(flow(attribute(todo.remove()))));
                break;

            default:
                Assert.error("unknown compile policy");
            }
        } catch (Abort ex) {
            if (devVerbose)
                ex.printStackTrace(System.err);
        }

        if (verbose) {
            elapsed_msec = elapsed(start_msec);
            log.printVerbose("total", Long.toString(elapsed_msec));
        }

        reportDeferredDiagnostics();

        if (!log.hasDiagnosticListener()) {
            printCount("error", errorCount());
            printCount("warn", warningCount());
        }
    }
705693
function append(compiler, value, node) {
  if (typeof compiler.append !== 'function') {
    return compiler.emit(value, node);
  }
  return compiler.append(value, node);
}