// Generated by CoffeeScript 1.8.0
(function() {
  var InterpolationError, PathExp, _, _ref,
    __slice = [].slice;

  _ = require('underscore');

  exports.formats = require('./formats');

  exports.placeholders = require('./placeholders');

  _ref = require('./compiler'), InterpolationError = _ref.InterpolationError, PathExp = _ref.PathExp;

  exports.InterpolationError = InterpolationError;

  exports.PathExp = PathExp;

  exports.compile = function() {
    var pattern, px, styles;
    pattern = arguments[0], styles = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    px = (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return Object(result) === result ? result : child;
    })(PathExp, [pattern].concat(__slice.call(styles)), function(){});
    return px.toRegExp();
  };

  exports.match = function() {
    var pattern, px, str, styles;
    pattern = arguments[0], str = arguments[1], styles = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
    px = (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return Object(result) === result ? result : child;
    })(PathExp, [pattern].concat(__slice.call(styles)), function(){});
    return px.match(str);
  };

  exports.fill = function() {
    var map, pattern, px, styles;
    pattern = arguments[0], map = arguments[1], styles = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
    px = (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return Object(result) === result ? result : child;
    })(PathExp, [pattern].concat(__slice.call(styles)), function(){});
    return px.fill(map);
  };

}).call(this);
