text: /*
   * Generated by PEG.js 0.10.0.
   *
   * http://pegjs.org/
   */
  
  "use strict";
  
  function peg$subclass(child, parent) {
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor();
  }
  
  function peg$SyntaxError(message, expected, found, location) {
    this.message  = message;
    this.expected = expected;
    this.found    = found;
    this.location = location;
    this.name     = "SyntaxError";
  
    if (typeof Error.captureStackTrace === "function") {
      Error.captureStackTrace(this, peg$SyntaxError);
    }
  }
  
  peg$subclass(peg$SyntaxError, Error);
  
  peg$SyntaxError.buildMessage = function(expected, found) {
    var DESCRIBE_EXPECTATION_FNS = {
          literal: function(expectation) {
            return "\"" + literalEscape(expectation.text) + "\"";
          },
  
          "class": function(expectation) {
            var escapedParts = "",
                i;
  
            for (i = 0; i < expectation.parts.length; i++) {
              escapedParts += expectation.parts[i] instanceof Array
                ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
                : classEscape(expectation.parts[i]);
            }
  
            return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
          },
  
          any: function(expectation) {
            return "any character";
          },
  
          end: function(expectation) {
            return "end of input";
          },
  
          other: function(expectation) {
            return expectation.description;
          }
        };
  
    function hex(ch) {
      return ch.charCodeAt(0).toString(16).toUpperCase();
    }
  
    function literalEscape(s) {
      return s
        .replace(/\\/g, '\\\\')
        .replace(/"/g,  '\\"')
        .replace(/\0/g, '\\0')
        .replace(/\t/g, '\\t')
        .replace(/\n/g, '\\n')
        .replace(/\r/g, '\\r')
        .replace(/[\x00-\x0F]/g,          function(ch) { return '\\x0' + hex(ch); })
        .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x'  + hex(ch); });
    }
  
    function classEscape(s) {
      return s
        .replace(/\\/g, '\\\\')
        .replace(/\]/g, '\\]')
        .replace(/\^/g, '\\^')
        .replace(/-/g,  '\\-')
        .replace(/\0/g, '\\0')
        .replace(/\t/g, '\\t')
        .replace(/\n/g, '\\n')
        .replace(/\r/g, '\\r')
        .replace(/[\x00-\x0F]/g,          function(ch) { return '\\x0' + hex(ch); })
        .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x'  + hex(ch); });
    }
  
    function describeExpectation(expectation) {
      return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
    }
  
    function describeExpected(expected) {
      var descriptions = new Array(expected.length),
          i, j;
  
      for (i = 0; i < expected.length; i++) {
        descriptions[i] = describeExpectation(expected[i]);
      }
  
      descriptions.sort();
  
      if (descriptions.length > 0) {
        for (i = 1, j = 1; i < descriptions.length; i++) {
          if (descriptions[i - 1] !== descriptions[i]) {
            descriptions[j] = descriptions[i];
            j++;
          }
        }
        descriptions.length = j;
      }
  
      switch (descriptions.length) {
        case 1:
          return descriptions[0];
  
        case 2:
          return descriptions[0] + " or " + descriptions[1];
  
        default:
          return descriptions.slice(0, -1).join(", ")
            + ", or "
            + descriptions[descriptions.length - 1];
      }
    }
  
    function describeFound(found) {
      return found ? "\"" + literalEscape(found) + "\"" : "end of input";
    }
  
    return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
  };
  
  function peg$parse(input, options) {
    options = options !== void 0 ? options : {};
  
    var peg$FAILED = {},
  
        peg$startRuleFunctions = { pgn: peg$parsepgn, tags: peg$parsetags, game: peg$parsegame, games: peg$parsegames },
        peg$startRuleFunction  = peg$parsepgn,
  
        peg$c0 = function(head, m) { return m; },
        peg$c1 = function(head, tail) { return [head].concat(tail) },
        peg$c2 = function(games) { return games },
        peg$c3 = function(t, p) { return { tags: t, moves: p[0] }; },
        peg$c4 = function(head, tail) {
                var result = {};
                [head].concat(tail).forEach(function(element) {
                  result[element.name] = element.value;
                });
                return result;
              },
        peg$c5 = function(members) { return members !== null ? members: {}; },
        peg$c6 = function(tag) { return tag; },
        peg$c7 = function(value) { return { name: 'Event', value: value }; },
        peg$c8 = function(value) { return { name: 'Site', value: value }; },
        peg$c9 = function(value) { return { name: 'Date', value: value }; },
        peg$c10 = function(value) { return { name: 'Round', value: value }; },
        peg$c11 = function(value) { return { name: 'WhiteTitle', value: value }; },
        peg$c12 = function(value) { return { name: 'BlackTitle', value: value }; },
        peg$c13 = function(value) { return { name: 'WhiteELO', value: value }; },
        peg$c14 = function(value) { return { name: 'BlackELO', value: value }; },
        peg$c15 = function(value) { return { name: 'WhiteUSCF', value: value }; },
        peg$c16 = function(value) { return { name: 'BlackUSCF', value: value }; },
        peg$c17 = function(value) { return { name: 'WhiteNA', value: value }; },
        peg$c18 = function(value) { return { name: 'BlackNA', value: value }; },
        peg$c19 = function(value) { return { name: 'WhiteType', value: value }; },
        peg$c20 = function(value) { return { name: 'BlackType', value: value }; },
        peg$c21 = function(value) { return { name: 'White', value: value }; },
        peg$c22 = function(value) { return { name: 'Black', value: value }; },
        peg$c23 = function(value) { return { name: 'Result', value: value }; },
        peg$c24 = function(value) { return { name: 'EventDate', value: value }; },
        peg$c25 = function(value) { return { name: 'EventSponsor', value: value }; },
        peg$c26 = function(value) { return { name: 'Section', value: value }; },
        peg$c27 = function(value) { return { name: 'Stage', value: value }; },
        peg$c28 = function(value) { return { name: 'Board', value: value }; },
        peg$c29 = function(value) { return { name: 'Opening', value: value }; },
        peg$c30 = function(value) { return { name: 'Variation', value: value }; },
        peg$c31 = function(value) { return { name: 'SubVariation', value: value }; },
        peg$c32 = function(value) { return { name: 'ECO', value: value }; },
        peg$c33 = function(value) { return { name: 'NIC', value: value }; },
        peg$c34 = function(value) { return { name: 'Time', value: value }; },
        peg$c35 = function(value) { return { name: 'UTCTime', value: value }; },
        peg$c36 = function(value) { return { name: 'UTCDate', value: value }; },
        peg$c37 = function(value) { return { name: 'TimeControl', value: value }; },
        peg$c38 = function(value) { return { name: 'SetUp', value: value }; },
        peg$c39 = function(value) { return { name: 'FEN', value: value }; },
        peg$c40 = function(value) { return { name: 'Termination', value: value }; },
        peg$c41 = function(value) { return { name: 'Annotator', value: value }; },
        peg$c42 = function(value) { return { name: 'Mode', value: value }; },
        peg$c43 = function(value) { return { name: 'PlyCount', value: value }; },
        peg$c44 = function(any, value) { return { name: any, value: value }; },
        peg$c45 = "Event",
        peg$c46 = peg$literalExpectation("Event", false),
        peg$c47 = "event",
        peg$c48 = peg$literalExpectation("event", false),
        peg$c49 = "Site",
        peg$c50 = peg$literalExpectation("Site", false),
        peg$c51 = "site",
        peg$c52 = peg$literalExpectation("site", false),
        peg$c53 = "Date",
        peg$c54 = peg$literalExpectation("Date", false),
        peg$c55 = "date",
        peg$c56 = peg$literalExpectation("date", false),
        peg$c57 = "Round",
        peg$c58 = peg$literalExpectation("Round", false),
        peg$c59 = "round",
        peg$c60 = peg$literalExpectation("round", false),
        peg$c61 = "White",
        peg$c62 = peg$literalExpectation("White", false),
        peg$c63 = "Black",
        peg$c64 = peg$literalExpectation("Black", false),
        peg$c65 = "black",
        peg$c66 = peg$literalExpectation("black", false),
        peg$c67 = "Result",
        peg$c68 = peg$literalExpectation("Result", false),
        peg$c69 = "result",
        peg$c70 = peg$literalExpectation("result", false),
        peg$c71 = "WhiteTitle",
        peg$c72 = peg$literalExpectation("WhiteTitle", false),
        peg$c73 = "Whitetitle",
        peg$c74 = peg$literalExpectation("Whitetitle", false),
        peg$c75 = "whitetitle",
        peg$c76 = peg$literalExpectation("whitetitle", false),
        peg$c77 = "BlackTitle",
        peg$c78 = peg$literalExpectation("BlackTitle", false),
        peg$c79 = "Blacktitle",
        peg$c80 = peg$literalExpectation("Blacktitle", false),
        peg$c81 = "blacktitle",
        peg$c82 = peg$literalExpectation("blacktitle", false),
        peg$c83 = "WhiteELO",
        peg$c84 = peg$literalExpectation("WhiteELO", false),
        peg$c85 = "WhiteElo",
        peg$c86 = peg$literalExpectation("WhiteElo", false),
        peg$c87 = "Whiteelo",
        peg$c88 = peg$literalExpectation("Whiteelo", false),
        peg$c89 = "whiteelo",
        peg$c90 = peg$literalExpectation("whiteelo", false),
        peg$c91 = "BlackELO",
        peg$c92 = peg$literalExpectation("BlackELO", false),
        peg$c93 = "BlackElo",
        peg$c94 = peg$literalExpectation("BlackElo", false),
        peg$c95 = "Blackelo",
        peg$c96 = peg$literalExpectation("Blackelo", false),
        peg$c97 = "blackelo",
        peg$c98 = peg$literalExpectation("blackelo", false),
        peg$c99 = "WhiteUSCF",
        peg$c100 = peg$literalExpectation("WhiteUSCF", false),
        peg$c101 = "WhiteUscf",
        peg$c102 = peg$literalExpectation("WhiteUscf", false),
        peg$c103 = "Whiteuscf",
        peg$c104 = peg$literalExpectation("Whiteuscf", false),
        peg$c105 = "whiteuscf",
        peg$c106 = peg$literalExpectation("whiteuscf", false),
        peg$c107 = "BlackUSCF",
        peg$c108 = peg$literalExpectation("BlackUSCF", false),
        peg$c109 = "BlackUscf",
        peg$c110 = peg$literalExpectation("BlackUscf", false),
        peg$c111 = "Blackuscf",
        peg$c112 = peg$literalExpectation("Blackuscf", false),
        peg$c113 = "blackuscf",
        peg$c114 = peg$literalExpectation("blackuscf", false),
        peg$c115 = "WhiteNA",
        peg$c116 = peg$literalExpectation("WhiteNA", false),
        peg$c117 = "WhiteNa",
        peg$c118 = peg$literalExpectation("WhiteNa", false),
        peg$c119 = "Whitena",
        peg$c120 = peg$literalExpectation("Whitena", false),
        peg$c121 = "whitena",
        peg$c122 = peg$literalExpectation("whitena", false),
        peg$c123 = "BlackNA",
        peg$c124 = peg$literalExpectation("BlackNA", false),
        peg$c125 = "BlackNa",
        peg$c126 = peg$literalExpectation("BlackNa", false),
        peg$c127 = "Blackna",
        peg$c128 = peg$literalExpectation("Blackna", false),
        peg$c129 = "blackna",
        peg$c130 = peg$literalExpectation("blackna", false),
        peg$c131 = "WhiteType",
        peg$c132 = peg$literalExpectation("WhiteType", false),
        peg$c133 = "Whitetype",
        peg$c134 = peg$literalExpectation("Whitetype", false),
        peg$c135 = "whitetype",
        peg$c136 = peg$literalExpectation("whitetype", false),
        peg$c137 = "BlackType",
        peg$c138 = peg$literalExpectation("BlackType", false),
        peg$c139 = "Blacktype",
        peg$c140 = peg$literalExpectation("Blacktype", false),
        peg$c141 = "blacktype",
        peg$c142 = peg$literalExpectation("blacktype", false),
        peg$c143 = "EventDate",
        peg$c144 = peg$literalExpectation("EventDate", false),
        peg$c145 = "Eventdate",
        peg$c146 = peg$literalExpectation("Eventdate", false),
        peg$c147 = "eventdate",
        peg$c148 = peg$literalExpectation("eventdate", false),
        peg$c149 = "EventSponsor",
        peg$c150 = peg$literalExpectation("EventSponsor", false),
        peg$c151 = "Eventsponsor",
        peg$c152 = peg$literalExpectation("Eventsponsor", false),
        peg$c153 = "eventsponsor",
        peg$c154 = peg$literalExpectation("eventsponsor", false),
        peg$c155 = "Section",
        peg$c156 = peg$literalExpectation("Section", false),
        peg$c157 = "section",
        peg$c158 = peg$literalExpectation("section", false),
        peg$c159 = "Stage",
        peg$c160 = peg$literalExpectation("Stage", false),
        peg$c161 = "stage",
        peg$c162 = peg$literalExpectation("stage", false),
        peg$c163 = "Board",
        peg$c164 = peg$literalExpectation("Board", false),
        peg$c165 = "board",
        peg$c166 = peg$literalExpectation("board", false),
        peg$c167 = "Opening",
        peg$c168 = peg$literalExpectation("Opening", false),
        peg$c169 = "opening",
        peg$c170 = peg$literalExpectation("opening", false),
        peg$c171 = "Variation",
        peg$c172 = peg$literalExpectation("Variation", false),
        peg$c173 = "variation",
        peg$c174 = peg$literalExpectation("variation", false),
        peg$c175 = "SubVariation",
        peg$c176 = peg$literalExpectation("SubVariation", false),
        peg$c177 = "Subvariation",
        peg$c178 = peg$literalExpectation("Subvariation", false),
        peg$c179 = "subvariation",
        peg$c180 = peg$literalExpectation("subvariation", false),
        peg$c181 = "ECO",
        peg$c182 = peg$literalExpectation("ECO", false),
        peg$c183 = "Eco",
        peg$c184 = peg$literalExpectation("Eco", false),
        peg$c185 = "eco",
        peg$c186 = peg$literalExpectation("eco", false),
        peg$c187 = "NIC",
        peg$c188 = peg$literalExpectation("NIC", false),
        peg$c189 = "Nic",
        peg$c190 = peg$literalExpectation("Nic", false),
        peg$c191 = "nic",
        peg$c192 = peg$literalExpectation("nic", false),
        peg$c193 = "Time",
        peg$c194 = peg$literalExpectation("Time", false),
        peg$c195 = "time",
        peg$c196 = peg$literalExpectation("time", false),
        peg$c197 = "UTCTime",
        peg$c198 = peg$literalExpectation("UTCTime", false),
        peg$c199 = "UTCtime",
        peg$c200 = peg$literalExpectation("UTCtime", false),
        peg$c201 = "UtcTime",
        peg$c202 = peg$literalExpectation("UtcTime", false),
        peg$c203 = "Utctime",
        peg$c204 = peg$literalExpectation("Utctime", false),
        peg$c205 = "utctime",
        peg$c206 = peg$literalExpectation("utctime", false),
        peg$c207 = "UTCDate",
        peg$c208 = peg$literalExpectation("UTCDate", false),
        peg$c209 = "UTCdate",
        peg$c210 = peg$literalExpectation("UTCdate", false),
        peg$c211 = "UtcDate",
        peg$c212 = peg$literalExpectation("UtcDate", false),
        peg$c213 = "Utcdate",
        peg$c214 = peg$literalExpectation("Utcdate", false),
        peg$c215 = "utcdate",
        peg$c216 = peg$literalExpectation("utcdate", false),
        peg$c217 = "TimeControl",
        peg$c218 = peg$literalExpectation("TimeControl", false),
        peg$c219 = "Timecontrol",
        peg$c220 = peg$literalExpectation("Timecontrol", false),
        peg$c221 = "timecontrol",
        peg$c222 = peg$literalExpectation("timecontrol", false),
        peg$c223 = "SetUp",
        peg$c224 = peg$literalExpectation("SetUp", false),
        peg$c225 = "Setup",
        peg$c226 = peg$literalExpectation("Setup", false),
        peg$c227 = "setup",
        peg$c228 = peg$literalExpectation("setup", false),
        peg$c229 = "FEN",
        peg$c230 = peg$literalExpectation("FEN", false),
        peg$c231 = "Fen",
        peg$c232 = peg$literalExpectation("Fen", false),
        peg$c233 = "fen",
        peg$c234 = peg$literalExpectation("fen", false),
        peg$c235 = "Termination",
        peg$c236 = peg$literalExpectation("Termination", false),
        peg$c237 = "termination",
        peg$c238 = peg$literalExpectation("termination", false),
        peg$c239 = "Annotator",
        peg$c240 = peg$literalExpectation("Annotator", false),
        peg$c241 = "annotator",
        peg$c242 = peg$literalExpectation("annotator", false),
        peg$c243 = "Mode",
        peg$c244 = peg$literalExpectation("Mode", false),
        peg$c245 = "mode",
        peg$c246 = peg$literalExpectation("mode", false),
        peg$c247 = "PlyCount",
        peg$c248 = peg$literalExpectation("PlyCount", false),
        peg$c249 = "Plycount",
        peg$c250 = peg$literalExpectation("Plycount", false),
        peg$c251 = "plycount",
        peg$c252 = peg$literalExpectation("plycount", false),
        peg$c253 = peg$otherExpectation("whitespace"),
        peg$c254 = /^[ \t\n\r]/,
        peg$c255 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
        peg$c256 = peg$otherExpectation("string"),
        peg$c257 = function(chars) { return chars.join(""); },
        peg$c258 = /^[a-zA-Z0-9]/,
        peg$c259 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false),
        peg$c260 = "\"",
        peg$c261 = peg$literalExpectation("\"", false),
        peg$c262 = /^[^\0-\x1F"\\]/,
        peg$c263 = peg$classExpectation([["\0", "\x1F"], "\"", "\\"], true, false),
        peg$c264 = /^[0-9?]/,
        peg$c265 = peg$classExpectation([["0", "9"], "?"], false, false),
        peg$c266 = ".",
        peg$c267 = peg$literalExpectation(".", false),
        peg$c268 = function(year, month, day) { return "" + year.join("") + '.' + month.join("") + '.' + day.join("");},
        peg$c269 = function(res) { return res; },
        peg$c270 = "1-0",
        peg$c271 = peg$literalExpectation("1-0", false),
        peg$c272 = function(res) {return res; },
        peg$c273 = "1:0",
        peg$c274 = peg$literalExpectation("1:0", false),
        peg$c275 = "0-1",
        peg$c276 = peg$literalExpectation("0-1", false),
        peg$c277 = "0:1",
        peg$c278 = peg$literalExpectation("0:1", false),
        peg$c279 = "1/2-1/2",
        peg$c280 = peg$literalExpectation("1/2-1/2", false),
        peg$c281 = "*",
        peg$c282 = peg$literalExpectation("*", false),
        peg$c283 = "-",
        peg$c284 = peg$literalExpectation("-", false),
        peg$c285 = /^[0-9]/,
        peg$c286 = peg$classExpectation([["0", "9"]], false, false),
        peg$c287 = function(digits) { return makeInteger(digits); },
        peg$c288 = function(pw, all) { var arr = (all ? all : []); arr.unshift(pw);return arr; },
        peg$c289 = function(pb, all) { var arr = (all ? all : []); arr.unshift(pb); return arr; },
        peg$c290 = function() { return [[]]; },
        peg$c291 = function(pw) { return pw; },
        peg$c292 = function(pb) { return pb; },
        peg$c293 = function(cm, mn, cb, hm, nag, ca, cd, vari, all) { var arr = (all ? all : []);
              var move = {}; move.turn = 'w'; move.moveNumber = mn;
              move.notation = hm; move.commentBefore = cb; move.commentAfter = ca; move.commentMove = cm;
              move.variations = (vari ? vari : []); move.nag = (nag ? nag : null); arr.unshift(move); 
              move.commentDiag = cd;
              return arr; },
        peg$c294 = function(cm, me, cb, hm, nag, ca, cd, vari, all) { var arr = (all ? all : []);
              var move = {}; move.turn = 'b'; move.moveNumber = me;
              move.notation = hm; move.commentBefore = cb; move.commentAfter = ca; move.commentMove = cm;
              move.variations = (vari ? vari : []); arr.unshift(move); move.nag = (nag ? nag : null);
              move.commentDiag = cd;
              return arr; },
        peg$c295 = function() { return ["1:0"]; },
        peg$c296 = function() { return ["0:1"]; },
        peg$c297 = function() { return ["1-0"]; },
        peg$c298 = function() { return ["0-1"]; },
        peg$c299 = function() { return ["1/2-1/2"]; },
        peg$c300 = function() { return ["*"]; },
        peg$c301 = function(cf, cfl) { var comm = cf; for (var i=0; i < cfl.length; i++) { comm += " " + cfl[i][1]}; return comm; },
        peg$c302 = /^[^}]/,
        peg$c303 = peg$classExpectation(["}"], true, false),
        peg$c304 = function(cm) { return cm.join("").trim(); },
        peg$c305 = function(cas) { return cas; },
        peg$c306 = function(ca, cal) { var ret = { }; if (cal) { var o = cal[0]; return {...ca, ...o}; } return ca; },
        peg$c307 = function(caf) { var ret = {}; ret.colorFields = caf; return ret; },
        peg$c308 = function(caa) { var ret = {}; ret.colorArrows = caa; return ret; },
        peg$c309 = function(cac) { var ret = {}; ret.clock = cac; return ret; },
        peg$c310 = "%csl",
        peg$c311 = peg$literalExpectation("%csl", false),
        peg$c312 = function(cfs) { return cfs; },
        peg$c313 = "%cal",
        peg$c314 = peg$literalExpectation("%cal", false),
        peg$c315 = ",",
        peg$c316 = peg$literalExpectation(",", false),
        peg$c317 = function(cf, cfl) { var arr = []; arr.push(cf); for (var i=0; i < cfl.length; i++) { arr.push(cfl[i][2])}; return arr; },
        peg$c318 = function(col, f) { return col + f; },
        peg$c319 = function(col, ff, ft) { return col + ff + ft; },
        peg$c320 = "Y",
        peg$c321 = peg$literalExpectation("Y", false),
        peg$c322 = function() { return "Y"; },
        peg$c323 = "G",
        peg$c324 = peg$literalExpectation("G", false),
        peg$c325 = function() { return "G"; },
        peg$c326 = "R",
        peg$c327 = peg$literalExpectation("R", false),
        peg$c328 = function() { return "R"; },
        peg$c329 = "B",
        peg$c330 = peg$literalExpectation("B", false),
        peg$c331 = function() { return "B"; },
        peg$c332 = function(col, row) { return col + row; },
        peg$c333 = "{",
        peg$c334 = peg$literalExpectation("{", false),
        peg$c335 = "}",
        peg$c336 = peg$literalExpectation("}", false),
        peg$c337 = "[",
        peg$c338 = peg$literalExpectation("[", false),
        peg$c339 = "]",
        peg$c340 = peg$literalExpectation("]", false),
        peg$c341 = "%",
        peg$c342 = peg$literalExpectation("%", false),
        peg$c343 = function(cc, cv) { var ret = {}; ret.type = cc; ret.value = cv; return ret; },
        peg$c344 = "clk",
        peg$c345 = peg$literalExpectation("clk", false),
        peg$c346 = function() { return "clk"; },
        peg$c347 = "egt",
        peg$c348 = peg$literalExpectation("egt", false),
        peg$c349 = function() { return "egt"; },
        peg$c350 = "emt",
        peg$c351 = peg$literalExpectation("emt", false),
        peg$c352 = function() { return "emt"; },
        peg$c353 = "mct",
        peg$c354 = peg$literalExpectation("mct", false),
        peg$c355 = function() { return "mct"; },
        peg$c356 = ":",
        peg$c357 = peg$literalExpectation(":", false),
        peg$c358 = function(h1, h2, m1, m2, s1, s2) { var ret = h1; if (h2) { ret += h2 }; ret += ":" + m1 + m2 + ":" + s1 + s2; return ret; },
        peg$c359 = function(d) { return d; },
        peg$c360 = function(vari, all, me) { var arr = (all ? all : []); arr.unshift(vari); return arr; },
        peg$c361 = function(vari, all) { var arr = (all ? all : []); arr.unshift(vari); return arr; },
        peg$c362 = "(",
        peg$c363 = peg$literalExpectation("(", false),
        peg$c364 = ")",
        peg$c365 = peg$literalExpectation(")", false),
        peg$c366 = function(num) { return num; },
        peg$c367 = peg$otherExpectation("integer"),
        peg$c368 = " ",
        peg$c369 = peg$literalExpectation(" ", false),
        peg$c370 = function() { return '';},
        peg$c371 = function(fig, disc, str, col, row, pr, ch) { var hm = {}; hm.fig = (fig ? fig : null); hm.disc =  (disc ? disc : null); hm.strike = (str ? str : null); hm.col = col; hm.row = row; hm.check = (ch ? ch : null); hm.promotion = pr; hm.notation = (fig ? fig : "") + (disc ? disc : "") + (str ? str : "") + col + row + (pr ? pr : "") + (ch ? ch : ""); return hm; },
        peg$c372 = function(fig, cols, rows, str, col, row, pr, ch) { var hm = {}; hm.fig = (fig ? fig : null); hm.strike = (str =='x' ? str : null); hm.col = col; hm.row = row; hm.check = (ch ? ch : null); hm.notation = (fig && (fig!=='P') ? fig : "") + cols + rows + (str=='x' ? str : "-") + col  + row + (pr ? pr : "") + (ch ? ch : ""); hm.promotion = pr; return hm; },
        peg$c373 = function(fig, str, col, row, pr, ch) { var hm = {}; hm.fig = (fig ? fig : null); hm.strike = (str ? str : null); hm.col = col; hm.row = row; hm.check = (ch ? ch : null); hm.notation = (fig ? fig : "") + (str ? str : "") + col  + row + (pr ? pr : "") + (ch ? ch : ""); hm.promotion = pr; return hm; },
        peg$c374 = "O-O-O",
        peg$c375 = peg$literalExpectation("O-O-O", false),
        peg$c376 = function(ch) { var hm = {}; hm.notation = 'O-O-O'+ (ch ? ch : ""); hm.check = (ch ? ch : null); return  hm; },
        peg$c377 = "O-O",
        peg$c378 = peg$literalExpectation("O-O", false),
        peg$c379 = function(ch) { var hm = {}; hm.notation = 'O-O'+ (ch ? ch : ""); hm.check = (ch ? ch : null); return  hm; },
        peg$c380 = "+-",
        peg$c381 = peg$literalExpectation("+-", false),
        peg$c382 = "+",
        peg$c383 = peg$literalExpectation("+", false),
        peg$c384 = function(ch) { return ch[1]; },
        peg$c385 = "$$$",
        peg$c386 = peg$literalExpectation("$$$", false),
        peg$c387 = "#",
        peg$c388 = peg$literalExpectation("#", false),
        peg$c389 = "=",
        peg$c390 = peg$literalExpectation("=", false),
        peg$c391 = function(f) { return '=' + f; },
        peg$c392 = function(nag, nags) { var arr = (nags ? nags : []); arr.unshift(nag); return arr; },
        peg$c393 = "$",
        peg$c394 = peg$literalExpectation("$", false),
        peg$c395 = function(num) { return '$' + num; },
        peg$c396 = "!!",
        peg$c397 = peg$literalExpectation("!!", false),
        peg$c398 = function() { return '$3'; },
        peg$c399 = "??",
        peg$c400 = peg$literalExpectation("??", false),
        peg$c401 = function() { return '$4'; },
        peg$c402 = "!?",
        peg$c403 = peg$literalExpectation("!?", false),
        peg$c404 = function() { return '$5'; },
        peg$c405 = "?!",
        peg$c406 = peg$literalExpectation("?!", false),
        peg$c407 = function() { return '$6'; },
        peg$c408 = "!",
        peg$c409 = peg$literalExpectation("!", false),
        peg$c410 = function() { return '$1'; },
        peg$c411 = "?",
        peg$c412 = peg$literalExpectation("?", false),
        peg$c413 = function() { return '$2'; },
        peg$c414 = "\u203C",
        peg$c415 = peg$literalExpectation("\u203C", false),
        peg$c416 = "\u2047",
        peg$c417 = peg$literalExpectation("\u2047", false),
        peg$c418 = "\u2049",
        peg$c419 = peg$literalExpectation("\u2049", false),
        peg$c420 = "\u2048",
        peg$c421 = peg$literalExpectation("\u2048", false),
        peg$c422 = "\u25A1",
        peg$c423 = peg$literalExpectation("\u25A1", false),
        peg$c424 = function() { return '$7'; },
        peg$c425 = function() { return '$10'; },
        peg$c426 = "\u221E",
        peg$c427 = peg$literalExpectation("\u221E", false),
        peg$c428 = function() { return '$13'; },
        peg$c429 = "\u2A72",
        peg$c430 = peg$literalExpectation("\u2A72", false),
        peg$c431 = function() { return '$14'; },
        peg$c432 = "\u2A71",
        peg$c433 = peg$literalExpectation("\u2A71", false),
        peg$c434 = function() { return '$15';},
        peg$c435 = "\xB1",
        peg$c436 = peg$literalExpectation("\xB1", false),
        peg$c437 = function() { return '$16';},
        peg$c438 = "\u2213",
        peg$c439 = peg$literalExpectation("\u2213", false),
        peg$c440 = function() { return '$17';},
        peg$c441 = function() { return '$18';},
        peg$c442 = "-+",
        peg$c443 = peg$literalExpectation("-+", false),
        peg$c444 = function() { return '$19';},
        peg$c445 = "\u2A00",
        peg$c446 = peg$literalExpectation("\u2A00", false),
        peg$c447 = function() { return '$22'; },
        peg$c448 = "\u27F3",
        peg$c449 = peg$literalExpectation("\u27F3", false),
        peg$c450 = function() { return '$32'; },
        peg$c451 = "\u2192",
        peg$c452 = peg$literalExpectation("\u2192", false),
        peg$c453 = function() { return '$36'; },
        peg$c454 = "\u2191",
        peg$c455 = peg$literalExpectation("\u2191", false),
        peg$c456 = function() { return '$40'; },
        peg$c457 = "\u21C6",
        peg$c458 = peg$literalExpectation("\u21C6", false),
        peg$c459 = function() { return '$132'; },
        peg$c460 = "D",
        peg$c461 = peg$literalExpectation("D", false),
        peg$c462 = function() { return '$220'; },
        peg$c463 = /^[RNBQKP]/,
        peg$c464 = peg$classExpectation(["R", "N", "B", "Q", "K", "P"], false, false),
        peg$c465 = /^[RNBQ]/,
        peg$c466 = peg$classExpectation(["R", "N", "B", "Q"], false, false),
        peg$c467 = /^[a-h]/,
        peg$c468 = peg$classExpectation([["a", "h"]], false, false),
        peg$c469 = /^[1-8]/,
        peg$c470 = peg$classExpectation([["1", "8"]], false, false),
        peg$c471 = "x",
        peg$c472 = peg$literalExpectation("x", false),
  
        peg$currPos          = 0,
        peg$savedPos         = 0,
        peg$posDetailsCache  = [{ line: 1, column: 1 }],
        peg$maxFailPos       = 0,
        peg$maxFailExpected  = [],
        peg$silentFails      = 0,
  
        peg$result;
  
    if ("startRule" in options) {
      if (!(options.startRule in peg$startRuleFunctions)) {
        throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
      }
  
      peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
    }
  
    function text() {
      return input.substring(peg$savedPos, peg$currPos);
    }
  
    function location() {
      return peg$computeLocation(peg$savedPos, peg$currPos);
    }
  
    function expected(description, location) {
      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  
      throw peg$buildStructuredError(
        [peg$otherExpectation(description)],
        input.substring(peg$savedPos, peg$currPos),
        location
      );
    }
  
    function error(message, location) {
      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  
      throw peg$buildSimpleError(message, location);
    }
  
    function peg$literalExpectation(text, ignoreCase) {
      return { type: "literal", text: text, ignoreCase: ignoreCase };
    }
  
    function peg$classExpectation(parts, inverted, ignoreCase) {
      return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
    }
  
    function peg$anyExpectation() {
      return { type: "any" };
    }
  
    function peg$endExpectation() {
      return { type: "end" };
    }
  
    function peg$otherExpectation(description) {
      return { type: "other", description: description };
    }
  
    function peg$computePosDetails(pos) {
      var details = peg$posDetailsCache[pos], p;
  
      if (details) {
        return details;
      } else {
        p = pos - 1;
        while (!peg$posDetailsCache[p]) {
          p--;
        }
  
        details = peg$posDetailsCache[p];
        details = {
          line:   details.line,
          column: details.column
        };
  
        while (p < pos) {
          if (input.charCodeAt(p) === 10) {
            details.line++;
            details.column = 1;
          } else {
            details.column++;
          }
  
          p++;
        }
  
        peg$posDetailsCache[pos] = details;
        return details;
      }
    }
  
    function peg$computeLocation(startPos, endPos) {
      var startPosDetails = peg$computePosDetails(startPos),
          endPosDetails   = peg$computePosDetails(endPos);
  
      return {
        start: {
          offset: startPos,
          line:   startPosDetails.line,
          column: startPosDetails.column
        },
        end: {
          offset: endPos,
          line:   endPosDetails.line,
          column: endPosDetails.column
        }
      };
    }
  
    function peg$fail(expected) {
      if (peg$currPos < peg$maxFailPos) { return; }
  
      if (peg$currPos > peg$maxFailPos) {
        peg$maxFailPos = peg$currPos;
        peg$maxFailExpected = [];
      }
  
      peg$maxFailExpected.push(expected);
    }
  
    function peg$buildSimpleError(message, location) {
      return new peg$SyntaxError(message, null, null, location);
    }
  
    function peg$buildStructuredError(expected, found, location) {
      return new peg$SyntaxError(
        peg$SyntaxError.buildMessage(expected, found),
        expected,
        found,
        location
      );
    }
  
    function peg$parsegames() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsews();
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        s3 = peg$parsegame();
        if (s3 !== peg$FAILED) {
          s4 = [];
          s5 = peg$currPos;
          s6 = peg$parsewsp();
          if (s6 !== peg$FAILED) {
            s7 = peg$parsegame();
            if (s7 !== peg$FAILED) {
              peg$savedPos = s5;
              s6 = peg$c0(s3, s7);
              s5 = s6;
            } else {
              peg$currPos = s5;
              s5 = peg$FAILED;
            }
          } else {
            peg$currPos = s5;
            s5 = peg$FAILED;
          }
          while (s5 !== peg$FAILED) {
            s4.push(s5);
            s5 = peg$currPos;
            s6 = peg$parsewsp();
            if (s6 !== peg$FAILED) {
              s7 = peg$parsegame();
              if (s7 !== peg$FAILED) {
                peg$savedPos = s5;
                s6 = peg$c0(s3, s7);
                s5 = s6;
              } else {
                peg$currPos = s5;
                s5 = peg$FAILED;
              }
            } else {
              peg$currPos = s5;
              s5 = peg$FAILED;
            }
          }
          if (s4 !== peg$FAILED) {
            peg$savedPos = s2;
            s3 = peg$c1(s3, s4);
            s2 = s3;
          } else {
            peg$currPos = s2;
            s2 = peg$FAILED;
          }
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c2(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsegame() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = peg$parsetags();
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parsepgn();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c3(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsetags() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsews();
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        s3 = peg$parsetag();
        if (s3 !== peg$FAILED) {
          s4 = [];
          s5 = peg$currPos;
          s6 = peg$parsews();
          if (s6 !== peg$FAILED) {
            s7 = peg$parsetag();
            if (s7 !== peg$FAILED) {
              peg$savedPos = s5;
              s6 = peg$c0(s3, s7);
              s5 = s6;
            } else {
              peg$currPos = s5;
              s5 = peg$FAILED;
            }
          } else {
            peg$currPos = s5;
            s5 = peg$FAILED;
          }
          while (s5 !== peg$FAILED) {
            s4.push(s5);
            s5 = peg$currPos;
            s6 = peg$parsews();
            if (s6 !== peg$FAILED) {
              s7 = peg$parsetag();
              if (s7 !== peg$FAILED) {
                peg$savedPos = s5;
                s6 = peg$c0(s3, s7);
                s5 = s6;
              } else {
                peg$currPos = s5;
                s5 = peg$FAILED;
              }
            } else {
              peg$currPos = s5;
              s5 = peg$FAILED;
            }
          }
          if (s4 !== peg$FAILED) {
            peg$savedPos = s2;
            s3 = peg$c4(s3, s4);
            s2 = s3;
          } else {
            peg$currPos = s2;
            s2 = peg$FAILED;
          }
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsews();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c5(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsetag() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parsebl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsetagKeyValue();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsebr();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c6(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsetagKeyValue() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parseeventKey();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsestring();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c7(s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parsesiteKey();
        if (s1 !== peg$FAILED) {
          s2 = peg$parsews();
          if (s2 !== peg$FAILED) {
            s3 = peg$parsestring();
            if (s3 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c8(s3);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parsedateKey();
          if (s1 !== peg$FAILED) {
            s2 = peg$parsews();
            if (s2 !== peg$FAILED) {
              s3 = peg$parsedate();
              if (s3 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c9(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parseroundKey();
            if (s1 !== peg$FAILED) {
              s2 = peg$parsews();
              if (s2 !== peg$FAILED) {
                s3 = peg$parsestring();
                if (s3 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c10(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              s1 = peg$parsewhiteTitleKey();
              if (s1 !== peg$FAILED) {
                s2 = peg$parsews();
                if (s2 !== peg$FAILED) {
                  s3 = peg$parsestring();
                  if (s3 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c11(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                s1 = peg$parseblackTitleKey();
                if (s1 !== peg$FAILED) {
                  s2 = peg$parsews();
                  if (s2 !== peg$FAILED) {
                    s3 = peg$parsestring();
                    if (s3 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c12(s3);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
                if (s0 === peg$FAILED) {
                  s0 = peg$currPos;
                  s1 = peg$parsewhiteEloKey();
                  if (s1 !== peg$FAILED) {
                    s2 = peg$parsews();
                    if (s2 !== peg$FAILED) {
                      s3 = peg$parseintegerOrDash();
                      if (s3 !== peg$FAILED) {
                        peg$savedPos = s0;
                        s1 = peg$c13(s3);
                        s0 = s1;
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                  if (s0 === peg$FAILED) {
                    s0 = peg$currPos;
                    s1 = peg$parseblackEloKey();
                    if (s1 !== peg$FAILED) {
                      s2 = peg$parsews();
                      if (s2 !== peg$FAILED) {
                        s3 = peg$parseintegerOrDash();
                        if (s3 !== peg$FAILED) {
                          peg$savedPos = s0;
                          s1 = peg$c14(s3);
                          s0 = s1;
                        } else {
                          peg$currPos = s0;
                          s0 = peg$FAILED;
                        }
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                    if (s0 === peg$FAILED) {
                      s0 = peg$currPos;
                      s1 = peg$parsewhiteUSCFKey();
                      if (s1 !== peg$FAILED) {
                        s2 = peg$parsews();
                        if (s2 !== peg$FAILED) {
                          s3 = peg$parseintegerString();
                          if (s3 !== peg$FAILED) {
                            peg$savedPos = s0;
                            s1 = peg$c15(s3);
                            s0 = s1;
                          } else {
                            peg$currPos = s0;
                            s0 = peg$FAILED;
                          }
                        } else {
                          peg$currPos = s0;
                          s0 = peg$FAILED;
                        }
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                      if (s0 === peg$FAILED) {
                        s0 = peg$currPos;
                        s1 = peg$parseblackUSCFKey();
                        if (s1 !== peg$FAILED) {
                          s2 = peg$parsews();
                          if (s2 !== peg$FAILED) {
                            s3 = peg$parseintegerString();
                            if (s3 !== peg$FAILED) {
                              peg$savedPos = s0;
                              s1 = peg$c16(s3);
                              s0 = s1;
                            } else {
                              peg$currPos = s0;
                              s0 = peg$FAILED;
                            }
                          } else {
                            peg$currPos = s0;
                            s0 = peg$FAILED;
                          }
                        } else {
                          peg$currPos = s0;
                          s0 = peg$FAILED;
                        }
                        if (s0 === peg$FAILED) {
                          s0 = peg$currPos;
                          s1 = peg$parsewhiteNAKey();
                          if (s1 !== peg$FAILED) {
                            s2 = peg$parsews();
                            if (s2 !== peg$FAILED) {
                              s3 = peg$parsestring();
                              if (s3 !== peg$FAILED) {
                                peg$savedPos = s0;
                                s1 = peg$c17(s3);
                                s0 = s1;
                              } else {
                                peg$currPos = s0;
                                s0 = peg$FAILED;
                              }
                            } else {
                              peg$currPos = s0;
                              s0 = peg$FAILED;
                            }
                          } else {
                            peg$currPos = s0;
                            s0 = peg$FAILED;
                          }
                          if (s0 === peg$FAILED) {
                            s0 = peg$currPos;
                            s1 = peg$parseblackNAKey();
                            if (s1 !== peg$FAILED) {
                              s2 = peg$parsews();
                              if (s2 !== peg$FAILED) {
                                s3 = peg$parsestring();
                                if (s3 !== peg$FAILED) {
                                  peg$savedPos = s0;
                                  s1 = peg$c18(s3);
                                  s0 = s1;
                                } else {
                                  peg$currPos = s0;
                                  s0 = peg$FAILED;
                                }
                              } else {
                                peg$currPos = s0;
                                s0 = peg$FAILED;
                              }
                            } else {
                              peg$currPos = s0;
                              s0 = peg$FAILED;
                            }
                            if (s0 === peg$FAILED) {
                              s0 = peg$currPos;
                              s1 = peg$parsewhiteTypeKey();
                              if (s1 !== peg$FAILED) {
                                s2 = peg$parsews();
                                if (s2 !== peg$FAILED) {
                                  s3 = peg$parsestring();
                                  if (s3 !== peg$FAILED) {
                                    peg$savedPos = s0;
                                    s1 = peg$c19(s3);
                                    s0 = s1;
                                  } else {
                                    peg$currPos = s0;
                                    s0 = peg$FAILED;
                                  }
                                } else {
                                  peg$currPos = s0;
                                  s0 = peg$FAILED;
                                }
                              } else {
                                peg$currPos = s0;
                                s0 = peg$FAILED;
                              }
                              if (s0 === peg$FAILED) {
                                s0 = peg$currPos;
                                s1 = peg$parseblackTypeKey();
                                if (s1 !== peg$FAILED) {
                                  s2 = peg$parsews();
                                  if (s2 !== peg$FAILED) {
                                    s3 = peg$parsestring();
                                    if (s3 !== peg$FAILED) {
                                      peg$savedPos = s0;
                                      s1 = peg$c20(s3);
                                      s0 = s1;
                                    } else {
                                      peg$currPos = s0;
                                      s0 = peg$FAILED;
                                    }
                                  } else {
                                    peg$currPos = s0;
                                    s0 = peg$FAILED;
                                  }
                                } else {
                                  peg$currPos = s0;
                                  s0 = peg$FAILED;
                                }
                                if (s0 === peg$FAILED) {
                                  s0 = peg$currPos;
                                  s1 = peg$parsewhiteKey();
                                  if (s1 !== peg$FAILED) {
                                    s2 = peg$parsews();
                                    if (s2 !== peg$FAILED) {
                                      s3 = peg$parsestring();
                                      if (s3 !== peg$FAILED) {
                                        peg$savedPos = s0;
                                        s1 = peg$c21(s3);
                                        s0 = s1;
                                      } else {
                                        peg$currPos = s0;
                                        s0 = peg$FAILED;
                                      }
                                    } else {
                                      peg$currPos = s0;
                                      s0 = peg$FAILED;
                                    }
                                  } else {
                                    peg$currPos = s0;
                                    s0 = peg$FAILED;
                                  }
                                  if (s0 === peg$FAILED) {
                                    s0 = peg$currPos;
                                    s1 = peg$parseblackKey();
                                    if (s1 !== peg$FAILED) {
                                      s2 = peg$parsews();
                                      if (s2 !== peg$FAILED) {
                                        s3 = peg$parsestring();
                                        if (s3 !== peg$FAILED) {
                                          peg$savedPos = s0;
                                          s1 = peg$c22(s3);
                                          s0 = s1;
                                        } else {
                                          peg$currPos = s0;
                                          s0 = peg$FAILED;
                                        }
                                      } else {
                                        peg$currPos = s0;
                                        s0 = peg$FAILED;
                                      }
                                    } else {
                                      peg$currPos = s0;
                                      s0 = peg$FAILED;
                                    }
                                    if (s0 === peg$FAILED) {
                                      s0 = peg$currPos;
                                      s1 = peg$parseresultKey();
                                      if (s1 !== peg$FAILED) {
                                        s2 = peg$parsews();
                                        if (s2 !== peg$FAILED) {
                                          s3 = peg$parseresult();
                                          if (s3 !== peg$FAILED) {
                                            peg$savedPos = s0;
                                            s1 = peg$c23(s3);
                                            s0 = s1;
                                          } else {
                                            peg$currPos = s0;
                                            s0 = peg$FAILED;
                                          }
                                        } else {
                                          peg$currPos = s0;
                                          s0 = peg$FAILED;
                                        }
                                      } else {
                                        peg$currPos = s0;
                                        s0 = peg$FAILED;
                                      }
                                      if (s0 === peg$FAILED) {
                                        s0 = peg$currPos;
                                        s1 = peg$parseeventDateKey();
                                        if (s1 !== peg$FAILED) {
                                          s2 = peg$parsews();
                                          if (s2 !== peg$FAILED) {
                                            s3 = peg$parsedate();
                                            if (s3 !== peg$FAILED) {
                                              peg$savedPos = s0;
                                              s1 = peg$c24(s3);
                                              s0 = s1;
                                            } else {
                                              peg$currPos = s0;
                                              s0 = peg$FAILED;
                                            }
                                          } else {
                                            peg$currPos = s0;
                                            s0 = peg$FAILED;
                                          }
                                        } else {
                                          peg$currPos = s0;
                                          s0 = peg$FAILED;
                                        }
                                        if (s0 === peg$FAILED) {
                                          s0 = peg$currPos;
                                          s1 = peg$parseeventSponsorKey();
                                          if (s1 !== peg$FAILED) {
                                            s2 = peg$parsews();
                                            if (s2 !== peg$FAILED) {
                                              s3 = peg$parsestring();
                                              if (s3 !== peg$FAILED) {
                                                peg$savedPos = s0;
                                                s1 = peg$c25(s3);
                                                s0 = s1;
                                              } else {
                                                peg$currPos = s0;
                                                s0 = peg$FAILED;
                                              }
                                            } else {
                                              peg$currPos = s0;
                                              s0 = peg$FAILED;
                                            }
                                          } else {
                                            peg$currPos = s0;
                                            s0 = peg$FAILED;
                                          }
                                          if (s0 === peg$FAILED) {
                                            s0 = peg$currPos;
                                            s1 = peg$parsesectionKey();
                                            if (s1 !== peg$FAILED) {
                                              s2 = peg$parsews();
                                              if (s2 !== peg$FAILED) {
                                                s3 = peg$parsestring();
                                                if (s3 !== peg$FAILED) {
                                                  peg$savedPos = s0;
                                                  s1 = peg$c26(s3);
                                                  s0 = s1;
                                                } else {
                                                  peg$currPos = s0;
                                                  s0 = peg$FAILED;
                                                }
                                              } else {
                                                peg$currPos = s0;
                                                s0 = peg$FAILED;
                                              }
                                            } else {
                                              peg$currPos = s0;
                                              s0 = peg$FAILED;
                                            }
                                            if (s0 === peg$FAILED) {
                                              s0 = peg$currPos;
                                              s1 = peg$parsestageKey();
                                              if (s1 !== peg$FAILED) {
                                                s2 = peg$parsews();
                                                if (s2 !== peg$FAILED) {
                                                  s3 = peg$parsestring();
                                                  if (s3 !== peg$FAILED) {
                                                    peg$savedPos = s0;
                                                    s1 = peg$c27(s3);
                                                    s0 = s1;
                                                  } else {
                                                    peg$currPos = s0;
                                                    s0 = peg$FAILED;
                                                  }
                                                } else {
                                                  peg$currPos = s0;
                                                  s0 = peg$FAILED;
                                                }
                                              } else {
                                                peg$currPos = s0;
                                                s0 = peg$FAILED;
                                              }
                                              if (s0 === peg$FAILED) {
                                                s0 = peg$currPos;
                                                s1 = peg$parseboardKey();
                                                if (s1 !== peg$FAILED) {
                                                  s2 = peg$parsews();
                                                  if (s2 !== peg$FAILED) {
                                                    s3 = peg$parseintegerString();
                                                    if (s3 !== peg$FAILED) {
                                                      peg$savedPos = s0;
                                                      s1 = peg$c28(s3);
                                                      s0 = s1;
                                                    } else {
                                                      peg$currPos = s0;
                                                      s0 = peg$FAILED;
                                                    }
                                                  } else {
                                                    peg$currPos = s0;
                                                    s0 = peg$FAILED;
                                                  }
                                                } else {
                                                  peg$currPos = s0;
                                                  s0 = peg$FAILED;
                                                }
                                                if (s0 === peg$FAILED) {
                                                  s0 = peg$currPos;
                                                  s1 = peg$parseopeningKey();
                                                  if (s1 !== peg$FAILED) {
                                                    s2 = peg$parsews();
                                                    if (s2 !== peg$FAILED) {
                                                      s3 = peg$parsestring();
                                                      if (s3 !== peg$FAILED) {
                                                        peg$savedPos = s0;
                                                        s1 = peg$c29(s3);
                                                        s0 = s1;
                                                      } else {
                                                        peg$currPos = s0;
                                                        s0 = peg$FAILED;
                                                      }
                                                    } else {
                                                      peg$currPos = s0;
                                                      s0 = peg$FAILED;
                                                    }
                                                  } else {
                                                    peg$currPos = s0;
                                                    s0 = peg$FAILED;
                                                  }
                                                  if (s0 === peg$FAILED) {
                                                    s0 = peg$currPos;
                                                    s1 = peg$parsevariationKey();
                                                    if (s1 !== peg$FAILED) {
                                                      s2 = peg$parsews();
                                                      if (s2 !== peg$FAILED) {
                                                        s3 = peg$parsestring();
                                                        if (s3 !== peg$FAILED) {
                                                          peg$savedPos = s0;
                                                          s1 = peg$c30(s3);
                                                          s0 = s1;
                                                        } else {
                                                          peg$currPos = s0;
                                                          s0 = peg$FAILED;
                                                        }
                                                      } else {
                                                        peg$currPos = s0;
                                                        s0 = peg$FAILED;
                                                      }
                                                    } else {
                                                      peg$currPos = s0;
                                                      s0 = peg$FAILED;
                                                    }
                                                    if (s0 === peg$FAILED) {
                                                      s0 = peg$currPos;
                                                      s1 = peg$parsesubVariationKey();
                                                      if (s1 !== peg$FAILED) {
                                                        s2 = peg$parsews();
                                                        if (s2 !== peg$FAILED) {
                                                          s3 = peg$parsestring();
                                                          if (s3 !== peg$FAILED) {
                                                            peg$savedPos = s0;
                                                            s1 = peg$c31(s3);
                                                            s0 = s1;
                                                          } else {
                                                            peg$currPos = s0;
                                                            s0 = peg$FAILED;
                                                          }
                                                        } else {
                                                          peg$currPos = s0;
                                                          s0 = peg$FAILED;
                                                        }
                                                      } else {
                                                        peg$currPos = s0;
                                                        s0 = peg$FAILED;
                                                      }
                                                      if (s0 === peg$FAILED) {
                                                        s0 = peg$currPos;
                                                        s1 = peg$parseecoKey();
                                                        if (s1 !== peg$FAILED) {
                                                          s2 = peg$parsews();
                                                          if (s2 !== peg$FAILED) {
                                                            s3 = peg$parsestring();
                                                            if (s3 !== peg$FAILED) {
                                                              peg$savedPos = s0;
                                                              s1 = peg$c32(s3);
                                                              s0 = s1;
                                                            } else {
                                                              peg$currPos = s0;
                                                              s0 = peg$FAILED;
                                                            }
                                                          } else {
                                                            peg$currPos = s0;
                                                            s0 = peg$FAILED;
                                                          }
                                                        } else {
                                                          peg$currPos = s0;
                                                          s0 = peg$FAILED;
                                                        }
                                                        if (s0 === peg$FAILED) {
                                                          s0 = peg$currPos;
                                                          s1 = peg$parsenicKey();
                                                          if (s1 !== peg$FAILED) {
                                                            s2 = peg$parsews();
                                                            if (s2 !== peg$FAILED) {
                                                              s3 = peg$parsestring();
                                                              if (s3 !== peg$FAILED) {
                                                                peg$savedPos = s0;
                                                                s1 = peg$c33(s3);
                                                                s0 = s1;
                                                              } else {
                                                                peg$currPos = s0;
                                                                s0 = peg$FAILED;
                                                              }
                                                            } else {
                                                              peg$currPos = s0;
                                                              s0 = peg$FAILED;
                                                            }
                                                          } else {
                                                            peg$currPos = s0;
                                                            s0 = peg$FAILED;
                                                          }
                                                          if (s0 === peg$FAILED) {
                                                            s0 = peg$currPos;
                                                            s1 = peg$parsetimeKey();
                                                            if (s1 !== peg$FAILED) {
                                                              s2 = peg$parsews();
                                                              if (s2 !== peg$FAILED) {
                                                                s3 = peg$parsestring();
                                                                if (s3 !== peg$FAILED) {
                                                                  peg$savedPos = s0;
                                                                  s1 = peg$c34(s3);
                                                                  s0 = s1;
                                                                } else {
                                                                  peg$currPos = s0;
                                                                  s0 = peg$FAILED;
                                                                }
                                                              } else {
                                                                peg$currPos = s0;
                                                                s0 = peg$FAILED;
                                                              }
                                                            } else {
                                                              peg$currPos = s0;
                                                              s0 = peg$FAILED;
                                                            }
                                                            if (s0 === peg$FAILED) {
                                                              s0 = peg$currPos;
                                                              s1 = peg$parseutcTimeKey();
                                                              if (s1 !== peg$FAILED) {
                                                                s2 = peg$parsews();
                                                                if (s2 !== peg$FAILED) {
                                                                  s3 = peg$parsestring();
                                                                  if (s3 !== peg$FAILED) {
                                                                    peg$savedPos = s0;
                                                                    s1 = peg$c35(s3);
                                                                    s0 = s1;
                                                                  } else {
                                                                    peg$currPos = s0;
                                                                    s0 = peg$FAILED;
                                                                  }
                                                                } else {
                                                                  peg$currPos = s0;
                                                                  s0 = peg$FAILED;
                                                                }
                                                              } else {
                                                                peg$currPos = s0;
                                                                s0 = peg$FAILED;
                                                              }
                                                              if (s0 === peg$FAILED) {
                                                                s0 = peg$currPos;
                                                                s1 = peg$parseutcDateKey();
                                                                if (s1 !== peg$FAILED) {
                                                                  s2 = peg$parsews();
                                                                  if (s2 !== peg$FAILED) {
                                                                    s3 = peg$parsestring();
                                                                    if (s3 !== peg$FAILED) {
                                                                      peg$savedPos = s0;
                                                                      s1 = peg$c36(s3);
                                                                      s0 = s1;
                                                                    } else {
                                                                      peg$currPos = s0;
                                                                      s0 = peg$FAILED;
                                                                    }
                                                                  } else {
                                                                    peg$currPos = s0;
                                                                    s0 = peg$FAILED;
                                                                  }
                                                                } else {
                                                                  peg$currPos = s0;
                                                                  s0 = peg$FAILED;
                                                                }
                                                                if (s0 === peg$FAILED) {
                                                                  s0 = peg$currPos;
                                                                  s1 = peg$parsetimeControlKey();
                                                                  if (s1 !== peg$FAILED) {
                                                                    s2 = peg$parsews();
                                                                    if (s2 !== peg$FAILED) {
                                                                      s3 = peg$parsestring();
                                                                      if (s3 !== peg$FAILED) {
                                                                        peg$savedPos = s0;
                                                                        s1 = peg$c37(s3);
                                                                        s0 = s1;
                                                                      } else {
                                                                        peg$currPos = s0;
                                                                        s0 = peg$FAILED;
                                                                      }
                                                                    } else {
                                                                      peg$currPos = s0;
                                                                      s0 = peg$FAILED;
                                                                    }
                                                                  } else {
                                                                    peg$currPos = s0;
                                                                    s0 = peg$FAILED;
                                                                  }
                                                                  if (s0 === peg$FAILED) {
                                                                    s0 = peg$currPos;
                                                                    s1 = peg$parsesetUpKey();
                                                                    if (s1 !== peg$FAILED) {
                                                                      s2 = peg$parsews();
                                                                      if (s2 !== peg$FAILED) {
                                                                        s3 = peg$parsestring();
                                                                        if (s3 !== peg$FAILED) {
                                                                          peg$savedPos = s0;
                                                                          s1 = peg$c38(s3);
                                                                          s0 = s1;
                                                                        } else {
                                                                          peg$currPos = s0;
                                                                          s0 = peg$FAILED;
                                                                        }
                                                                      } else {
                                                                        peg$currPos = s0;
                                                                        s0 = peg$FAILED;
                                                                      }
                                                                    } else {
                                                                      peg$currPos = s0;
                                                                      s0 = peg$FAILED;
                                                                    }
                                                                    if (s0 === peg$FAILED) {
                                                                      s0 = peg$currPos;
                                                                      s1 = peg$parsefenKey();
                                                                      if (s1 !== peg$FAILED) {
                                                                        s2 = peg$parsews();
                                                                        if (s2 !== peg$FAILED) {
                                                                          s3 = peg$parsestring();
                                                                          if (s3 !== peg$FAILED) {
                                                                            peg$savedPos = s0;
                                                                            s1 = peg$c39(s3);
                                                                            s0 = s1;
                                                                          } else {
                                                                            peg$currPos = s0;
                                                                            s0 = peg$FAILED;
                                                                          }
                                                                        } else {
                                                                          peg$currPos = s0;
                                                                          s0 = peg$FAILED;
                                                                        }
                                                                      } else {
                                                                        peg$currPos = s0;
                                                                        s0 = peg$FAILED;
                                                                      }
                                                                      if (s0 === peg$FAILED) {
                                                                        s0 = peg$currPos;
                                                                        s1 = peg$parseterminationKey();
                                                                        if (s1 !== peg$FAILED) {
                                                                          s2 = peg$parsews();
                                                                          if (s2 !== peg$FAILED) {
                                                                            s3 = peg$parsestring();
                                                                            if (s3 !== peg$FAILED) {
                                                                              peg$savedPos = s0;
                                                                              s1 = peg$c40(s3);
                                                                              s0 = s1;
                                                                            } else {
                                                                              peg$currPos = s0;
                                                                              s0 = peg$FAILED;
                                                                            }
                                                                          } else {
                                                                            peg$currPos = s0;
                                                                            s0 = peg$FAILED;
                                                                          }
                                                                        } else {
                                                                          peg$currPos = s0;
                                                                          s0 = peg$FAILED;
                                                                        }
                                                                        if (s0 === peg$FAILED) {
                                                                          s0 = peg$currPos;
                                                                          s1 = peg$parseanotatorKey();
                                                                          if (s1 !== peg$FAILED) {
                                                                            s2 = peg$parsews();
                                                                            if (s2 !== peg$FAILED) {
                                                                              s3 = peg$parsestring();
                                                                              if (s3 !== peg$FAILED) {
                                                                                peg$savedPos = s0;
                                                                                s1 = peg$c41(s3);
                                                                                s0 = s1;
                                                                              } else {
                                                                                peg$currPos = s0;
                                                                                s0 = peg$FAILED;
                                                                              }
                                                                            } else {
                                                                              peg$currPos = s0;
                                                                              s0 = peg$FAILED;
                                                                            }
                                                                          } else {
                                                                            peg$currPos = s0;
                                                                            s0 = peg$FAILED;
                                                                          }
                                                                          if (s0 === peg$FAILED) {
                                                                            s0 = peg$currPos;
                                                                            s1 = peg$parsemodeKey();
                                                                            if (s1 !== peg$FAILED) {
                                                                              s2 = peg$parsews();
                                                                              if (s2 !== peg$FAILED) {
                                                                                s3 = peg$parsestring();
                                                                                if (s3 !== peg$FAILED) {
                                                                                  peg$savedPos = s0;
                                                                                  s1 = peg$c42(s3);
                                                                                  s0 = s1;
                                                                                } else {
                                                                                  peg$currPos = s0;
                                                                                  s0 = peg$FAILED;
                                                                                }
                                                                              } else {
                                                                                peg$currPos = s0;
                                                                                s0 = peg$FAILED;
                                                                              }
                                                                            } else {
                                                                              peg$currPos = s0;
                                                                              s0 = peg$FAILED;
                                                                            }
                                                                            if (s0 === peg$FAILED) {
                                                                              s0 = peg$currPos;
                                                                              s1 = peg$parseplyCountKey();
                                                                              if (s1 !== peg$FAILED) {
                                                                                s2 = peg$parsews();
                                                                                if (s2 !== peg$FAILED) {
                                                                                  s3 = peg$parseintegerString();
                                                                                  if (s3 !== peg$FAILED) {
                                                                                    peg$savedPos = s0;
                                                                                    s1 = peg$c43(s3);
                                                                                    s0 = s1;
                                                                                  } else {
                                                                                    peg$currPos = s0;
                                                                                    s0 = peg$FAILED;
                                                                                  }
                                                                                } else {
                                                                                  peg$currPos = s0;
                                                                                  s0 = peg$FAILED;
                                                                                }
                                                                              } else {
                                                                                peg$currPos = s0;
                                                                                s0 = peg$FAILED;
                                                                              }
                                                                              if (s0 === peg$FAILED) {
                                                                                s0 = peg$currPos;
                                                                                s1 = peg$parsestringNoQuot();
                                                                                if (s1 !== peg$FAILED) {
                                                                                  s2 = peg$parsews();
                                                                                  if (s2 !== peg$FAILED) {
                                                                                    s3 = peg$parsestring();
                                                                                    if (s3 !== peg$FAILED) {
                                                                                      peg$savedPos = s0;
                                                                                      s1 = peg$c44(s1, s3);
                                                                                      s0 = s1;
                                                                                    } else {
                                                                                      peg$currPos = s0;
                                                                                      s0 = peg$FAILED;
                                                                                    }
                                                                                  } else {
                                                                                    peg$currPos = s0;
                                                                                    s0 = peg$FAILED;
                                                                                  }
                                                                                } else {
                                                                                  peg$currPos = s0;
                                                                                  s0 = peg$FAILED;
                                                                                }
                                                                              }
                                                                            }
                                                                          }
                                                                        }
                                                                      }
                                                                    }
                                                                  }
                                                                }
                                                              }
                                                            }
                                                          }
                                                        }
                                                      }
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseeventKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c45) {
        s0 = peg$c45;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c46); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c47) {
          s0 = peg$c47;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c48); }
        }
      }
  
      return s0;
    }
  
    function peg$parsesiteKey() {
      var s0;
  
      if (input.substr(peg$currPos, 4) === peg$c49) {
        s0 = peg$c49;
        peg$currPos += 4;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c50); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 4) === peg$c51) {
          s0 = peg$c51;
          peg$currPos += 4;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c52); }
        }
      }
  
      return s0;
    }
  
    function peg$parsedateKey() {
      var s0;
  
      if (input.substr(peg$currPos, 4) === peg$c53) {
        s0 = peg$c53;
        peg$currPos += 4;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c54); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 4) === peg$c55) {
          s0 = peg$c55;
          peg$currPos += 4;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c56); }
        }
      }
  
      return s0;
    }
  
    function peg$parseroundKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c57) {
        s0 = peg$c57;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c58); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c59) {
          s0 = peg$c59;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c60); }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c61) {
        s0 = peg$c61;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c62); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c61) {
          s0 = peg$c61;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c62); }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c63) {
        s0 = peg$c63;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c64); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c65) {
          s0 = peg$c65;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c66); }
        }
      }
  
      return s0;
    }
  
    function peg$parseresultKey() {
      var s0;
  
      if (input.substr(peg$currPos, 6) === peg$c67) {
        s0 = peg$c67;
        peg$currPos += 6;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c68); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 6) === peg$c69) {
          s0 = peg$c69;
          peg$currPos += 6;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c70); }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteTitleKey() {
      var s0;
  
      if (input.substr(peg$currPos, 10) === peg$c71) {
        s0 = peg$c71;
        peg$currPos += 10;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c72); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 10) === peg$c73) {
          s0 = peg$c73;
          peg$currPos += 10;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c74); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 10) === peg$c75) {
            s0 = peg$c75;
            peg$currPos += 10;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c76); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackTitleKey() {
      var s0;
  
      if (input.substr(peg$currPos, 10) === peg$c77) {
        s0 = peg$c77;
        peg$currPos += 10;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c78); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 10) === peg$c79) {
          s0 = peg$c79;
          peg$currPos += 10;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c80); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 10) === peg$c81) {
            s0 = peg$c81;
            peg$currPos += 10;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c82); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteEloKey() {
      var s0;
  
      if (input.substr(peg$currPos, 8) === peg$c83) {
        s0 = peg$c83;
        peg$currPos += 8;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c84); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 8) === peg$c85) {
          s0 = peg$c85;
          peg$currPos += 8;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c86); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 8) === peg$c87) {
            s0 = peg$c87;
            peg$currPos += 8;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c88); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 8) === peg$c89) {
              s0 = peg$c89;
              peg$currPos += 8;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c90); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackEloKey() {
      var s0;
  
      if (input.substr(peg$currPos, 8) === peg$c91) {
        s0 = peg$c91;
        peg$currPos += 8;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c92); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 8) === peg$c93) {
          s0 = peg$c93;
          peg$currPos += 8;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c94); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 8) === peg$c95) {
            s0 = peg$c95;
            peg$currPos += 8;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c96); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 8) === peg$c97) {
              s0 = peg$c97;
              peg$currPos += 8;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c98); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteUSCFKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c99) {
        s0 = peg$c99;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c100); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c101) {
          s0 = peg$c101;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c102); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 9) === peg$c103) {
            s0 = peg$c103;
            peg$currPos += 9;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c104); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 9) === peg$c105) {
              s0 = peg$c105;
              peg$currPos += 9;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c106); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackUSCFKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c107) {
        s0 = peg$c107;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c108); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c109) {
          s0 = peg$c109;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c110); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 9) === peg$c111) {
            s0 = peg$c111;
            peg$currPos += 9;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c112); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 9) === peg$c113) {
              s0 = peg$c113;
              peg$currPos += 9;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c114); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteNAKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c115) {
        s0 = peg$c115;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c116); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c117) {
          s0 = peg$c117;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c118); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 7) === peg$c119) {
            s0 = peg$c119;
            peg$currPos += 7;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c120); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 7) === peg$c121) {
              s0 = peg$c121;
              peg$currPos += 7;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c122); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackNAKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c123) {
        s0 = peg$c123;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c124); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c125) {
          s0 = peg$c125;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c126); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 7) === peg$c127) {
            s0 = peg$c127;
            peg$currPos += 7;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c128); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 7) === peg$c129) {
              s0 = peg$c129;
              peg$currPos += 7;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c130); }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsewhiteTypeKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c131) {
        s0 = peg$c131;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c132); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c133) {
          s0 = peg$c133;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c134); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 9) === peg$c135) {
            s0 = peg$c135;
            peg$currPos += 9;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c136); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseblackTypeKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c137) {
        s0 = peg$c137;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c138); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c139) {
          s0 = peg$c139;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c140); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 9) === peg$c141) {
            s0 = peg$c141;
            peg$currPos += 9;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c142); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseeventDateKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c143) {
        s0 = peg$c143;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c144); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c145) {
          s0 = peg$c145;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c146); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 9) === peg$c147) {
            s0 = peg$c147;
            peg$currPos += 9;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c148); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseeventSponsorKey() {
      var s0;
  
      if (input.substr(peg$currPos, 12) === peg$c149) {
        s0 = peg$c149;
        peg$currPos += 12;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c150); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 12) === peg$c151) {
          s0 = peg$c151;
          peg$currPos += 12;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c152); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 12) === peg$c153) {
            s0 = peg$c153;
            peg$currPos += 12;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c154); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsesectionKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c155) {
        s0 = peg$c155;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c156); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c157) {
          s0 = peg$c157;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c158); }
        }
      }
  
      return s0;
    }
  
    function peg$parsestageKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c159) {
        s0 = peg$c159;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c160); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c161) {
          s0 = peg$c161;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c162); }
        }
      }
  
      return s0;
    }
  
    function peg$parseboardKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c163) {
        s0 = peg$c163;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c164); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c165) {
          s0 = peg$c165;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c166); }
        }
      }
  
      return s0;
    }
  
    function peg$parseopeningKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c167) {
        s0 = peg$c167;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c168); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c169) {
          s0 = peg$c169;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c170); }
        }
      }
  
      return s0;
    }
  
    function peg$parsevariationKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c171) {
        s0 = peg$c171;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c172); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c173) {
          s0 = peg$c173;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c174); }
        }
      }
  
      return s0;
    }
  
    function peg$parsesubVariationKey() {
      var s0;
  
      if (input.substr(peg$currPos, 12) === peg$c175) {
        s0 = peg$c175;
        peg$currPos += 12;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c176); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 12) === peg$c177) {
          s0 = peg$c177;
          peg$currPos += 12;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c178); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 12) === peg$c179) {
            s0 = peg$c179;
            peg$currPos += 12;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c180); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseecoKey() {
      var s0;
  
      if (input.substr(peg$currPos, 3) === peg$c181) {
        s0 = peg$c181;
        peg$currPos += 3;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c182); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 3) === peg$c183) {
          s0 = peg$c183;
          peg$currPos += 3;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c184); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 3) === peg$c185) {
            s0 = peg$c185;
            peg$currPos += 3;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c186); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsenicKey() {
      var s0;
  
      if (input.substr(peg$currPos, 3) === peg$c187) {
        s0 = peg$c187;
        peg$currPos += 3;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c188); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 3) === peg$c189) {
          s0 = peg$c189;
          peg$currPos += 3;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c190); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 3) === peg$c191) {
            s0 = peg$c191;
            peg$currPos += 3;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c192); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsetimeKey() {
      var s0;
  
      if (input.substr(peg$currPos, 4) === peg$c193) {
        s0 = peg$c193;
        peg$currPos += 4;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c194); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 4) === peg$c195) {
          s0 = peg$c195;
          peg$currPos += 4;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c196); }
        }
      }
  
      return s0;
    }
  
    function peg$parseutcTimeKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c197) {
        s0 = peg$c197;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c198); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c199) {
          s0 = peg$c199;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c200); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 7) === peg$c201) {
            s0 = peg$c201;
            peg$currPos += 7;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c202); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 7) === peg$c203) {
              s0 = peg$c203;
              peg$currPos += 7;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c204); }
            }
            if (s0 === peg$FAILED) {
              if (input.substr(peg$currPos, 7) === peg$c205) {
                s0 = peg$c205;
                peg$currPos += 7;
              } else {
                s0 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c206); }
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseutcDateKey() {
      var s0;
  
      if (input.substr(peg$currPos, 7) === peg$c207) {
        s0 = peg$c207;
        peg$currPos += 7;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c208); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 7) === peg$c209) {
          s0 = peg$c209;
          peg$currPos += 7;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c210); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 7) === peg$c211) {
            s0 = peg$c211;
            peg$currPos += 7;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c212); }
          }
          if (s0 === peg$FAILED) {
            if (input.substr(peg$currPos, 7) === peg$c213) {
              s0 = peg$c213;
              peg$currPos += 7;
            } else {
              s0 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c214); }
            }
            if (s0 === peg$FAILED) {
              if (input.substr(peg$currPos, 7) === peg$c215) {
                s0 = peg$c215;
                peg$currPos += 7;
              } else {
                s0 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c216); }
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsetimeControlKey() {
      var s0;
  
      if (input.substr(peg$currPos, 11) === peg$c217) {
        s0 = peg$c217;
        peg$currPos += 11;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c218); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 11) === peg$c219) {
          s0 = peg$c219;
          peg$currPos += 11;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c220); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 11) === peg$c221) {
            s0 = peg$c221;
            peg$currPos += 11;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c222); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsesetUpKey() {
      var s0;
  
      if (input.substr(peg$currPos, 5) === peg$c223) {
        s0 = peg$c223;
        peg$currPos += 5;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c224); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 5) === peg$c225) {
          s0 = peg$c225;
          peg$currPos += 5;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c226); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 5) === peg$c227) {
            s0 = peg$c227;
            peg$currPos += 5;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c228); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsefenKey() {
      var s0;
  
      if (input.substr(peg$currPos, 3) === peg$c229) {
        s0 = peg$c229;
        peg$currPos += 3;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c230); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 3) === peg$c231) {
          s0 = peg$c231;
          peg$currPos += 3;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c232); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 3) === peg$c233) {
            s0 = peg$c233;
            peg$currPos += 3;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c234); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseterminationKey() {
      var s0;
  
      if (input.substr(peg$currPos, 11) === peg$c235) {
        s0 = peg$c235;
        peg$currPos += 11;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c236); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 11) === peg$c237) {
          s0 = peg$c237;
          peg$currPos += 11;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c238); }
        }
      }
  
      return s0;
    }
  
    function peg$parseanotatorKey() {
      var s0;
  
      if (input.substr(peg$currPos, 9) === peg$c239) {
        s0 = peg$c239;
        peg$currPos += 9;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c240); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 9) === peg$c241) {
          s0 = peg$c241;
          peg$currPos += 9;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c242); }
        }
      }
  
      return s0;
    }
  
    function peg$parsemodeKey() {
      var s0;
  
      if (input.substr(peg$currPos, 4) === peg$c243) {
        s0 = peg$c243;
        peg$currPos += 4;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c244); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 4) === peg$c245) {
          s0 = peg$c245;
          peg$currPos += 4;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c246); }
        }
      }
  
      return s0;
    }
  
    function peg$parseplyCountKey() {
      var s0;
  
      if (input.substr(peg$currPos, 8) === peg$c247) {
        s0 = peg$c247;
        peg$currPos += 8;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c248); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 8) === peg$c249) {
          s0 = peg$c249;
          peg$currPos += 8;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c250); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 8) === peg$c251) {
            s0 = peg$c251;
            peg$currPos += 8;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c252); }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsews() {
      var s0, s1;
  
      peg$silentFails++;
      s0 = [];
      if (peg$c254.test(input.charAt(peg$currPos))) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c255); }
      }
      while (s1 !== peg$FAILED) {
        s0.push(s1);
        if (peg$c254.test(input.charAt(peg$currPos))) {
          s1 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c255); }
        }
      }
      peg$silentFails--;
      if (s0 === peg$FAILED) {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c253); }
      }
  
      return s0;
    }
  
    function peg$parsewsp() {
      var s0, s1;
  
      s0 = [];
      if (peg$c254.test(input.charAt(peg$currPos))) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c255); }
      }
      if (s1 !== peg$FAILED) {
        while (s1 !== peg$FAILED) {
          s0.push(s1);
          if (peg$c254.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c255); }
          }
        }
      } else {
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsestring() {
      var s0, s1, s2, s3;
  
      peg$silentFails++;
      s0 = peg$currPos;
      s1 = peg$parsequotation_mark();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$parsechar();
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$parsechar();
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsequotation_mark();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c257(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      peg$silentFails--;
      if (s0 === peg$FAILED) {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c256); }
      }
  
      return s0;
    }
  
    function peg$parsestringNoQuot() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = [];
      if (peg$c258.test(input.charAt(peg$currPos))) {
        s2 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c259); }
      }
      while (s2 !== peg$FAILED) {
        s1.push(s2);
        if (peg$c258.test(input.charAt(peg$currPos))) {
          s2 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c259); }
        }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c257(s1);
      }
      s0 = s1;
  
      return s0;
    }
  
    function peg$parsequotation_mark() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 34) {
        s0 = peg$c260;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c261); }
      }
  
      return s0;
    }
  
    function peg$parsechar() {
      var s0;
  
      if (peg$c262.test(input.charAt(peg$currPos))) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c263); }
      }
  
      return s0;
    }
  
    function peg$parsedate() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8;
  
      s0 = peg$currPos;
      s1 = peg$parsequotation_mark();
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        if (peg$c264.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c265); }
        }
        if (s3 !== peg$FAILED) {
          if (peg$c264.test(input.charAt(peg$currPos))) {
            s4 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c265); }
          }
          if (s4 !== peg$FAILED) {
            if (peg$c264.test(input.charAt(peg$currPos))) {
              s5 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c265); }
            }
            if (s5 !== peg$FAILED) {
              if (peg$c264.test(input.charAt(peg$currPos))) {
                s6 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s6 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c265); }
              }
              if (s6 !== peg$FAILED) {
                s3 = [s3, s4, s5, s6];
                s2 = s3;
              } else {
                peg$currPos = s2;
                s2 = peg$FAILED;
              }
            } else {
              peg$currPos = s2;
              s2 = peg$FAILED;
            }
          } else {
            peg$currPos = s2;
            s2 = peg$FAILED;
          }
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 46) {
            s3 = peg$c266;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c267); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$currPos;
            if (peg$c264.test(input.charAt(peg$currPos))) {
              s5 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c265); }
            }
            if (s5 !== peg$FAILED) {
              if (peg$c264.test(input.charAt(peg$currPos))) {
                s6 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s6 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c265); }
              }
              if (s6 !== peg$FAILED) {
                s5 = [s5, s6];
                s4 = s5;
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 46) {
                s5 = peg$c266;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c267); }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$currPos;
                if (peg$c264.test(input.charAt(peg$currPos))) {
                  s7 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s7 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c265); }
                }
                if (s7 !== peg$FAILED) {
                  if (peg$c264.test(input.charAt(peg$currPos))) {
                    s8 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s8 = peg$FAILED;
                    if (peg$silentFails === 0) { peg$fail(peg$c265); }
                  }
                  if (s8 !== peg$FAILED) {
                    s7 = [s7, s8];
                    s6 = s7;
                  } else {
                    peg$currPos = s6;
                    s6 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s6;
                  s6 = peg$FAILED;
                }
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsequotation_mark();
                  if (s7 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c268(s2, s4, s6);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parseresult() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parsequotation_mark();
      if (s1 !== peg$FAILED) {
        s2 = peg$parseinner_result();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsequotation_mark();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c269(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parseinner_result() {
      var s0, s1;
  
      s0 = peg$currPos;
      if (input.substr(peg$currPos, 3) === peg$c270) {
        s1 = peg$c270;
        peg$currPos += 3;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c271); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c272(s1);
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 3) === peg$c273) {
          s1 = peg$c273;
          peg$currPos += 3;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c274); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c269(s1);
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 3) === peg$c275) {
            s1 = peg$c275;
            peg$currPos += 3;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c276); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c269(s1);
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 3) === peg$c277) {
              s1 = peg$c277;
              peg$currPos += 3;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c278); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c269(s1);
            }
            s0 = s1;
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.substr(peg$currPos, 7) === peg$c279) {
                s1 = peg$c279;
                peg$currPos += 7;
              } else {
                s1 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c280); }
              }
              if (s1 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c269(s1);
              }
              s0 = s1;
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 42) {
                  s1 = peg$c281;
                  peg$currPos++;
                } else {
                  s1 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c282); }
                }
                if (s1 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c269(s1);
                }
                s0 = s1;
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseintegerOrDash() {
      var s0, s1, s2, s3;
  
      s0 = peg$parseintegerString();
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parsequotation_mark();
        if (s1 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 45) {
            s2 = peg$c283;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c284); }
          }
          if (s2 !== peg$FAILED) {
            s3 = peg$parsequotation_mark();
            if (s3 !== peg$FAILED) {
              s1 = [s1, s2, s3];
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      }
  
      return s0;
    }
  
    function peg$parseintegerString() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parsequotation_mark();
      if (s1 !== peg$FAILED) {
        s2 = [];
        if (peg$c285.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c286); }
        }
        if (s3 !== peg$FAILED) {
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c285.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c286); }
            }
          }
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsequotation_mark();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c287(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsepgn() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = peg$parsepgnStartWhite();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsepgnBlack();
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c288(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parsepgnStartBlack();
        if (s1 !== peg$FAILED) {
          s2 = peg$parsepgnWhite();
          if (s2 === peg$FAILED) {
            s2 = null;
          }
          if (s2 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c289(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parsews();
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c290();
          }
          s0 = s1;
        }
      }
  
      return s0;
    }
  
    function peg$parsepgnStartWhite() {
      var s0, s1;
  
      s0 = peg$currPos;
      s1 = peg$parsepgnWhite();
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c291(s1);
      }
      s0 = s1;
  
      return s0;
    }
  
    function peg$parsepgnStartBlack() {
      var s0, s1;
  
      s0 = peg$currPos;
      s1 = peg$parsepgnBlack();
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c292(s1);
      }
      s0 = s1;
  
      return s0;
    }
  
    function peg$parsepgnWhite() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
  
      s0 = peg$currPos;
      s1 = peg$parsews();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsecomments();
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsews();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsemoveNumber();
            if (s4 === peg$FAILED) {
              s4 = null;
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parsews();
              if (s5 !== peg$FAILED) {
                s6 = peg$parsecomments();
                if (s6 === peg$FAILED) {
                  s6 = null;
                }
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsews();
                  if (s7 !== peg$FAILED) {
                    s8 = peg$parsehalfMove();
                    if (s8 !== peg$FAILED) {
                      s9 = peg$parsews();
                      if (s9 !== peg$FAILED) {
                        s10 = peg$parsenags();
                        if (s10 === peg$FAILED) {
                          s10 = null;
                        }
                        if (s10 !== peg$FAILED) {
                          s11 = peg$parsews();
                          if (s11 !== peg$FAILED) {
                            s12 = peg$parsecomments();
                            if (s12 === peg$FAILED) {
                              s12 = null;
                            }
                            if (s12 !== peg$FAILED) {
                              s13 = peg$parsews();
                              if (s13 !== peg$FAILED) {
                                s14 = peg$parsecommentDiag();
                                if (s14 === peg$FAILED) {
                                  s14 = null;
                                }
                                if (s14 !== peg$FAILED) {
                                  s15 = peg$parsews();
                                  if (s15 !== peg$FAILED) {
                                    s16 = peg$parsevariationWhite();
                                    if (s16 === peg$FAILED) {
                                      s16 = null;
                                    }
                                    if (s16 !== peg$FAILED) {
                                      s17 = peg$parsepgnBlack();
                                      if (s17 === peg$FAILED) {
                                        s17 = null;
                                      }
                                      if (s17 !== peg$FAILED) {
                                        peg$savedPos = s0;
                                        s1 = peg$c293(s2, s4, s6, s8, s10, s12, s14, s16, s17);
                                        s0 = s1;
                                      } else {
                                        peg$currPos = s0;
                                        s0 = peg$FAILED;
                                      }
                                    } else {
                                      peg$currPos = s0;
                                      s0 = peg$FAILED;
                                    }
                                  } else {
                                    peg$currPos = s0;
                                    s0 = peg$FAILED;
                                  }
                                } else {
                                  peg$currPos = s0;
                                  s0 = peg$FAILED;
                                }
                              } else {
                                peg$currPos = s0;
                                s0 = peg$FAILED;
                              }
                            } else {
                              peg$currPos = s0;
                              s0 = peg$FAILED;
                            }
                          } else {
                            peg$currPos = s0;
                            s0 = peg$FAILED;
                          }
                        } else {
                          peg$currPos = s0;
                          s0 = peg$FAILED;
                        }
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$parseendGame();
      }
  
      return s0;
    }
  
    function peg$parsepgnBlack() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
  
      s0 = peg$currPos;
      s1 = peg$parsews();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsecomments();
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsews();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsemoveNumber();
            if (s4 === peg$FAILED) {
              s4 = null;
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parsews();
              if (s5 !== peg$FAILED) {
                s6 = peg$parsecomments();
                if (s6 === peg$FAILED) {
                  s6 = null;
                }
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsews();
                  if (s7 !== peg$FAILED) {
                    s8 = peg$parsehalfMove();
                    if (s8 !== peg$FAILED) {
                      s9 = peg$parsews();
                      if (s9 !== peg$FAILED) {
                        s10 = peg$parsenags();
                        if (s10 === peg$FAILED) {
                          s10 = null;
                        }
                        if (s10 !== peg$FAILED) {
                          s11 = peg$parsews();
                          if (s11 !== peg$FAILED) {
                            s12 = peg$parsecomments();
                            if (s12 === peg$FAILED) {
                              s12 = null;
                            }
                            if (s12 !== peg$FAILED) {
                              s13 = peg$parsews();
                              if (s13 !== peg$FAILED) {
                                s14 = peg$parsecommentDiag();
                                if (s14 === peg$FAILED) {
                                  s14 = null;
                                }
                                if (s14 !== peg$FAILED) {
                                  s15 = peg$parsews();
                                  if (s15 !== peg$FAILED) {
                                    s16 = peg$parsevariationBlack();
                                    if (s16 === peg$FAILED) {
                                      s16 = null;
                                    }
                                    if (s16 !== peg$FAILED) {
                                      s17 = peg$parsepgnWhite();
                                      if (s17 === peg$FAILED) {
                                        s17 = null;
                                      }
                                      if (s17 !== peg$FAILED) {
                                        peg$savedPos = s0;
                                        s1 = peg$c294(s2, s4, s6, s8, s10, s12, s14, s16, s17);
                                        s0 = s1;
                                      } else {
                                        peg$currPos = s0;
                                        s0 = peg$FAILED;
                                      }
                                    } else {
                                      peg$currPos = s0;
                                      s0 = peg$FAILED;
                                    }
                                  } else {
                                    peg$currPos = s0;
                                    s0 = peg$FAILED;
                                  }
                                } else {
                                  peg$currPos = s0;
                                  s0 = peg$FAILED;
                                }
                              } else {
                                peg$currPos = s0;
                                s0 = peg$FAILED;
                              }
                            } else {
                              peg$currPos = s0;
                              s0 = peg$FAILED;
                            }
                          } else {
                            peg$currPos = s0;
                            s0 = peg$FAILED;
                          }
                        } else {
                          peg$currPos = s0;
                          s0 = peg$FAILED;
                        }
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$parseendGame();
      }
  
      return s0;
    }
  
    function peg$parseendGame() {
      var s0, s1;
  
      s0 = peg$currPos;
      if (input.substr(peg$currPos, 3) === peg$c273) {
        s1 = peg$c273;
        peg$currPos += 3;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c274); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c295();
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 3) === peg$c277) {
          s1 = peg$c277;
          peg$currPos += 3;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c278); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c296();
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 3) === peg$c270) {
            s1 = peg$c270;
            peg$currPos += 3;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c271); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c297();
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 3) === peg$c275) {
              s1 = peg$c275;
              peg$currPos += 3;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c276); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c298();
            }
            s0 = s1;
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.substr(peg$currPos, 7) === peg$c279) {
                s1 = peg$c279;
                peg$currPos += 7;
              } else {
                s1 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c280); }
              }
              if (s1 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c299();
              }
              s0 = s1;
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 42) {
                  s1 = peg$c281;
                  peg$currPos++;
                } else {
                  s1 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c282); }
                }
                if (s1 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c300();
                }
                s0 = s1;
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsecomments() {
      var s0, s1, s2, s3, s4, s5;
  
      s0 = peg$currPos;
      s1 = peg$parsecomment();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$currPos;
        s4 = peg$parsews();
        if (s4 !== peg$FAILED) {
          s5 = peg$parsecomment();
          if (s5 !== peg$FAILED) {
            s4 = [s4, s5];
            s3 = s4;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$currPos;
          s4 = peg$parsews();
          if (s4 !== peg$FAILED) {
            s5 = peg$parsecomment();
            if (s5 !== peg$FAILED) {
              s4 = [s4, s5];
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c301(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecomment() {
      var s0, s1, s2, s3, s4;
  
      s0 = peg$currPos;
      s1 = peg$currPos;
      peg$silentFails++;
      s2 = peg$parsecommentDiag();
      peg$silentFails--;
      if (s2 === peg$FAILED) {
        s1 = void 0;
      } else {
        peg$currPos = s1;
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parsecl();
        if (s2 !== peg$FAILED) {
          s3 = [];
          if (peg$c302.test(input.charAt(peg$currPos))) {
            s4 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c303); }
          }
          if (s4 !== peg$FAILED) {
            while (s4 !== peg$FAILED) {
              s3.push(s4);
              if (peg$c302.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c303); }
              }
            }
          } else {
            s3 = peg$FAILED;
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parsecr();
            if (s4 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c304(s3);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecommentDiag() {
      var s0, s1, s2, s3, s4, s5;
  
      s0 = peg$currPos;
      s1 = peg$parsecl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsecommentAnnotations();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsews();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsecr();
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c305(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecommentAnnotations() {
      var s0, s1, s2, s3, s4;
  
      s0 = peg$currPos;
      s1 = peg$parsecommentAnnotation();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = [];
          s4 = peg$parsecommentAnnotation();
          while (s4 !== peg$FAILED) {
            s3.push(s4);
            s4 = peg$parsecommentAnnotation();
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c306(s1, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecommentAnnotation() {
      var s0, s1;
  
      s0 = peg$currPos;
      s1 = peg$parsecommentAnnotationFields();
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c307(s1);
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parsecommentAnnotationArrows();
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c308(s1);
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parsecommentAnnotationClock();
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c309(s1);
          }
          s0 = s1;
        }
      }
  
      return s0;
    }
  
    function peg$parsecommentAnnotationFields() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsebl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          if (input.substr(peg$currPos, 4) === peg$c310) {
            s3 = peg$c310;
            peg$currPos += 4;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c311); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parsewhiteSpace();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsecolorFields();
              if (s5 !== peg$FAILED) {
                s6 = peg$parsews();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsebr();
                  if (s7 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c312(s5);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecommentAnnotationArrows() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsebl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          if (input.substr(peg$currPos, 4) === peg$c313) {
            s3 = peg$c313;
            peg$currPos += 4;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c314); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parsewhiteSpace();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsecolorArrows();
              if (s5 !== peg$FAILED) {
                s6 = peg$parsews();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsebr();
                  if (s7 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c312(s5);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecolorFields() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsecolorField();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = [];
          s4 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 44) {
            s5 = peg$c315;
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c316); }
          }
          if (s5 !== peg$FAILED) {
            s6 = peg$parsews();
            if (s6 !== peg$FAILED) {
              s7 = peg$parsecolorField();
              if (s7 !== peg$FAILED) {
                s5 = [s5, s6, s7];
                s4 = s5;
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          } else {
            peg$currPos = s4;
            s4 = peg$FAILED;
          }
          while (s4 !== peg$FAILED) {
            s3.push(s4);
            s4 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c315;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c316); }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parsews();
              if (s6 !== peg$FAILED) {
                s7 = peg$parsecolorField();
                if (s7 !== peg$FAILED) {
                  s5 = [s5, s6, s7];
                  s4 = s5;
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c317(s1, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecolorField() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = peg$parsecolor();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsefield();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c318(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecolorArrows() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsecolorArrow();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = [];
          s4 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 44) {
            s5 = peg$c315;
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c316); }
          }
          if (s5 !== peg$FAILED) {
            s6 = peg$parsews();
            if (s6 !== peg$FAILED) {
              s7 = peg$parsecolorArrow();
              if (s7 !== peg$FAILED) {
                s5 = [s5, s6, s7];
                s4 = s5;
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          } else {
            peg$currPos = s4;
            s4 = peg$FAILED;
          }
          while (s4 !== peg$FAILED) {
            s3.push(s4);
            s4 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c315;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c316); }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parsews();
              if (s6 !== peg$FAILED) {
                s7 = peg$parsecolorArrow();
                if (s7 !== peg$FAILED) {
                  s5 = [s5, s6, s7];
                  s4 = s5;
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c317(s1, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecolorArrow() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parsecolor();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsefield();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsefield();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c319(s1, s2, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecolor() {
      var s0, s1;
  
      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 89) {
        s1 = peg$c320;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c321); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c322();
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 71) {
          s1 = peg$c323;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c324); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c325();
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 82) {
            s1 = peg$c326;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c327); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c328();
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 66) {
              s1 = peg$c329;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c330); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c331();
            }
            s0 = s1;
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsefield() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = peg$parsecolumn();
      if (s1 !== peg$FAILED) {
        s2 = peg$parserow();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c332(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsecl() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 123) {
        s0 = peg$c333;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c334); }
      }
  
      return s0;
    }
  
    function peg$parsecr() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 125) {
        s0 = peg$c335;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c336); }
      }
  
      return s0;
    }
  
    function peg$parsebl() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 91) {
        s0 = peg$c337;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c338); }
      }
  
      return s0;
    }
  
    function peg$parsebr() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 93) {
        s0 = peg$c339;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c340); }
      }
  
      return s0;
    }
  
    function peg$parsecommentAnnotationClock() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8;
  
      s0 = peg$currPos;
      s1 = peg$parsebl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 37) {
            s3 = peg$c341;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c342); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parseclockCommand();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsewhiteSpace();
              if (s5 !== peg$FAILED) {
                s6 = peg$parseclockValue();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsews();
                  if (s7 !== peg$FAILED) {
                    s8 = peg$parsebr();
                    if (s8 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c343(s4, s6);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parseclockCommand() {
      var s0, s1;
  
      s0 = peg$currPos;
      if (input.substr(peg$currPos, 3) === peg$c344) {
        s1 = peg$c344;
        peg$currPos += 3;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c345); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c346();
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 3) === peg$c347) {
          s1 = peg$c347;
          peg$currPos += 3;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c348); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c349();
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 3) === peg$c350) {
            s1 = peg$c350;
            peg$currPos += 3;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c351); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c352();
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 3) === peg$c353) {
              s1 = peg$c353;
              peg$currPos += 3;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c354); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c355();
            }
            s0 = s1;
          }
        }
      }
  
      return s0;
    }
  
    function peg$parseclockValue() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8;
  
      s0 = peg$currPos;
      s1 = peg$parsedigit();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsedigit();
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 58) {
            s3 = peg$c356;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c357); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parsedigit();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsedigit();
              if (s5 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 58) {
                  s6 = peg$c356;
                  peg$currPos++;
                } else {
                  s6 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c357); }
                }
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsedigit();
                  if (s7 !== peg$FAILED) {
                    s8 = peg$parsedigit();
                    if (s8 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c358(s1, s2, s4, s5, s7, s8);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsedigit() {
      var s0, s1;
  
      s0 = peg$currPos;
      if (peg$c285.test(input.charAt(peg$currPos))) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c286); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c359(s1);
      }
      s0 = s1;
  
      return s0;
    }
  
    function peg$parsevariationWhite() {
      var s0, s1, s2, s3, s4, s5, s6, s7;
  
      s0 = peg$currPos;
      s1 = peg$parsepl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsepgnWhite();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsepr();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsews();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsevariationWhite();
              if (s5 === peg$FAILED) {
                s5 = null;
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parsews();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsemoveNumber();
                  if (s7 === peg$FAILED) {
                    s7 = null;
                  }
                  if (s7 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c360(s2, s5, s7);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsevariationBlack() {
      var s0, s1, s2, s3, s4, s5;
  
      s0 = peg$currPos;
      s1 = peg$parsepl();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsepgnStartBlack();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsepr();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsews();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsevariationBlack();
              if (s5 === peg$FAILED) {
                s5 = null;
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c361(s2, s5);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsepl() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 40) {
        s0 = peg$c362;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c363); }
      }
  
      return s0;
    }
  
    function peg$parsepr() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 41) {
        s0 = peg$c364;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c365); }
      }
  
      return s0;
    }
  
    function peg$parsemoveNumber() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parseinteger();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$parsedotOrWhitespace();
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$parsedotOrWhitespace();
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c366(s1);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsedot() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 46) {
        s0 = peg$c266;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c267); }
      }
  
      return s0;
    }
  
    function peg$parseinteger() {
      var s0, s1, s2;
  
      peg$silentFails++;
      s0 = peg$currPos;
      s1 = [];
      if (peg$c285.test(input.charAt(peg$currPos))) {
        s2 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c286); }
      }
      if (s2 !== peg$FAILED) {
        while (s2 !== peg$FAILED) {
          s1.push(s2);
          if (peg$c285.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c286); }
          }
        }
      } else {
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c287(s1);
      }
      s0 = s1;
      peg$silentFails--;
      if (s0 === peg$FAILED) {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c367); }
      }
  
      return s0;
    }
  
    function peg$parsewhiteSpace() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      s1 = [];
      if (input.charCodeAt(peg$currPos) === 32) {
        s2 = peg$c368;
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c369); }
      }
      if (s2 !== peg$FAILED) {
        while (s2 !== peg$FAILED) {
          s1.push(s2);
          if (input.charCodeAt(peg$currPos) === 32) {
            s2 = peg$c368;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c369); }
          }
        }
      } else {
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c370();
      }
      s0 = s1;
  
      return s0;
    }
  
    function peg$parsedotOrWhitespace() {
      var s0;
  
      s0 = peg$parsedot();
      if (s0 === peg$FAILED) {
        s0 = peg$parsewhiteSpace();
      }
  
      return s0;
    }
  
    function peg$parsehalfMove() {
      var s0, s1, s2, s3, s4, s5, s6, s7, s8;
  
      s0 = peg$currPos;
      s1 = peg$parsefigure();
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        peg$silentFails++;
        s3 = peg$parsecheckdisc();
        peg$silentFails--;
        if (s3 !== peg$FAILED) {
          peg$currPos = s2;
          s2 = void 0;
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsediscriminator();
          if (s3 !== peg$FAILED) {
            s4 = peg$parsestrike();
            if (s4 === peg$FAILED) {
              s4 = null;
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parsecolumn();
              if (s5 !== peg$FAILED) {
                s6 = peg$parserow();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsepromotion();
                  if (s7 === peg$FAILED) {
                    s7 = null;
                  }
                  if (s7 !== peg$FAILED) {
                    s8 = peg$parsecheck();
                    if (s8 === peg$FAILED) {
                      s8 = null;
                    }
                    if (s8 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c371(s1, s3, s4, s5, s6, s7, s8);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parsefigure();
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parsecolumn();
          if (s2 !== peg$FAILED) {
            s3 = peg$parserow();
            if (s3 !== peg$FAILED) {
              s4 = peg$parsestrikeOrDash();
              if (s4 === peg$FAILED) {
                s4 = null;
              }
              if (s4 !== peg$FAILED) {
                s5 = peg$parsecolumn();
                if (s5 !== peg$FAILED) {
                  s6 = peg$parserow();
                  if (s6 !== peg$FAILED) {
                    s7 = peg$parsepromotion();
                    if (s7 === peg$FAILED) {
                      s7 = null;
                    }
                    if (s7 !== peg$FAILED) {
                      s8 = peg$parsecheck();
                      if (s8 === peg$FAILED) {
                        s8 = null;
                      }
                      if (s8 !== peg$FAILED) {
                        peg$savedPos = s0;
                        s1 = peg$c372(s1, s2, s3, s4, s5, s6, s7, s8);
                        s0 = s1;
                      } else {
                        peg$currPos = s0;
                        s0 = peg$FAILED;
                      }
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parsefigure();
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parsestrike();
            if (s2 === peg$FAILED) {
              s2 = null;
            }
            if (s2 !== peg$FAILED) {
              s3 = peg$parsecolumn();
              if (s3 !== peg$FAILED) {
                s4 = peg$parserow();
                if (s4 !== peg$FAILED) {
                  s5 = peg$parsepromotion();
                  if (s5 === peg$FAILED) {
                    s5 = null;
                  }
                  if (s5 !== peg$FAILED) {
                    s6 = peg$parsecheck();
                    if (s6 === peg$FAILED) {
                      s6 = null;
                    }
                    if (s6 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c373(s1, s2, s3, s4, s5, s6);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 5) === peg$c374) {
              s1 = peg$c374;
              peg$currPos += 5;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c375); }
            }
            if (s1 !== peg$FAILED) {
              s2 = peg$parsecheck();
              if (s2 === peg$FAILED) {
                s2 = null;
              }
              if (s2 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c376(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.substr(peg$currPos, 3) === peg$c377) {
                s1 = peg$c377;
                peg$currPos += 3;
              } else {
                s1 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c378); }
              }
              if (s1 !== peg$FAILED) {
                s2 = peg$parsecheck();
                if (s2 === peg$FAILED) {
                  s2 = null;
                }
                if (s2 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c379(s2);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsecheck() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$currPos;
      s2 = peg$currPos;
      peg$silentFails++;
      if (input.substr(peg$currPos, 2) === peg$c380) {
        s3 = peg$c380;
        peg$currPos += 2;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c381); }
      }
      peg$silentFails--;
      if (s3 === peg$FAILED) {
        s2 = void 0;
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 43) {
          s3 = peg$c382;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c383); }
        }
        if (s3 !== peg$FAILED) {
          s2 = [s2, s3];
          s1 = s2;
        } else {
          peg$currPos = s1;
          s1 = peg$FAILED;
        }
      } else {
        peg$currPos = s1;
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c384(s1);
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$currPos;
        s2 = peg$currPos;
        peg$silentFails++;
        if (input.substr(peg$currPos, 3) === peg$c385) {
          s3 = peg$c385;
          peg$currPos += 3;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c386); }
        }
        peg$silentFails--;
        if (s3 === peg$FAILED) {
          s2 = void 0;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 35) {
            s3 = peg$c387;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c388); }
          }
          if (s3 !== peg$FAILED) {
            s2 = [s2, s3];
            s1 = s2;
          } else {
            peg$currPos = s1;
            s1 = peg$FAILED;
          }
        } else {
          peg$currPos = s1;
          s1 = peg$FAILED;
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c384(s1);
        }
        s0 = s1;
      }
  
      return s0;
    }
  
    function peg$parsepromotion() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 61) {
        s1 = peg$c389;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c390); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parsepromFigure();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c391(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsenags() {
      var s0, s1, s2, s3;
  
      s0 = peg$currPos;
      s1 = peg$parsenag();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsews();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsenags();
          if (s3 === peg$FAILED) {
            s3 = null;
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c392(s1, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsenag() {
      var s0, s1, s2;
  
      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 36) {
        s1 = peg$c393;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c394); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parseinteger();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c395(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 2) === peg$c396) {
          s1 = peg$c396;
          peg$currPos += 2;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c397); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c398();
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 2) === peg$c399) {
            s1 = peg$c399;
            peg$currPos += 2;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c400); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c401();
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 2) === peg$c402) {
              s1 = peg$c402;
              peg$currPos += 2;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c403); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c404();
            }
            s0 = s1;
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.substr(peg$currPos, 2) === peg$c405) {
                s1 = peg$c405;
                peg$currPos += 2;
              } else {
                s1 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c406); }
              }
              if (s1 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c407();
              }
              s0 = s1;
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 33) {
                  s1 = peg$c408;
                  peg$currPos++;
                } else {
                  s1 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c409); }
                }
                if (s1 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c410();
                }
                s0 = s1;
                if (s0 === peg$FAILED) {
                  s0 = peg$currPos;
                  if (input.charCodeAt(peg$currPos) === 63) {
                    s1 = peg$c411;
                    peg$currPos++;
                  } else {
                    s1 = peg$FAILED;
                    if (peg$silentFails === 0) { peg$fail(peg$c412); }
                  }
                  if (s1 !== peg$FAILED) {
                    peg$savedPos = s0;
                    s1 = peg$c413();
                  }
                  s0 = s1;
                  if (s0 === peg$FAILED) {
                    s0 = peg$currPos;
                    if (input.charCodeAt(peg$currPos) === 8252) {
                      s1 = peg$c414;
                      peg$currPos++;
                    } else {
                      s1 = peg$FAILED;
                      if (peg$silentFails === 0) { peg$fail(peg$c415); }
                    }
                    if (s1 !== peg$FAILED) {
                      peg$savedPos = s0;
                      s1 = peg$c398();
                    }
                    s0 = s1;
                    if (s0 === peg$FAILED) {
                      s0 = peg$currPos;
                      if (input.charCodeAt(peg$currPos) === 8263) {
                        s1 = peg$c416;
                        peg$currPos++;
                      } else {
                        s1 = peg$FAILED;
                        if (peg$silentFails === 0) { peg$fail(peg$c417); }
                      }
                      if (s1 !== peg$FAILED) {
                        peg$savedPos = s0;
                        s1 = peg$c401();
                      }
                      s0 = s1;
                      if (s0 === peg$FAILED) {
                        s0 = peg$currPos;
                        if (input.charCodeAt(peg$currPos) === 8265) {
                          s1 = peg$c418;
                          peg$currPos++;
                        } else {
                          s1 = peg$FAILED;
                          if (peg$silentFails === 0) { peg$fail(peg$c419); }
                        }
                        if (s1 !== peg$FAILED) {
                          peg$savedPos = s0;
                          s1 = peg$c404();
                        }
                        s0 = s1;
                        if (s0 === peg$FAILED) {
                          s0 = peg$currPos;
                          if (input.charCodeAt(peg$currPos) === 8264) {
                            s1 = peg$c420;
                            peg$currPos++;
                          } else {
                            s1 = peg$FAILED;
                            if (peg$silentFails === 0) { peg$fail(peg$c421); }
                          }
                          if (s1 !== peg$FAILED) {
                            peg$savedPos = s0;
                            s1 = peg$c407();
                          }
                          s0 = s1;
                          if (s0 === peg$FAILED) {
                            s0 = peg$currPos;
                            if (input.charCodeAt(peg$currPos) === 9633) {
                              s1 = peg$c422;
                              peg$currPos++;
                            } else {
                              s1 = peg$FAILED;
                              if (peg$silentFails === 0) { peg$fail(peg$c423); }
                            }
                            if (s1 !== peg$FAILED) {
                              peg$savedPos = s0;
                              s1 = peg$c424();
                            }
                            s0 = s1;
                            if (s0 === peg$FAILED) {
                              s0 = peg$currPos;
                              if (input.charCodeAt(peg$currPos) === 61) {
                                s1 = peg$c389;
                                peg$currPos++;
                              } else {
                                s1 = peg$FAILED;
                                if (peg$silentFails === 0) { peg$fail(peg$c390); }
                              }
                              if (s1 !== peg$FAILED) {
                                peg$savedPos = s0;
                                s1 = peg$c425();
                              }
                              s0 = s1;
                              if (s0 === peg$FAILED) {
                                s0 = peg$currPos;
                                if (input.charCodeAt(peg$currPos) === 8734) {
                                  s1 = peg$c426;
                                  peg$currPos++;
                                } else {
                                  s1 = peg$FAILED;
                                  if (peg$silentFails === 0) { peg$fail(peg$c427); }
                                }
                                if (s1 !== peg$FAILED) {
                                  peg$savedPos = s0;
                                  s1 = peg$c428();
                                }
                                s0 = s1;
                                if (s0 === peg$FAILED) {
                                  s0 = peg$currPos;
                                  if (input.charCodeAt(peg$currPos) === 10866) {
                                    s1 = peg$c429;
                                    peg$currPos++;
                                  } else {
                                    s1 = peg$FAILED;
                                    if (peg$silentFails === 0) { peg$fail(peg$c430); }
                                  }
                                  if (s1 !== peg$FAILED) {
                                    peg$savedPos = s0;
                                    s1 = peg$c431();
                                  }
                                  s0 = s1;
                                  if (s0 === peg$FAILED) {
                                    s0 = peg$currPos;
                                    if (input.charCodeAt(peg$currPos) === 10865) {
                                      s1 = peg$c432;
                                      peg$currPos++;
                                    } else {
                                      s1 = peg$FAILED;
                                      if (peg$silentFails === 0) { peg$fail(peg$c433); }
                                    }
                                    if (s1 !== peg$FAILED) {
                                      peg$savedPos = s0;
                                      s1 = peg$c434();
                                    }
                                    s0 = s1;
                                    if (s0 === peg$FAILED) {
                                      s0 = peg$currPos;
                                      if (input.charCodeAt(peg$currPos) === 177) {
                                        s1 = peg$c435;
                                        peg$currPos++;
                                      } else {
                                        s1 = peg$FAILED;
                                        if (peg$silentFails === 0) { peg$fail(peg$c436); }
                                      }
                                      if (s1 !== peg$FAILED) {
                                        peg$savedPos = s0;
                                        s1 = peg$c437();
                                      }
                                      s0 = s1;
                                      if (s0 === peg$FAILED) {
                                        s0 = peg$currPos;
                                        if (input.charCodeAt(peg$currPos) === 8723) {
                                          s1 = peg$c438;
                                          peg$currPos++;
                                        } else {
                                          s1 = peg$FAILED;
                                          if (peg$silentFails === 0) { peg$fail(peg$c439); }
                                        }
                                        if (s1 !== peg$FAILED) {
                                          peg$savedPos = s0;
                                          s1 = peg$c440();
                                        }
                                        s0 = s1;
                                        if (s0 === peg$FAILED) {
                                          s0 = peg$currPos;
                                          if (input.substr(peg$currPos, 2) === peg$c380) {
                                            s1 = peg$c380;
                                            peg$currPos += 2;
                                          } else {
                                            s1 = peg$FAILED;
                                            if (peg$silentFails === 0) { peg$fail(peg$c381); }
                                          }
                                          if (s1 !== peg$FAILED) {
                                            peg$savedPos = s0;
                                            s1 = peg$c441();
                                          }
                                          s0 = s1;
                                          if (s0 === peg$FAILED) {
                                            s0 = peg$currPos;
                                            if (input.substr(peg$currPos, 2) === peg$c442) {
                                              s1 = peg$c442;
                                              peg$currPos += 2;
                                            } else {
                                              s1 = peg$FAILED;
                                              if (peg$silentFails === 0) { peg$fail(peg$c443); }
                                            }
                                            if (s1 !== peg$FAILED) {
                                              peg$savedPos = s0;
                                              s1 = peg$c444();
                                            }
                                            s0 = s1;
                                            if (s0 === peg$FAILED) {
                                              s0 = peg$currPos;
                                              if (input.charCodeAt(peg$currPos) === 10752) {
                                                s1 = peg$c445;
                                                peg$currPos++;
                                              } else {
                                                s1 = peg$FAILED;
                                                if (peg$silentFails === 0) { peg$fail(peg$c446); }
                                              }
                                              if (s1 !== peg$FAILED) {
                                                peg$savedPos = s0;
                                                s1 = peg$c447();
                                              }
                                              s0 = s1;
                                              if (s0 === peg$FAILED) {
                                                s0 = peg$currPos;
                                                if (input.charCodeAt(peg$currPos) === 10227) {
                                                  s1 = peg$c448;
                                                  peg$currPos++;
                                                } else {
                                                  s1 = peg$FAILED;
                                                  if (peg$silentFails === 0) { peg$fail(peg$c449); }
                                                }
                                                if (s1 !== peg$FAILED) {
                                                  peg$savedPos = s0;
                                                  s1 = peg$c450();
                                                }
                                                s0 = s1;
                                                if (s0 === peg$FAILED) {
                                                  s0 = peg$currPos;
                                                  if (input.charCodeAt(peg$currPos) === 8594) {
                                                    s1 = peg$c451;
                                                    peg$currPos++;
                                                  } else {
                                                    s1 = peg$FAILED;
                                                    if (peg$silentFails === 0) { peg$fail(peg$c452); }
                                                  }
                                                  if (s1 !== peg$FAILED) {
                                                    peg$savedPos = s0;
                                                    s1 = peg$c453();
                                                  }
                                                  s0 = s1;
                                                  if (s0 === peg$FAILED) {
                                                    s0 = peg$currPos;
                                                    if (input.charCodeAt(peg$currPos) === 8593) {
                                                      s1 = peg$c454;
                                                      peg$currPos++;
                                                    } else {
                                                      s1 = peg$FAILED;
                                                      if (peg$silentFails === 0) { peg$fail(peg$c455); }
                                                    }
                                                    if (s1 !== peg$FAILED) {
                                                      peg$savedPos = s0;
                                                      s1 = peg$c456();
                                                    }
                                                    s0 = s1;
                                                    if (s0 === peg$FAILED) {
                                                      s0 = peg$currPos;
                                                      if (input.charCodeAt(peg$currPos) === 8646) {
                                                        s1 = peg$c457;
                                                        peg$currPos++;
                                                      } else {
                                                        s1 = peg$FAILED;
                                                        if (peg$silentFails === 0) { peg$fail(peg$c458); }
                                                      }
                                                      if (s1 !== peg$FAILED) {
                                                        peg$savedPos = s0;
                                                        s1 = peg$c459();
                                                      }
                                                      s0 = s1;
                                                      if (s0 === peg$FAILED) {
                                                        s0 = peg$currPos;
                                                        if (input.charCodeAt(peg$currPos) === 68) {
                                                          s1 = peg$c460;
                                                          peg$currPos++;
                                                        } else {
                                                          s1 = peg$FAILED;
                                                          if (peg$silentFails === 0) { peg$fail(peg$c461); }
                                                        }
                                                        if (s1 !== peg$FAILED) {
                                                          peg$savedPos = s0;
                                                          s1 = peg$c462();
                                                        }
                                                        s0 = s1;
                                                      }
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
  
      return s0;
    }
  
    function peg$parsediscriminator() {
      var s0;
  
      s0 = peg$parsecolumn();
      if (s0 === peg$FAILED) {
        s0 = peg$parserow();
      }
  
      return s0;
    }
  
    function peg$parsecheckdisc() {
      var s0, s1, s2, s3, s4;
  
      s0 = peg$currPos;
      s1 = peg$parsediscriminator();
      if (s1 !== peg$FAILED) {
        s2 = peg$parsestrike();
        if (s2 === peg$FAILED) {
          s2 = null;
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parsecolumn();
          if (s3 !== peg$FAILED) {
            s4 = peg$parserow();
            if (s4 !== peg$FAILED) {
              s1 = [s1, s2, s3, s4];
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
  
      return s0;
    }
  
    function peg$parsefigure() {
      var s0;
  
      if (peg$c463.test(input.charAt(peg$currPos))) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c464); }
      }
  
      return s0;
    }
  
    function peg$parsepromFigure() {
      var s0;
  
      if (peg$c465.test(input.charAt(peg$currPos))) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c466); }
      }
  
      return s0;
    }
  
    function peg$parsecolumn() {
      var s0;
  
      if (peg$c467.test(input.charAt(peg$currPos))) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c468); }
      }
  
      return s0;
    }
  
    function peg$parserow() {
      var s0;
  
      if (peg$c469.test(input.charAt(peg$currPos))) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c470); }
      }
  
      return s0;
    }
  
    function peg$parsestrike() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 120) {
        s0 = peg$c471;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c472); }
      }
  
      return s0;
    }
  
    function peg$parsestrikeOrDash() {
      var s0;
  
      if (input.charCodeAt(peg$currPos) === 120) {
        s0 = peg$c471;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c472); }
      }
      if (s0 === peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 45) {
          s0 = peg$c283;
          peg$currPos++;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c284); }
        }
      }
  
      return s0;
    }
  
  
        function makeInteger(o) {
            return parseInt(o.join(""), 10);
        }
  
  
    peg$result = peg$startRuleFunction();
  
    if (peg$result !== peg$FAILED && peg$currPos === input.length) {
      return peg$result;
    } else {
      if (peg$result !== peg$FAILED && peg$currPos < input.length) {
        peg$fail(peg$endExpectation());
      }
  
      throw peg$buildStructuredError(
        peg$maxFailExpected,
        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
        peg$maxFailPos < input.length
          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
      );
    }
  }
  
  module.exports = {
    SyntaxError: peg$SyntaxError,
    parse:       peg$parse
  };
  