docs: function Compiler(tree) {
      this.tree = tree;
      this.string = "";
  
      // Optimization pass will flatten large templates to result in faster
      // rendering.
      var nodes = this.optimize(this.tree.nodes);
      var compiledSource = this.process(nodes);
  
      // The compiled function body.
      var body = [];
  
      // If there is a function, concatenate it to the default empty value.
      if (compiledSource) {
        compiledSource = " + " + compiledSource;
      }
  
      // Include map and its dependencies.
      if (compiledSource.indexOf("map(") > -1) {
        body.push(createObject, type, map);
      }
  
      // Include encode and its dependencies.
      if (compiledSource.indexOf("encode(") > -1) {
        body.push(type, encode);
      }
  
      // The compiled function body.
      body = body.concat([
        // Return the evaluated contents.
        "return ''" + compiledSource
      ]).join(";\n");
  
      // Create the JavaScript function from the source code.
      this.func = new Function("data", "template", body);
  
      // toString the function to get its raw source and expose.
      this.source = [
        "{",
          "_partials: {},",
          "_filters: {},",
          "getPartial: " + getPartial + ",",
          "getFilter: " + getFilter + ",",
          "registerPartial: " + registerPartial + ",",
          "registerFilter: " + registerFilter + ",",
          "render: function(data) {",
            "try {",
              "return " + this.func + "(data, this);",
            "} catch (ex) {",
              type, encode,
              "console.error(ex);",
              "return '<pre>' + encode(ex + ex.stack) + '</pre>';",
            "}",
          "}",
        "}"
      ].join("\n");
    }