code: function astFromSource(options, source, extension, cb) {
    if (typeof cb === 'undefined') {
      cb = extension;
      extension = null;
    }
    pegParser(options, extension, function (err, parser, key) {
      if (err) {
        return cb(err);
      }
      var ast;
      try {
        ast = parser.parse(source);
        addLineNumbers(ast, source);
        if (ast.type === 'program') {
          ast.type = 'script';
        } else if (ast.type === 'markdown') {
          ast.content = source;
        }
        ast.grammarFile = key;
        // adding in comment nodes, in case they get added to the grammar later
        walk(ast, function (node) {
          if (!node.comments && node.type !== 'undefined') {
            node.comments = [];
          }
        });
        //console.log(JSON.stringify(ast, null, 2));
      } catch (e) {
        return cb(e);
      }
      return cb(null, ast);
    });
  }
docs: /*
  Convert source code to an AST.
  @param {Object} options Doctor options.
  @param {String} source Source code.
  @param {String} extension File extension for source file.
  @param {function} cb Function to call with AST.