text: var window = global;
  
  // Generated by IcedCoffeeScript 108.0.13
  (function () {
    var Type;
  
    Type = (function () {
      Type.prototype.main = "";
  
      Type.prototype.nest_list = [];
  
      Type.prototype.field_hash = {};
  
      function Type(str) {
        var ret, tail, _ref;
        if (!str) {
          this.nest_list = [];
          this.field_hash = {};
        } else {
          (_ref = this._parse_tail(str)), (ret = _ref.ret), (tail = _ref.tail);
          if (tail) {
            throw new Error("invalid format. Unparsed tail '" + tail + "'");
          }
          this.main = ret.main;
          this.nest_list = ret.nest_list;
          this.field_hash = ret.field_hash;
        }
      }
  
      Type.prototype.clone = function () {
        var k, ret, v, _i, _len, _ref, _ref1;
        ret = new Type();
        ret.main = this.main;
        _ref = this.nest_list;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          v = _ref[_i];
          ret.nest_list.push(v.clone());
        }
        _ref1 = this.field_hash;
        for (k in _ref1) {
          v = _ref1[k];
          ret.field_hash[k] = v.clone();
        }
        return ret;
      };
  
      Type.prototype.cmp = function (t) {
        var k, tv, v, _i, _len, _ref, _ref1, _ref2;
        if (this.main !== t.main) {
          return false;
        }
        if (this.nest_list.length !== t.nest_list.length) {
          return false;
        }
        _ref = this.nest_list;
        for (k = _i = 0, _len = _ref.length; _i < _len; k = ++_i) {
          v = _ref[k];
          if (!t.nest_list[k].cmp(v)) {
            return false;
          }
        }
        _ref1 = this.field_hash;
        for (k in _ref1) {
          v = _ref1[k];
          if (!(tv = t.field_hash[k])) {
            return false;
          }
          if (!tv.cmp(v)) {
            return false;
          }
        }
        _ref2 = t.field_hash;
        for (k in _ref2) {
          v = _ref2[k];
          if (!(tv = this.field_hash[k])) {
            return false;
          }
        }
        return true;
      };
  
      Type.prototype.toString = function () {
        var jl, k, ret, v, _i, _len, _ref, _ref1;
        ret = this.main;
        if (this.nest_list.length) {
          jl = [];
          _ref = this.nest_list;
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            v = _ref[_i];
            jl.push(v.toString());
          }
          ret += "<" + jl.join(", ") + ">";
        }
        jl = [];
        _ref1 = this.field_hash;
        for (k in _ref1) {
          v = _ref1[k];
          jl.push("" + k + ": " + v.toString());
        }
        if (jl.length) {
          ret += "{" + jl.join(", ") + "}";
        }
        return ret;
      };
  
      Type.prototype._parse_tail = function (tail) {
        var full_ret, key, main, reg_ret, ret, _ref, _ref1, _ref2, _ref3, _skip;
        while (tail[0] === " ") {
          tail = tail.substr(1);
        }
        full_ret = new Type();
        if (!(reg_ret = /^([^{}<>,]+)(.*)$/.exec(tail))) {
          throw new Error(
            "invalid format. Type identifier expected '" + tail + "'"
          );
        }
        (_skip = reg_ret[0]), (main = reg_ret[1]), (tail = reg_ret[2]);
        full_ret.main = main;
        if (tail[0] === "<") {
          tail = tail.substr(1);
          while (tail[0] !== ">") {
            if (tail === "") {
              throw new Error(
                "invalid format. Unexpected end of <> group '" + tail + "'"
              );
            }
            (_ref = this._parse_tail(tail)), (ret = _ref.ret), (tail = _ref.tail);
            full_ret.nest_list.push(ret);
            (_ref1 = /^(?:\s*(?:,\s*)?)(.*)$/.exec(tail)),
              (_skip = _ref1[0]),
              (tail = _ref1[1]);
          }
          tail = tail.substr(1);
        }
        if (tail[0] === "{") {
          tail = tail.substr(1);
          while (tail[0] !== "}") {
            if (tail === "") {
              throw new Error(
                "invalid format. Unexpected end of {} group '" + tail + "'"
              );
            }
            if (!(reg_ret = /^([^:]+):(.*)$/.exec(tail))) {
              throw new Error(
                "invalid format '" +
                  tail +
                  "' missing : in {} group '" +
                  tail +
                  "'"
              );
            }
            (_skip = reg_ret[0]), (key = reg_ret[1]), (tail = reg_ret[2]);
            (_ref2 = this._parse_tail(tail)),
              (ret = _ref2.ret),
              (tail = _ref2.tail);
            full_ret.field_hash[key] = ret;
            (_ref3 = /^(?:\s*(?:,\s*)?)(.*)$/.exec(tail)),
              (_skip = _ref3[0]),
              (tail = _ref3[1]);
          }
          tail = tail.substr(1);
        }
        return {
          ret: full_ret,
          tail: tail,
        };
      };
  
      return Type;
    })();
  
    window.Type = Type;
  }.call(this));
  