docs: function(code, ctx){
      // Wrap code blocks with {}.
      // we only wrap unbuffered code blocks ATM
      // since they are usually flow control
      // Buffer code
      //
      var ast = [];
      if (code.buffer) {
        var val = code.val.trim();
        var tpl = tpl_interp;
        var tplv = {
          VALUE: code.astVal || this.parseExpr(code.val)
        }
        if (code.mustEscape !== false) {
          tpl = tpl_interp_escape;
          tplv.ESCAPE = this.runtime('escape', true);
        }
        push.apply(ast, this.bufferAST(tpl(tplv).expression));
      } else {
  
        var val = code.val.trim();
        this.codeBuffer += "\n" + val;
  
        if (code.block) {
          this.codeIndex++;
          var marker = "PUGMARKER"+this.codeIndex;
          this.codeBuffer += "\n{" + marker + "}\n";
          // snaphsot current unbuffered code level
          // this is necessary to accept embedded code blocks
          // - if (true) {
          //   - var a = 1;
          // - }
          // but breaks the "should be reasonably fast" compile test
          // note: we should add a test for this in pug
          var savedCodeBuffer = this.codeBuffer;
          var savedCodeMarker = this.codeMarker;
          var savedCodeIndex = this.codeIndex;
  
          this.codeBuffer = '_=function*(){';
          this.codeMarker = {};
          this.codeIndex = -1;
  
          var body = this.visit(code.block, code);
  
          this.codeBuffer = savedCodeBuffer;
          this.codeMarker = savedCodeMarker;
          this.codeIndex = savedCodeIndex;
         
          this.codeMarker[marker] = body; 
        }
  
        var idx = ctx.nodes.indexOf(code) + 1;
        if (idx == ctx.nodes.length || ctx.nodes[idx].type != 'Code' || ctx.nodes[idx].buffer) {
          try {
            var src = this.codeBuffer + '}';
            var tpl = babelTemplate(src);
            push.apply(ast, tpl(this.codeMarker).expression.right.body.body);
            this.codeBuffer = '_=function*(){';
            this.codeIndex = -1;
            this.codeMarker = {};
          } catch(e) {
            var codeError = this.codeBuffer.substr(14).trim()
            this.error('Unbuffered code structure could not be parsed; ' + e.message + ' in ' + codeError, codeError, code)
          }
        }
  
      }
      return ast;
    }