// Generated by CoffeeScript 1.11.1
(function() {
  var Liquid,
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  Liquid = require('../../liquid');

  Liquid.Tags.Capture = (function(superClass) {
    var Syntax;

    extend(Capture, superClass);

    Syntax = /(\w+)/;

    function Capture(tagName, markup, tokens) {
      var $;
      if ($ = markup.match(Syntax)) {
        this.to = $[1];
      } else {
        throw new Liquid.SyntaxError("Syntax error in 'capture' - Valid syntax: capture [var]");
      }
      Capture.__super__.constructor.call(this, tagName, markup, tokens);
    }

    Capture.prototype.render = function(context) {
      var last, output;
      output = Capture.__super__.render.call(this, context);
      last = context.scopes.length - 1;
      context.scopes[last][this.to] = output;
      return '';
    };

    return Capture;

  })(Liquid.Block);

  Liquid.Template.registerTag("capture", Liquid.Tags.Capture);

}).call(this);
