code: function compile(code, filename, options) {
    options = defaults(options || {}, {
      embedSourceMaps: true,
      bareModule: false,
      color: false
    });
    if (arguments.length !== compile.length) {
      throw new Error("incorrect argument count to compile");
    }
    var result = parse(ensureNewline(code));
    if (!result.status) {
      var expectations = uniq(result.expected);
      var data = "expected one of " + expectations.join(", ");
      var index = Math.min(result.index, code.length - 1);
      var oopsyInput = {index: index, data: data};
      var oopsies =
        OopsyData.fromIndices(code, [oopsyInput], {color: options.color});
      return {
        parsed: false,
        result: {
          expectations: expectations,
          oopsy: oopsies[0]
        }
      };
    }
    var squiggleAst = result.value;
    squiggleAst.bareModule = options.bareModule;
    var warnings = lint(squiggleAst);
    var contextualWarnings =
      OopsyData.fromLocations(code, warnings, {color: options.color});
    var esAst = transformAst(squiggleAst);
    var mangledAst = SHOULD_MANGLE ?
      esmangle.optimize(esAst) :
      esAst;
    var optimizedAst = SHOULD_OPTIMIZE ?
      optimize(mangledAst) :
      mangledAst;
    var stuff = generateCodeAndSourceMap(
      optimizedAst, filename, code);
    var js = ensureNewline(stuff.code);
    var sourceMap = stuff.map.toString();
    if (options.embedSourceMaps) {
      js = addSourceMapUrl(js, sourceMap);
    }
    return {
      parsed: true,
      warnings: contextualWarnings,
      sourceMap: sourceMap,
      code: js
    };
  }
docs: TODO: Make it possible to compile REPL code as well.