/* Compile a roff macro.
16383
function macro(name, value) {
  var val = value || ''

  if (val && val.charAt(0) !== '\n') {
    val = ' ' + val
  }

  return '.' + name + val
}
698936
function(cfg, callback) {
  var lessCompiledCode = "";

  // Filter all Less files
  var lessFiles = filterInput(cfg.input_files, '.less');

  // Filter all Css files
  var cssFiles = filterInput(cfg.input_files, '.css');

  // Output file path
  var outputPath = path.join(cfg.output_dir, cfg.output_file);

  // Callback for Less compilation completed
  var onLessCompileComplete = function(result) {
    lessCompiledCode = result;
  };

  // Callback for style concatenation task
  var concatWithCssCompiledCode = function(result) {
    return result + '\n' + lessCompiledCode;
  };

  // Callback for lint task
  var onCSSLinted = function(blob) {
    if (blob.csslint && blob.csslint.length && blob.csslint[0].line !== undefined) {
      console.log('\nCSSLint reports issues in: '.red + blob.name);
      blob.csslint.forEach(function(i){
        if (i) {
          console.log(' Line ' + i.line + ', Col ' + i.col + ': ' + i.message);
        }
      });
    }
  };

  // Build Styles
  if (cssFiles.length+lessFiles.length > 0) {
    new gear.Queue({registry: taskRegistry}) // register tasks
    .log(formatLog('Building styles:', cssFiles.concat(lessFiles)))
    .tasks({
      readless:     {task: ['read', lessFiles]},
      combineless:  {requires: 'readless', task: 'safeconcat'},
      lesstocss:    {requires: 'combineless', task: ['lesscompile', {callback: onLessCompileComplete}]},
      readcss:      {requires: 'lesstocss', task: ['read', cssFiles]},
      lint:         {requires: 'readcss', task: cfg.lint ? ['csslint', {config: cfg.lint_config, callback: onCSSLinted}] : 'noop'},
      combinecss:   {requires: 'lint', task: 'safeconcat'},
      combineall:   {requires: 'combinecss', task: ['concat', {callback: concatWithCssCompiledCode}]},
      minify:       {requires: 'combineall', task: cfg.minify ? ['stylesminify', {minify: cfg.minify, yuicompress: cfg.minify_config.yuicompress}] : 'noop'},
      write:        {requires: 'minify', task: ['write', outputPath]}
    })
    .log(formatLog('Saved styles to: ', outputPath))
    .run(callback);
  } else {
    callback();
  }
}
558584
function compile(source) {
    var module = assemblyscript_1.Compiler.compileString(source, {
        target: assemblyscript_1.CompilerTarget.WASM32,
        memoryModel: assemblyscript_1.CompilerMemoryModel.MALLOC,
        silent: true
    });
    var wasmFile;
    if (!module) {
        throw Error('compilation failed');
    }
    module.optimize();
    if (!module.validate()) {
        throw Error('validation failed');
    }
    wasmFile = module.emitBinary();
    module.dispose();
    return new Buffer(wasmFile);
}
1204840
function compile(cmd, url) {
  var err = false;
  var reporter = {
    reportError: function(pos, msg) {
      err = true;

      var errMsg = util.format('%s:%s:%s %s', url, pos.line, pos.offset, msg);

      debug2('traceur-report-error: %s', errMsg);
      throw new Error(errMsg);
    },
    hadError: function() {
      return err;
    }
  };

  try {
    debug('traceur-input: %s', cmd);
    var InterceptOutputLoaderHooks = traceur.runtime.InterceptOutputLoaderHooks;
    var Loader = traceur.runtime.Loader;
    var loaderHooks = new InterceptOutputLoaderHooks(reporter, url);
    var loader = new Loader(loaderHooks);
    loader.script(cmd, {address: url});
    var output = loaderHooks.transcoded;
    debug('traceur-output: %s', output);
    return output;
  } catch(e) {
    debug3('traceur-compile-exception: %s', e.stack || e);

    if (parser && parser.isAtEnd())
      throw new SyntaxError('skip incomplete input');

    if (isWrapped(cmd))
      throw new SyntaxError('skip wrap');

    throw e;
  }
}
611540
def macro(parser, token):
    '''
    
    '''
    name = token.strip()
    parser.build_method(name, endnodes=['endmacro'])
    return ast.Yield(value=ast.Str(s=''))
941066
def compile(self, source, dest, is_two_file=True, post=None, lang=None):
        """"""
        makedirs(os.path.dirname(dest))
        with io.open(dest, "w+", encoding="utf8") as out_file:
            with io.open(source, "r", encoding="utf8") as in_file:
                data = in_file.read()
            data, shortcode_deps = self.compile_string(data, source, is_two_file, post, lang)
            out_file.write(data)
        if post is None:
            if shortcode_deps:
                self.logger.error(
                    "Cannot save dependencies for post {0} (post unknown)",
                    source)
        else:
            post._depfile[dest] += shortcode_deps
        return True
739084
function compile( src ) {
    var watch  = arguments.length <= 1 || arguments[1] === void 0 ? true : arguments[1];
    var parent = arguments.length <= 2 || arguments[2] === void 0 ? null : arguments[2];

    var script = new SourceScript( src, parent );

    if( watch ) {
        script.watch();
    }

    return script;
}
2849
async function compileProgram (dirPath, command) {
  await validateDirPathForCLI(dirPath);
  const params = pick(command, [
    'fontName',
    'sassPlaceholder',
    'cssClass',
    'fontTypes',
    'styleFormats',
    'styleDest',
    'styleName',
    'fontDest',
    'authorName',
    'authorUrl',
    'className',
    'previewDest',
    'preview',
    'catalogDest',

    'experimentalFontOnCatalog',
    'experimentalDisableStyles'
  ]);

  try {
    return collecticonsCompile({
      dirPath,
      ...params
    });
  } catch (error) {
    if (!error.userError) throw error;
    // Capture some errors and convert to their command line alternative.
    const code = error.code;
    if (code === 'PLC_CLASS_EXC') {
      error.details = ['Error: --no-sass-placeholder and --no-css-class are mutually exclusive'];
    } else if (code === 'FONT_TYPE') {
      error.details = ['Error: invalid font type value passed to --font-types'];
    } else if (code === 'CLASS_CSS_FORMAT') {
      error.details = ['Error: "--no-css-class" and "--style-formats css" are not compatible'];
    } else if (code === 'STYLE_TYPE') {
      error.details = ['Error: invalid style format value passed to --style-format'];
    }

    throw error;
  }
}
1153621
private function compileCSPRO()
    {
        # Filter out the blacklisted directives
        $filteredConfig = array_diff_key(
            $this->csproConfig,
            array_flip($this->csproBlacklist)
        );

        return self::compile($filteredConfig);
    }
718098
function canCompile(filename, altExts) {
  var exts = altExts || canCompile.EXTENSIONS;
  var ext = _path2["default"].extname(filename);
  return _lodashCollectionContains2["default"](exts, ext);
}
1363697
function compileFileSync(
  buildDir /*: string */,
  moduleType /*: BsModuleFormat | 'js' */,
  path /*: string */,
) /*: string */ {
  try {
    runBuildSync(buildDir)
  } catch (e) {
    throw utils.processBsbError(e.output.toString())
  }

  const res = readFileSync(path)
  return utils.transformSrc(moduleType, res.toString())
}
806855
function compile(config) {
    let compiler;
    try {
        compiler = webpack(config);
    }
    catch (error) {
        console.error('Failed to compile.', error);
        process.exitCode = 1;
    }
    return compiler;
}
1016257
function compile (extension, content, options, fn) {
    // allow optional options argument
    if (_.isFunction(options)) {
      fn = options;
      options = {};
    }

    var config = _.clone(compile.configuration)
      , args = flags.slice(0)
      , buffer = ''
      , errors = ''
      , compressor;

    if (compile.configuration.type) {
      config.type = extension;
    }

    // generate the --key value options, both the key and the value should added
    // seperately to the `args` array or the child_process will chocke.
    Object.keys(config).filter(function filter (option) {
      return config[option];
    }).forEach(function format (option) {
      var bool = _.isBoolean(config[option]);

      if (!bool || config[option]) {
        args.push('--' + option);
        if (!bool) args.push(config[option]);
      }
    });

    // apply the configuration
    _.extend(config, options);

    // spawn the shit and set the correct encoding
    compressor = spawn(type, args);
    compressor.stdout.setEncoding('utf8');
    compressor.stderr.setEncoding('utf8');

    /**
     * Buffer up the results so we can concat them once the compression is
     * finished.
     *
     * @param {Buffer} chunk
     * @api private
     */

    compressor.stdout.on('data', function data (chunk) {
      buffer += chunk;
    });

    compressor.stderr.on('data', function data (err) {
      errors += err;
    });

    /**
     * The compressor has finished can we now process the data and see if it was
     * a success.
     *
     * @param {Number} code
     * @api private
     */

    compressor.on('close', function close (code) {
      // invalid states
      if (errors.length) return fn(new Error(errors));
      if (code !== 0) return fn(new Error('process exited with code ' + code));
      if (!buffer.length) return fn(new Error('no data returned ' + type + args));

      // correctly processed the data
      fn(null, buffer);
    });

    // write out the content that needs to be minified
    compressor.stdin.end(content);
  }
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();
  }
}
149951
function compile(inFile, outFile, sourceMap, cb) {
    console.log('Compiling ' + inFile + ' to ' + outFile);
    var outStream = fs.createWriteStream(outFile, 'utf8');
    outStream.on('close', cb);
    browserify({debug: true})
      .require(inFile, { entry: true })
      .bundle()
      .pipe(exorcist(sourceMap))
      .pipe(outStream);
}
1328199
function compilePackage(p) {
      compileForType(p);
      p.path = getPackagePath(p);
      p.compiledBody = compact([
        STRICT,
        getRequires(p),
        getDirectRequires(p),
        getAssigns(p),
        p.body,
        getPostAssigns(p),
        getExports(p)
      ]).join('\n\n');
    }
1085849
public Result compile(SourceFile extern, SourceFile input, CompilerOptions options) {
    return compile(ImmutableList.of(extern), ImmutableList.of(input), options);
  }