webgme-bip
Version:
Design studio for component-based modeling with BIP.
10 lines • 105 kB
JavaScript
/*
* PEG.js 0.10.0
*
* http://pegjs.org/
*
* Copyright (c) 2010-2016 David Majda
* Licensed under the MIT license.
*/
!function(u){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=u();else if("function"==typeof define&&define.amd)define([],u);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.peg=u()}}(function(){var define,module,exports;return function u(e,t,r){function n(s,i){if(!t[s]){if(!e[s]){var a="function"==typeof require&&require;if(!i&&a)return a(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=t[s]={exports:{}};e[s][0].call(p.exports,function(u){var t=e[s][1][u];return n(t?t:u)},p,p.exports,u,e,t,r)}return t[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(u,e,t){"use strict";var r=u("../utils/arrays"),n=u("./visitor"),o={findRule:function(u,e){return r.find(u.rules,function(u){return u.name===e})},indexOfRule:function(u,e){return r.indexOf(u.rules,function(u){return u.name===e})},alwaysConsumesOnSuccess:function(u,e){function t(){return!0}function s(){return!1}function i(u){return a(u.expression)}var a=n.build({rule:i,named:i,choice:function(u){return r.every(u.alternatives,a)},action:i,sequence:function(u){return r.some(u.elements,a)},labeled:i,text:i,simple_and:s,simple_not:s,optional:s,zero_or_more:s,one_or_more:i,group:i,semantic_and:s,semantic_not:s,rule_ref:function(e){return a(o.findRule(u,e.name))},literal:function(u){return""!==u.value},class:t,any:t});return a(e)}};e.exports=o},{"../utils/arrays":17,"./visitor":13}],2:[function(require,module,exports){"use strict";var arrays=require("../utils/arrays"),objects=require("../utils/objects"),compiler={visitor:require("./visitor"),passes:{check:{reportUndefinedRules:require("./passes/report-undefined-rules"),reportDuplicateRules:require("./passes/report-duplicate-rules"),reportDuplicateLabels:require("./passes/report-duplicate-labels"),reportInfiniteRecursion:require("./passes/report-infinite-recursion"),reportInfiniteRepetition:require("./passes/report-infinite-repetition")},transform:{removeProxyRules:require("./passes/remove-proxy-rules")},generate:{generateBytecode:require("./passes/generate-bytecode"),generateJS:require("./passes/generate-js")}},compile:function(ast,passes,options){options=void 0!==options?options:{};var stage;options=objects.clone(options),objects.defaults(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",optimize:"speed",output:"parser",trace:!1});for(stage in passes)passes.hasOwnProperty(stage)&&arrays.each(passes[stage],function(u){u(ast,options)});switch(options.output){case"parser":return eval(ast.code);case"source":return ast.code}}};module.exports=compiler},{"../utils/arrays":17,"../utils/objects":19,"./passes/generate-bytecode":5,"./passes/generate-js":6,"./passes/remove-proxy-rules":7,"./passes/report-duplicate-labels":8,"./passes/report-duplicate-rules":9,"./passes/report-infinite-recursion":10,"./passes/report-infinite-repetition":11,"./passes/report-undefined-rules":12,"./visitor":13}],3:[function(u,e,t){"use strict";function r(u){return u.charCodeAt(0).toString(16).toUpperCase()}var n={stringEscape:function(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(u){return"\\x"+r(u)}).replace(/[\u0100-\u0FFF]/g,function(u){return"\\u0"+r(u)}).replace(/[\u1000-\uFFFF]/g,function(u){return"\\u"+r(u)})},regexpClassEscape:function(u){return u.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\x0B").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(u){return"\\x"+r(u)}).replace(/[\u0100-\u0FFF]/g,function(u){return"\\u0"+r(u)}).replace(/[\u1000-\uFFFF]/g,function(u){return"\\u"+r(u)})}};e.exports=n},{}],4:[function(u,e,t){"use strict";var r={PUSH:0,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29};e.exports=r},{}],5:[function(u,e,t){"use strict";function r(u){function e(u){var e=n.indexOf(F,u);return e===-1?F.push(u)-1:e}function t(u,t){return e("function("+u.join(", ")+") {"+t+"}")}function r(){return Array.prototype.concat.apply([],arguments)}function p(u,e,t){return u.concat([e.length,t.length],e,t)}function A(u,e){return u.concat([e.length],e)}function l(u,e,t,r){var s=n.map(o.values(t),function(u){return r-u});return[a.CALL,u,e,s.length].concat(s)}function E(u,e,t){return r([a.PUSH_CURR_POS],[a.SILENT_FAILS_ON],d(u,{sp:t.sp+1,env:o.clone(t.env),action:null}),[a.SILENT_FAILS_OFF],p([e?a.IF_ERROR:a.IF_NOT_ERROR],r([a.POP],[e?a.POP:a.POP_CURR_POS],[a.PUSH_UNDEFINED]),r([a.POP],[e?a.POP_CURR_POS:a.POP],[a.PUSH_FAILED])))}function C(u,e,n){var s=t(o.keys(n.env),u);return r([a.UPDATE_SAVED_POS],l(s,0,n.env,n.sp),p([a.IF],r([a.POP],e?[a.PUSH_FAILED]:[a.PUSH_UNDEFINED]),r([a.POP],e?[a.PUSH_UNDEFINED]:[a.PUSH_FAILED])))}function f(u){return A([a.WHILE_NOT_ERROR],r([a.APPEND],u))}var F=[],d=i.build({grammar:function(u){n.each(u.rules,d),u.consts=F},rule:function(u){u.bytecode=d(u.expression,{sp:-1,env:{},action:null})},named:function(u,t){var n=e('peg$otherExpectation("'+c.stringEscape(u.name)+'")');return r([a.SILENT_FAILS_ON],d(u.expression,t),[a.SILENT_FAILS_OFF],p([a.IF_ERROR],[a.FAIL,n],[]))},choice:function(u,e){function t(u,e){return r(d(u[0],{sp:e.sp,env:o.clone(e.env),action:null}),u.length>1?p([a.IF_ERROR],r([a.POP],t(u.slice(1),e)),[]):[])}return t(u.alternatives,e)},action:function(u,e){var n=o.clone(e.env),s="sequence"!==u.expression.type||0===u.expression.elements.length,i=d(u.expression,{sp:e.sp+(s?1:0),env:n,action:u}),c=t(o.keys(n),u.code);return s?r([a.PUSH_CURR_POS],i,p([a.IF_NOT_ERROR],r([a.LOAD_SAVED_POS,1],l(c,1,n,e.sp+2)),[]),[a.NIP]):i},sequence:function(u,e){function n(e,s){var i,c;return e.length>0?(i=u.elements.length-e.slice(1).length,r(d(e[0],{sp:s.sp,env:s.env,action:null}),p([a.IF_NOT_ERROR],n(e.slice(1),{sp:s.sp+1,env:s.env,action:s.action}),r(i>1?[a.POP_N,i]:[a.POP],[a.POP_CURR_POS],[a.PUSH_FAILED])))):s.action?(c=t(o.keys(s.env),s.action.code),r([a.LOAD_SAVED_POS,u.elements.length],l(c,u.elements.length,s.env,s.sp),[a.NIP])):r([a.WRAP,u.elements.length],[a.NIP])}return r([a.PUSH_CURR_POS],n(u.elements,{sp:e.sp+1,env:e.env,action:e.action}))},labeled:function(u,e){var t=o.clone(e.env);return e.env[u.label]=e.sp+1,d(u.expression,{sp:e.sp,env:t,action:null})},text:function(u,e){return r([a.PUSH_CURR_POS],d(u.expression,{sp:e.sp+1,env:o.clone(e.env),action:null}),p([a.IF_NOT_ERROR],r([a.POP],[a.TEXT]),[a.NIP]))},simple_and:function(u,e){return E(u.expression,!1,e)},simple_not:function(u,e){return E(u.expression,!0,e)},optional:function(u,e){return r(d(u.expression,{sp:e.sp,env:o.clone(e.env),action:null}),p([a.IF_ERROR],r([a.POP],[a.PUSH_NULL]),[]))},zero_or_more:function(u,e){var t=d(u.expression,{sp:e.sp+1,env:o.clone(e.env),action:null});return r([a.PUSH_EMPTY_ARRAY],t,f(t),[a.POP])},one_or_more:function(u,e){var t=d(u.expression,{sp:e.sp+1,env:o.clone(e.env),action:null});return r([a.PUSH_EMPTY_ARRAY],t,p([a.IF_NOT_ERROR],r(f(t),[a.POP]),r([a.POP],[a.POP],[a.PUSH_FAILED])))},group:function(u,e){return d(u.expression,{sp:e.sp,env:o.clone(e.env),action:null})},semantic_and:function(u,e){return C(u.code,!1,e)},semantic_not:function(u,e){return C(u.code,!0,e)},rule_ref:function(e){return[a.RULE,s.indexOfRule(u,e.name)]},literal:function(u){var t,r;return u.value.length>0?(t=e('"'+c.stringEscape(u.ignoreCase?u.value.toLowerCase():u.value)+'"'),r=e('peg$literalExpectation("'+c.stringEscape(u.value)+'", '+u.ignoreCase+")"),p(u.ignoreCase?[a.MATCH_STRING_IC,t]:[a.MATCH_STRING,t],u.ignoreCase?[a.ACCEPT_N,u.value.length]:[a.ACCEPT_STRING,t],[a.FAIL,r])):(t=e('""'),[a.PUSH,t])},class:function(u){var t,r,o,s;return t=u.parts.length>0?"/^["+(u.inverted?"^":"")+n.map(u.parts,function(u){return u instanceof Array?c.regexpClassEscape(u[0])+"-"+c.regexpClassEscape(u[1]):c.regexpClassEscape(u)}).join("")+"]/"+(u.ignoreCase?"i":""):u.inverted?"/^[\\S\\s]/":"/^(?!)/",r="["+n.map(u.parts,function(u){return u instanceof Array?'["'+c.stringEscape(u[0])+'", "'+c.stringEscape(u[1])+'"]':'"'+c.stringEscape(u)+'"'}).join(", ")+"]",o=e(t),s=e("peg$classExpectation("+r+", "+u.inverted+", "+u.ignoreCase+")"),p([a.MATCH_REGEXP,o],[a.ACCEPT_N,1],[a.FAIL,s])},any:function(){var u=e("peg$anyExpectation()");return p([a.MATCH_ANY],[a.ACCEPT_N,1],[a.FAIL,u])}});d(u)}var n=u("../../utils/arrays"),o=u("../../utils/objects"),s=u("../asts"),i=u("../visitor"),a=u("../opcodes"),c=u("../js");e.exports=r},{"../../utils/arrays":17,"../../utils/objects":19,"../asts":1,"../js":3,"../opcodes":4,"../visitor":13}],6:[function(require,module,exports){"use strict";function generateJS(ast,options){function indent2(u){return u.replace(/^(.+)$/gm," $1")}function indent6(u){return u.replace(/^(.+)$/gm," $1")}function indent10(u){return u.replace(/^(.+)$/gm," $1")}function generateTables(){return"size"===options.optimize?["peg$consts = [",indent2(ast.consts.join(",\n")),"],","","peg$bytecode = [",indent2(arrays.map(ast.rules,function(u){return'peg$decode("'+js.stringEscape(arrays.map(u.bytecode,function(u){return String.fromCharCode(u+32)}).join(""))+'")'}).join(",\n")),"],"].join("\n"):arrays.map(ast.consts,function(u,e){return"peg$c"+e+" = "+u+","}).join("\n")}function generateRuleHeader(u,e){var t=[];return t.push(""),options.trace&&t.push(["peg$tracer.trace({",' type: "rule.enter",'," rule: "+u+","," location: peg$computeLocation(startPos, startPos)","});",""].join("\n")),options.cache&&(t.push(["var key = peg$currPos * "+ast.rules.length+" + "+e+","," cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""].join("\n")),options.trace&&t.push(["if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+u+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+u+","," location: peg$computeLocation(startPos, startPos)"," });","}",""].join("\n")),t.push([" return cached.result;","}",""].join("\n"))),t.join("\n")}function generateRuleFooter(u,e){var t=[];return options.cache&&t.push(["","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+e+" };"].join("\n")),options.trace&&t.push(["","if ("+e+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+u+","," result: "+e+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+u+","," location: peg$computeLocation(startPos, startPos)"," });","}"].join("\n")),t.push(["","return "+e+";"].join("\n")),t.join("\n")}function generateInterpreter(){function u(u,e){var t=e+3,r="bc[ip + "+(t-2)+"]",n="bc[ip + "+(t-1)+"]";return["ends.push(end);","ips.push(ip + "+t+" + "+r+" + "+n+");","","if ("+u+") {"," end = ip + "+t+" + "+r+";"," ip += "+t+";","} else {"," end = ip + "+t+" + "+r+" + "+n+";"," ip += "+t+" + "+r+";","}","","break;"].join("\n")}function e(u){var e=2,t="bc[ip + "+(e-1)+"]";return["if ("+u+") {"," ends.push(end);"," ips.push(ip);",""," end = ip + "+e+" + "+t+";"," ip += "+e+";","} else {"," ip += "+e+" + "+t+";","}","","break;"].join("\n")}function t(){var u=4,e="bc[ip + "+(u-1)+"]";return["params = bc.slice(ip + "+u+", ip + "+u+" + "+e+");","for (i = 0; i < "+e+"; i++) {"," params[i] = stack[stack.length - 1 - params[i]];","}","","stack.splice("," stack.length - bc[ip + 2],"," bc[ip + 2],"," peg$consts[bc[ip + 1]].apply(null, params)",");","","ip += "+u+" + "+e+";","break;"].join("\n")}var r=[];return r.push(["function peg$decode(s) {"," var bc = new Array(s.length), i;",""," for (i = 0; i < s.length; i++) {"," bc[i] = s.charCodeAt(i) - 32;"," }",""," return bc;","}","","function peg$parseRule(index) {"].join("\n")),options.trace?r.push([" var bc = peg$bytecode[index],"," ip = 0,"," ips = [],"," end = bc.length,"," ends = [],"," stack = [],"," startPos = peg$currPos,"," params, i;"].join("\n")):r.push([" var bc = peg$bytecode[index],"," ip = 0,"," ips = [],"," end = bc.length,"," ends = [],"," stack = [],"," params, i;"].join("\n")),r.push(indent2(generateRuleHeader("peg$ruleNames[index]","index"))),r.push([" while (true) {"," while (ip < end) {"," switch (bc[ip]) {"," case "+op.PUSH+":"," stack.push(peg$consts[bc[ip + 1]]);"," ip += 2;"," break;",""," case "+op.PUSH_UNDEFINED+":"," stack.push(void 0);"," ip++;"," break;",""," case "+op.PUSH_NULL+":"," stack.push(null);"," ip++;"," break;",""," case "+op.PUSH_FAILED+":"," stack.push(peg$FAILED);"," ip++;"," break;",""," case "+op.PUSH_EMPTY_ARRAY+":"," stack.push([]);"," ip++;"," break;",""," case "+op.PUSH_CURR_POS+":"," stack.push(peg$currPos);"," ip++;"," break;",""," case "+op.POP+":"," stack.pop();"," ip++;"," break;",""," case "+op.POP_CURR_POS+":"," peg$currPos = stack.pop();"," ip++;"," break;",""," case "+op.POP_N+":"," stack.length -= bc[ip + 1];"," ip += 2;"," break;",""," case "+op.NIP+":"," stack.splice(-2, 1);"," ip++;"," break;",""," case "+op.APPEND+":"," stack[stack.length - 2].push(stack.pop());"," ip++;"," break;",""," case "+op.WRAP+":"," stack.push(stack.splice(stack.length - bc[ip + 1], bc[ip + 1]));"," ip += 2;"," break;",""," case "+op.TEXT+":"," stack.push(input.substring(stack.pop(), peg$currPos));"," ip++;"," break;",""," case "+op.IF+":",indent10(u("stack[stack.length - 1]",0)),""," case "+op.IF_ERROR+":",indent10(u("stack[stack.length - 1] === peg$FAILED",0)),""," case "+op.IF_NOT_ERROR+":",indent10(u("stack[stack.length - 1] !== peg$FAILED",0)),""," case "+op.WHILE_NOT_ERROR+":",indent10(e("stack[stack.length - 1] !== peg$FAILED")),""," case "+op.MATCH_ANY+":",indent10(u("input.length > peg$currPos",0)),""," case "+op.MATCH_STRING+":",indent10(u("input.substr(peg$currPos, peg$consts[bc[ip + 1]].length) === peg$consts[bc[ip + 1]]",1)),""," case "+op.MATCH_STRING_IC+":",indent10(u("input.substr(peg$currPos, peg$consts[bc[ip + 1]].length).toLowerCase() === peg$consts[bc[ip + 1]]",1)),""," case "+op.MATCH_REGEXP+":",indent10(u("peg$consts[bc[ip + 1]].test(input.charAt(peg$currPos))",1)),""," case "+op.ACCEPT_N+":"," stack.push(input.substr(peg$currPos, bc[ip + 1]));"," peg$currPos += bc[ip + 1];"," ip += 2;"," break;",""," case "+op.ACCEPT_STRING+":"," stack.push(peg$consts[bc[ip + 1]]);"," peg$currPos += peg$consts[bc[ip + 1]].length;"," ip += 2;"," break;",""," case "+op.FAIL+":"," stack.push(peg$FAILED);"," if (peg$silentFails === 0) {"," peg$fail(peg$consts[bc[ip + 1]]);"," }"," ip += 2;"," break;",""," case "+op.LOAD_SAVED_POS+":"," peg$savedPos = stack[stack.length - 1 - bc[ip + 1]];"," ip += 2;"," break;",""," case "+op.UPDATE_SAVED_POS+":"," peg$savedPos = peg$currPos;"," ip++;"," break;",""," case "+op.CALL+":",indent10(t()),""," case "+op.RULE+":"," stack.push(peg$parseRule(bc[ip + 1]));"," ip += 2;"," break;",""," case "+op.SILENT_FAILS_ON+":"," peg$silentFails++;"," ip++;"," break;",""," case "+op.SILENT_FAILS_OFF+":"," peg$silentFails--;"," ip++;"," break;",""," default:",' throw new Error("Invalid opcode: " + bc[ip] + ".");'," }"," }",""," if (ends.length > 0) {"," end = ends.pop();"," ip = ips.pop();"," } else {"," break;"," }"," }"].join("\n")),r.push(indent2(generateRuleFooter("peg$ruleNames[index]","stack[0]"))),r.push("}"),r.join("\n")}function generateRuleFunction(rule){function c(u){return"peg$c"+u}function s(u){return"s"+u}function compile(bc){function compileCondition(u,e){var t,r,n,o,s=e+3,i=bc[ip+s-2],a=bc[ip+s-1],c=stack.sp;if(ip+=s,t=compile(bc.slice(ip,ip+i)),n=stack.sp,ip+=i,a>0&&(stack.sp=c,r=compile(bc.slice(ip,ip+a)),o=stack.sp,ip+=a,n!==o))throw new Error("Branches of a condition must move the stack pointer in the same way.");parts.push("if ("+u+") {"),parts.push(indent2(t)),a>0&&(parts.push("} else {"),parts.push(indent2(r))),parts.push("}")}function compileLoop(u){var e,t,r=2,n=bc[ip+r-1],o=stack.sp;if(ip+=r,e=compile(bc.slice(ip,ip+n)),t=stack.sp,ip+=n,t!==o)throw new Error("Body of a loop can't move the stack pointer.");parts.push("while ("+u+") {"),parts.push(indent2(e)),parts.push("}")}function compileCall(){var u=4,e=bc[ip+u-1],t=c(bc[ip+1])+"("+arrays.map(bc.slice(ip+u,ip+u+e),function(u){return stack.index(u)}).join(", ")+")";stack.pop(bc[ip+2]),parts.push(stack.push(t)),ip+=u+e}for(var ip=0,end=bc.length,parts=[],value;ip<end;)switch(bc[ip]){case op.PUSH:parts.push(stack.push(c(bc[ip+1]))),ip+=2;break;case op.PUSH_CURR_POS:parts.push(stack.push("peg$currPos")),ip++;break;case op.PUSH_UNDEFINED:parts.push(stack.push("void 0")),ip++;break;case op.PUSH_NULL:parts.push(stack.push("null")),ip++;break;case op.PUSH_FAILED:parts.push(stack.push("peg$FAILED")),ip++;break;case op.PUSH_EMPTY_ARRAY:parts.push(stack.push("[]")),ip++;break;case op.POP:stack.pop(),ip++;break;case op.POP_CURR_POS:parts.push("peg$currPos = "+stack.pop()+";"),ip++;break;case op.POP_N:stack.pop(bc[ip+1]),ip+=2;break;case op.NIP:value=stack.pop(),stack.pop(),parts.push(stack.push(value)),ip++;break;case op.APPEND:value=stack.pop(),parts.push(stack.top()+".push("+value+");"),ip++;break;case op.WRAP:parts.push(stack.push("["+stack.pop(bc[ip+1]).join(", ")+"]")),ip+=2;break;case op.TEXT:parts.push(stack.push("input.substring("+stack.pop()+", peg$currPos)")),ip++;break;case op.IF:compileCondition(stack.top(),0);break;case op.IF_ERROR:compileCondition(stack.top()+" === peg$FAILED",0);break;case op.IF_NOT_ERROR:compileCondition(stack.top()+" !== peg$FAILED",0);break;case op.WHILE_NOT_ERROR:compileLoop(stack.top()+" !== peg$FAILED",0);break;case op.MATCH_ANY:compileCondition("input.length > peg$currPos",0);break;case op.MATCH_STRING:compileCondition(eval(ast.consts[bc[ip+1]]).length>1?"input.substr(peg$currPos, "+eval(ast.consts[bc[ip+1]]).length+") === "+c(bc[ip+1]):"input.charCodeAt(peg$currPos) === "+eval(ast.consts[bc[ip+1]]).charCodeAt(0),1);break;case op.MATCH_STRING_IC:compileCondition("input.substr(peg$currPos, "+eval(ast.consts[bc[ip+1]]).length+").toLowerCase() === "+c(bc[ip+1]),1);break;case op.MATCH_REGEXP:compileCondition(c(bc[ip+1])+".test(input.charAt(peg$currPos))",1);break;case op.ACCEPT_N:parts.push(stack.push(bc[ip+1]>1?"input.substr(peg$currPos, "+bc[ip+1]+")":"input.charAt(peg$currPos)")),parts.push(bc[ip+1]>1?"peg$currPos += "+bc[ip+1]+";":"peg$currPos++;"),ip+=2;break;case op.ACCEPT_STRING:parts.push(stack.push(c(bc[ip+1]))),parts.push(eval(ast.consts[bc[ip+1]]).length>1?"peg$currPos += "+eval(ast.consts[bc[ip+1]]).length+";":"peg$currPos++;"),ip+=2;break;case op.FAIL:parts.push(stack.push("peg$FAILED")),parts.push("if (peg$silentFails === 0) { peg$fail("+c(bc[ip+1])+"); }"),ip+=2;break;case op.LOAD_SAVED_POS:parts.push("peg$savedPos = "+stack.index(bc[ip+1])+";"),ip+=2;break;case op.UPDATE_SAVED_POS:parts.push("peg$savedPos = peg$currPos;"),ip++;break;case op.CALL:compileCall();break;case op.RULE:parts.push(stack.push("peg$parse"+ast.rules[bc[ip+1]].name+"()")),ip+=2;break;case op.SILENT_FAILS_ON:parts.push("peg$silentFails++;"),ip++;break;case op.SILENT_FAILS_OFF:parts.push("peg$silentFails--;"),ip++;break;default:throw new Error("Invalid opcode: "+bc[ip]+".")}return parts.join("\n")}var parts=[],code,stack={sp:-1,maxSp:-1,push:function(u){var e=s(++this.sp)+" = "+u+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e},pop:function(u){var e;return void 0===u?s(this.sp--):(e=arrays.map(arrays.range(this.sp-u+1,this.sp+1),s),this.sp-=u,e)},top:function(){return s(this.sp)},index:function(u){return s(this.sp-u)}};return code=compile(rule.bytecode),parts.push("function peg$parse"+rule.name+"() {"),options.trace?parts.push([" var "+arrays.map(arrays.range(0,stack.maxSp+1),s).join(", ")+","," startPos = peg$currPos;"].join("\n")):parts.push(" var "+arrays.map(arrays.range(0,stack.maxSp+1),s).join(", ")+";"),parts.push(indent2(generateRuleHeader('"'+js.stringEscape(rule.name)+'"',asts.indexOfRule(ast,rule.name)))),parts.push(indent2(code)),parts.push(indent2(generateRuleFooter('"'+js.stringEscape(rule.name)+'"',s(0)))),parts.push("}"),parts.join("\n")}function generateToplevel(){var u,e,t,r,n,o=[];return o.push(["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.";',"};",""].join("\n")),options.trace&&o.push(["function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};",""].join("\n")),o.push(["function peg$parse(input, options) {"," options = options !== void 0 ? options : {};",""," var peg$FAILED = {},",""].join("\n")),"size"===options.optimize?(u="{ "+arrays.map(options.allowedStartRules,function(u){return u+": "+asts.indexOfRule(ast,u)}).join(", ")+" }",e=asts.indexOfRule(ast,options.allowedStartRules[0]),o.push([" peg$startRuleIndices = "+u+","," peg$startRuleIndex = "+e+","].join("\n"))):(t="{ "+arrays.map(options.allowedStartRules,function(u){return u+": peg$parse"+u}).join(", ")+" }",r="peg$parse"+options.allowedStartRules[0],o.push([" peg$startRuleFunctions = "+t+","," peg$startRuleFunction = "+r+","].join("\n"))),o.push(""),o.push(indent6(generateTables())),o.push([""," peg$currPos = 0,"," peg$savedPos = 0,"," peg$posDetailsCache = [{ line: 1, column: 1 }],"," peg$maxFailPos = 0,"," peg$maxFailExpected = [],"," peg$silentFails = 0,",""].join("\n")),options.cache&&o.push([" peg$resultsCache = {},",""].join("\n")),options.trace&&("size"===options.optimize&&(n="["+arrays.map(ast.rules,function(u){return'"'+js.stringEscape(u.name)+'"'}).join(", ")+"]",o.push([" peg$ruleNames = "+n+",",""].join("\n"))),o.push([' peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer(),',""].join("\n"))),o.push([" peg$result;",""].join("\n")),"size"===options.optimize?o.push([' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleIndices)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleIndex = peg$startRuleIndices[options.startRule];"," }"].join("\n")):o.push([' 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];"," }"].join("\n")),o.push([""," 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"," );"," }",""].join("\n")),"size"===options.optimize?(o.push(indent2(generateInterpreter())),
o.push("")):arrays.each(ast.rules,function(u){o.push(indent2(generateRuleFunction(u))),o.push("")}),ast.initializer&&(o.push(indent2(ast.initializer.code)),o.push("")),"size"===options.optimize?o.push(" peg$result = peg$parseRule(peg$startRuleIndex);"):o.push(" peg$result = peg$startRuleFunction();"),o.push([""," 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)"," );"," }","}"].join("\n")),o.join("\n")}function generateWrapper(u){function e(){return["/*"," * Generated by PEG.js 0.10.0."," *"," * http://pegjs.org/"," */"].join("\n")}function t(){return options.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}var r={bare:function(){return[e(),"(function() {",' "use strict";',"",indent2(u),"",indent2("return "+t()+";"),"})()"].join("\n")},commonjs:function(){var r=[],n=objects.keys(options.dependencies),o=arrays.map(n,function(u){return u+' = require("'+js.stringEscape(options.dependencies[u])+'")'});return r.push([e(),"",'"use strict";',""].join("\n")),o.length>0&&(r.push("var "+o.join(", ")+";"),r.push("")),r.push([u,"","module.exports = "+t()+";",""].join("\n")),r.join("\n")},amd:function(){var r=objects.values(options.dependencies),n=objects.keys(options.dependencies),o="["+arrays.map(r,function(u){return'"'+js.stringEscape(u)+'"'}).join(", ")+"]",s=n.join(", ");return[e(),"define("+o+", function("+s+") {",' "use strict";',"",indent2(u),"",indent2("return "+t()+";"),"});",""].join("\n")},globals:function(){return[e(),"(function(root) {",' "use strict";',"",indent2(u),"",indent2("root."+options.exportVar+" = "+t()+";"),"})(this);",""].join("\n")},umd:function(){var r=[],n=objects.values(options.dependencies),o=objects.keys(options.dependencies),s="["+arrays.map(n,function(u){return'"'+js.stringEscape(u)+'"'}).join(", ")+"]",i=arrays.map(n,function(u){return'require("'+js.stringEscape(u)+'")'}).join(", "),a=o.join(", ");return r.push([e(),"(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+s+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+i+");"].join("\n")),null!==options.exportVar&&r.push([" } else {"," root."+options.exportVar+" = factory();"].join("\n")),r.push([" }","})(this, function("+a+") {",' "use strict";',"",indent2(u),"",indent2("return "+t()+";"),"});",""].join("\n")),r.join("\n")}};return r[options.format]()}ast.code=generateWrapper(generateToplevel())}var arrays=require("../../utils/arrays"),objects=require("../../utils/objects"),asts=require("../asts"),op=require("../opcodes"),js=require("../js");module.exports=generateJS},{"../../utils/arrays":17,"../../utils/objects":19,"../asts":1,"../js":3,"../opcodes":4}],7:[function(u,e,t){"use strict";function r(u,e){function t(u){return"rule"===u.type&&"rule_ref"===u.expression.type}function r(u,e,t){var r=o.build({rule_ref:function(u){u.name===e&&(u.name=t)}});r(u)}var s=[];n.each(u.rules,function(o,i){t(o)&&(r(u,o.name,o.expression.name),n.contains(e.allowedStartRules,o.name)||s.push(i))}),s.reverse(),n.each(s,function(e){u.rules.splice(e,1)})}var n=u("../../utils/arrays"),o=u("../visitor");e.exports=r},{"../../utils/arrays":17,"../visitor":13}],8:[function(u,e,t){"use strict";function r(u){function e(u,e){t(u.expression,s.clone(e))}var t=i.build({rule:function(u){t(u.expression,{})},choice:function(u,e){o.each(u.alternatives,function(u){t(u,s.clone(e))})},action:e,labeled:function(u,e){if(e.hasOwnProperty(u.label))throw new n('Label "'+u.label+'" is already defined at line '+e[u.label].start.line+", column "+e[u.label].start.column+".",u.location);t(u.expression,e),e[u.label]=u.location},text:e,simple_and:e,simple_not:e,optional:e,zero_or_more:e,one_or_more:e,group:e});t(u)}var n=u("../../grammar-error"),o=u("../../utils/arrays"),s=u("../../utils/objects"),i=u("../visitor");e.exports=r},{"../../grammar-error":14,"../../utils/arrays":17,"../../utils/objects":19,"../visitor":13}],9:[function(u,e,t){"use strict";function r(u){var e={},t=o.build({rule:function(u){if(e.hasOwnProperty(u.name))throw new n('Rule "'+u.name+'" is already defined at line '+e[u.name].start.line+", column "+e[u.name].start.column+".",u.location);e[u.name]=u.location}});t(u)}var n=u("../../grammar-error"),o=u("../visitor");e.exports=r},{"../../grammar-error":14,"../visitor":13}],10:[function(u,e,t){"use strict";function r(u){var e=[],t=i.build({rule:function(u){e.push(u.name),t(u.expression),e.pop(u.name)},sequence:function(e){n.every(e.elements,function(e){return t(e),!s.alwaysConsumesOnSuccess(u,e)})},rule_ref:function(r){if(n.contains(e,r.name))throw e.push(r.name),new o("Possible infinite loop when parsing (left recursion: "+e.join(" -> ")+").",r.location);t(s.findRule(u,r.name))}});t(u)}var n=u("../../utils/arrays"),o=u("../../grammar-error"),s=u("../asts"),i=u("../visitor");e.exports=r},{"../../grammar-error":14,"../../utils/arrays":17,"../asts":1,"../visitor":13}],11:[function(u,e,t){"use strict";function r(u){var e=s.build({zero_or_more:function(e){if(!o.alwaysConsumesOnSuccess(u,e.expression))throw new n("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",e.location)},one_or_more:function(e){if(!o.alwaysConsumesOnSuccess(u,e.expression))throw new n("Possible infinite loop when parsing (repetition used with an expression that may not consume any input).",e.location)}});e(u)}var n=u("../../grammar-error"),o=u("../asts"),s=u("../visitor");e.exports=r},{"../../grammar-error":14,"../asts":1,"../visitor":13}],12:[function(u,e,t){"use strict";function r(u){var e=s.build({rule_ref:function(e){if(!o.findRule(u,e.name))throw new n('Rule "'+e.name+'" is not defined.',e.location)}});e(u)}var n=u("../../grammar-error"),o=u("../asts"),s=u("../visitor");e.exports=r},{"../../grammar-error":14,"../asts":1,"../visitor":13}],13:[function(u,e,t){"use strict";var r=u("../utils/objects"),n=u("../utils/arrays"),o={build:function(u){function e(e){return u[e.type].apply(null,arguments)}function t(){}function o(u){var t=Array.prototype.slice.call(arguments,1);e.apply(null,[u.expression].concat(t))}function s(u){return function(t){var r=Array.prototype.slice.call(arguments,1);n.each(t[u],function(u){e.apply(null,[u].concat(r))})}}var i={grammar:function(u){var t=Array.prototype.slice.call(arguments,1);u.initializer&&e.apply(null,[u.initializer].concat(t)),n.each(u.rules,function(u){e.apply(null,[u].concat(t))})},initializer:t,rule:o,named:o,choice:s("alternatives"),action:o,sequence:s("elements"),labeled:o,text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o,semantic_and:t,semantic_not:t,rule_ref:t,literal:t,class:t,any:t};return r.defaults(u,i),e}};e.exports=o},{"../utils/arrays":17,"../utils/objects":19}],14:[function(u,e,t){"use strict";function r(u,e){this.name="GrammarError",this.message=u,this.location=e,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}var n=u("./utils/classes");n.subclass(r,Error),e.exports=r},{"./utils/classes":18}],15:[function(u,e,t){"use strict";function r(u,e){function t(){this.constructor=u}t.prototype=e.prototype,u.prototype=new t}function n(u,e,t,r){this.message=u,this.expected=e,this.found=t,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,n)}function o(u,e){function t(){return u.substring(Yo,Vo)}function r(){return l(Yo,Vo)}function o(u,e){throw e=void 0!==e?e:l(Yo,Vo),C(u,e)}function s(u,e){return{type:"literal",text:u,ignoreCase:e}}function i(u,e,t){return{type:"class",parts:u,inverted:e,ignoreCase:t}}function a(){return{type:"any"}}function c(){return{type:"end"}}function p(u){return{type:"other",description:u}}function A(e){var t,r=Wo[e];if(r)return r;for(t=e-1;!Wo[t];)t--;for(r=Wo[t],r={line:r.line,column:r.column};t<e;)10===u.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Wo[e]=r,r}function l(u,e){var t=A(u),r=A(e);return{start:{offset:u,line:t.line,column:t.column},end:{offset:e,line:r.line,column:r.column}}}function E(u){Vo<Xo||(Vo>Xo&&(Xo=Vo,Jo=[]),Jo.push(u))}function C(u,e){return new n(u,null,null,e)}function f(u,e,t){return new n(n.buildMessage(u,e),u,e,t)}function F(){var u,e,t,r,n,o,s;if(u=Vo,e=ae(),e!==de)if(t=Vo,r=d(),r!==de?(n=ae(),n!==de?(r=[r,n],t=r):(Vo=t,t=de)):(Vo=t,t=de),t===de&&(t=null),t!==de){if(r=[],n=Vo,o=h(),o!==de?(s=ae(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de),n!==de)for(;n!==de;)r.push(n),n=Vo,o=h(),o!==de?(s=ae(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);else r=de;r!==de?(Yo=u,e=De(t,r),u=e):(Vo=u,u=de)}else Vo=u,u=de;else Vo=u,u=de;return u}function d(){var u,e,t;return u=Vo,e=Eu(),e!==de?(t=pe(),t!==de?(Yo=u,e=Be(e),u=e):(Vo=u,u=de)):(Vo=u,u=de),u}function h(){var e,t,r,n,o,s,i,a;return e=Vo,t=U(),t!==de?(r=ae(),r!==de?(n=Vo,o=J(),o!==de?(s=ae(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de),n===de&&(n=null),n!==de?(61===u.charCodeAt(Vo)?(o=ve,Vo++):(o=de,0===Zo&&E(me)),o!==de?(s=ae(),s!==de?(i=g(),i!==de?(a=pe(),a!==de?(Yo=e,t=be(t,n,i),e=t):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de),e}function g(){var e,t,r,n,o,s,i,a;if(e=Vo,t=D(),t!==de){for(r=[],n=Vo,o=ae(),o!==de?(47===u.charCodeAt(Vo)?(s=xe,Vo++):(s=de,0===Zo&&E(Pe)),s!==de?(i=ae(),i!==de?(a=D(),a!==de?(o=[o,s,i,a],n=o):(Vo=n,n=de)):(Vo=n,n=de)):(Vo=n,n=de)):(Vo=n,n=de);n!==de;)r.push(n),n=Vo,o=ae(),o!==de?(47===u.charCodeAt(Vo)?(s=xe,Vo++):(s=de,0===Zo&&E(Pe)),s!==de?(i=ae(),i!==de?(a=D(),a!==de?(o=[o,s,i,a],n=o):(Vo=n,n=de)):(Vo=n,n=de)):(Vo=n,n=de)):(Vo=n,n=de);r!==de?(Yo=e,t=_e(t,r),e=t):(Vo=e,e=de)}else Vo=e,e=de;return e}function D(){var u,e,t,r,n;return u=Vo,e=B(),e!==de?(t=Vo,r=ae(),r!==de?(n=Eu(),n!==de?(r=[r,n],t=r):(Vo=t,t=de)):(Vo=t,t=de),t===de&&(t=null),t!==de?(Yo=u,e=ye(e,t),u=e):(Vo=u,u=de)):(Vo=u,u=de),u}function B(){var u,e,t,r,n,o;if(u=Vo,e=v(),e!==de){for(t=[],r=Vo,n=ae(),n!==de?(o=v(),o!==de?(n=[n,o],r=n):(Vo=r,r=de)):(Vo=r,r=de);r!==de;)t.push(r),r=Vo,n=ae(),n!==de?(o=v(),o!==de?(n=[n,o],r=n):(Vo=r,r=de)):(Vo=r,r=de);t!==de?(Yo=u,e=$e(e,t),u=e):(Vo=u,u=de)}else Vo=u,u=de;return u}function v(){var e,t,r,n,o,s;return e=Vo,t=N(),t!==de?(r=ae(),r!==de?(58===u.charCodeAt(Vo)?(n=Re,Vo++):(n=de,0===Zo&&E(ke)),n!==de?(o=ae(),o!==de?(s=m(),s!==de?(Yo=e,t=Se(t,s),e=t):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de),e===de&&(e=m()),e}function m(){var u,e,t,r;return u=Vo,e=b(),e!==de?(t=ae(),t!==de?(r=x(),r!==de?(Yo=u,e=Ie(e,r),u=e):(Vo=u,u=de)):(Vo=u,u=de)):(Vo=u,u=de),u===de&&(u=x()),u}function b(){var e;return 36===u.charCodeAt(Vo)?(e=Oe,Vo++):(e=de,0===Zo&&E(je)),e===de&&(38===u.charCodeAt(Vo)?(e=Le,Vo++):(e=de,0===Zo&&E(we)),e===de&&(33===u.charCodeAt(Vo)?(e=Te,Vo++):(e=de,0===Zo&&E(Ne)))),e}function x(){var u,e,t,r;return u=Vo,e=_(),e!==de?(t=ae(),t!==de?(r=P(),r!==de?(Yo=u,e=Ue(e,r),u=e):(Vo=u,u=de)):(Vo=u,u=de)):(Vo=u,u=de),u===de&&(u=_()),u}function P(){var e;return 63===u.charCodeAt(Vo)?(e=He,Vo++):(e=de,0===Zo&&E(qe)),e===de&&(42===u.charCodeAt(Vo)?(e=ze,Vo++):(e=de,0===Zo&&E(Me)),e===de&&(43===u.charCodeAt(Vo)?(e=Ge,Vo++):(e=de,0===Zo&&E(Ve)))),e}function _(){var e,t,r,n,o,s;return e=X(),e===de&&(e=Q(),e===de&&(e=lu(),e===de&&(e=y(),e===de&&(e=$(),e===de&&(e=Vo,40===u.charCodeAt(Vo)?(t=Ye,Vo++):(t=de,0===Zo&&E(We)),t!==de?(r=ae(),r!==de?(n=g(),n!==de?(o=ae(),o!==de?(41===u.charCodeAt(Vo)?(s=Xe,Vo++):(s=de,0===Zo&&E(Je)),s!==de?(Yo=e,t=Ze(n),e=t):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)):(Vo=e,e=de)))))),e}function y(){var e,t,r,n,o,s,i,a;return e=Vo,t=U(),t!==de?(r=Vo,Zo++,n=Vo,o=ae(),o!==de?(s=Vo,i=J(),i!==de?(a=ae(),a!==de?(i=[i,a],s=i):(Vo=s,s=de)):(Vo=s,s=de),s===de&&(s=null),s!==de?(61===u.charCodeAt(Vo)?(i=ve,Vo++):(i=de,0===Zo&&E(me)),i!==de?(o=[o,s,i],n=o):(Vo=n,n=de)):(Vo=n,n=de)):(Vo=n,n=de),Zo--,n===de?r=void 0:(Vo=r,r=de),r!==de?(Yo=e,t=Ke(t),e=t):(Vo=e,e=de)):(Vo=e,e=de),e}function $(){var u,e,t,r;return u=Vo,e=R(),e!==de?(t=ae(),t!==de?(r=Eu(),r!==de?(Yo=u,e=Qe(e,r),u=e):(Vo=u,u=de)):(Vo=u,u=de)):(Vo=u,u=de),u}function R(){var e;return 38===u.charCodeAt(Vo)?(e=Le,Vo++):(e=de,0===Zo&&E(we)),e===de&&(33===u.charCodeAt(Vo)?(e=Te,Vo++):(e=de,0===Zo&&E(Ne))),e}function k(){var e;return u.length>Vo?(e=u.charAt(Vo),Vo++):(e=de,0===Zo&&E(ut)),e}function S(){var e,t;return Zo++,9===u.charCodeAt(Vo)?(e=tt,Vo++):(e=de,0===Zo&&E(rt)),e===de&&(11===u.charCodeAt(Vo)?(e=nt,Vo++):(e=de,0===Zo&&E(ot)),e===de&&(12===u.charCodeAt(Vo)?(e=st,Vo++):(e=de,0===Zo&&E(it)),e===de&&(32===u.charCodeAt(Vo)?(e=at,Vo++):(e=de,0===Zo&&E(ct)),e===de&&(160===u.charCodeAt(Vo)?(e=pt,Vo++):(e=de,0===Zo&&E(At)),e===de&&(65279===u.charCodeAt(Vo)?(e=lt,Vo++):(e=de,0===Zo&&E(Et)),e===de&&(e=xu())))))),Zo--,e===de&&(t=de,0===Zo&&E(et)),e}function I(){var e;return Ct.test(u.charAt(Vo))?(e=u.charAt(Vo),Vo++):(e=de,0===Zo&&E(ft)),e}function O(){var e,t;return Zo++,10===u.charCodeAt(Vo)?(e=dt,Vo++):(e=de,0===Zo&&E(ht)),e===de&&(u.substr(Vo,2)===gt?(e=gt,Vo+=2):(e=de,0===Zo&&E(Dt)),e===de&&(13===u.charCodeAt(Vo)?(e=Bt,Vo++):(e=de,0===Zo&&E(vt)),e===de&&(8232===u.charCodeAt(Vo)?(e=mt,Vo++):(e=de,0===Zo&&E(bt)),e===de&&(8233===u.charCodeAt(Vo)?(e=xt,Vo++):(e=de,0===Zo&&E(Pt)))))),Zo--,e===de&&(t=de,0===Zo&&E(Ft)),e}function j(){var u,e;return Zo++,u=L(),u===de&&(u=T()),Zo--,u===de&&(e=de,0===Zo&&E(_t)),u}function L(){var e,t,r,n,o,s;if(e=Vo,u.substr(Vo,2)===yt?(t=yt,Vo+=2):(t=de,0===Zo&&E($t)),t!==de){for(r=[],n=Vo,o=Vo,Zo++,u.substr(Vo,2)===Rt?(s=Rt,Vo+=2):(s=de,0===Zo&&E(kt)),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);n!==de;)r.push(n),n=Vo,o=Vo,Zo++,u.substr(Vo,2)===Rt?(s=Rt,Vo+=2):(s=de,0===Zo&&E(kt)),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);r!==de?(u.substr(Vo,2)===Rt?(n=Rt,Vo+=2):(n=de,0===Zo&&E(kt)),n!==de?(t=[t,r,n],e=t):(Vo=e,e=de)):(Vo=e,e=de)}else Vo=e,e=de;return e}function w(){var e,t,r,n,o,s;if(e=Vo,u.substr(Vo,2)===yt?(t=yt,Vo+=2):(t=de,0===Zo&&E($t)),t!==de){for(r=[],n=Vo,o=Vo,Zo++,u.substr(Vo,2)===Rt?(s=Rt,Vo+=2):(s=de,0===Zo&&E(kt)),s===de&&(s=I()),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);n!==de;)r.push(n),n=Vo,o=Vo,Zo++,u.substr(Vo,2)===Rt?(s=Rt,Vo+=2):(s=de,0===Zo&&E(kt)),s===de&&(s=I()),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);r!==de?(u.substr(Vo,2)===Rt?(n=Rt,Vo+=2):(n=de,0===Zo&&E(kt)),n!==de?(t=[t,r,n],e=t):(Vo=e,e=de)):(Vo=e,e=de)}else Vo=e,e=de;return e}function T(){var e,t,r,n,o,s;if(e=Vo,u.substr(Vo,2)===St?(t=St,Vo+=2):(t=de,0===Zo&&E(It)),t!==de){for(r=[],n=Vo,o=Vo,Zo++,s=I(),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);n!==de;)r.push(n),n=Vo,o=Vo,Zo++,s=I(),Zo--,s===de?o=void 0:(Vo=o,o=de),o!==de?(s=k(),s!==de?(o=[o,s],n=o):(Vo=n,n=de)):(Vo=n,n=de);r!==de?(t=[t,r],e=t):(Vo=e,e=de)}else Vo=e,e=de;return e}function N(){var u,e,t;return u=Vo,e=Vo,Zo++,t=G(),Zo--,t===de?e=void 0:(Vo=e,e=de),e!==de?(t=U(),t!==de?(Yo=u,e=Ot(t),u=e):(Vo=u,u=de)):(Vo=u,u=de),u}function U(){var u,e,t,r;if(Zo++,u=Vo,e=H(),e!==de){for(t=[],r=q();r!==de;)t.push(r),r=q();t!==de?(Yo=u,e=Lt(e,t),u=e):(Vo=u,u=de)}else Vo=u,u=de;return Zo--,u===de&&(e=de,0===Zo&&E(jt)),u}function H(){var e,t,r;return e=z(),e===de&&(36===u.charCodeAt(Vo)?(e=Oe,Vo++):(e=de,0===Zo&&E(je)),e===de&&(95===u.charCodeAt(Vo)?(e=wt,Vo++):(e=de,0===Zo&&E(Tt)),e===de&&(e=Vo,92===u.charCodeAt(Vo)?(t=Nt,Vo++):(t=de,0===Zo&&E(Ut)),t!==de?(r=cu(),r!==de?(Yo=e,t=Ht(r),e=t):(Vo=e,e=de)):(Vo=e,e=de)))),e}function q(){var e;return e=H(),e===de&&(e=M(),e===de&&(e=vu(),e===de&&(e=bu(),e===de&&(8204===u.charCodeAt(Vo)?(e=qt,Vo++):(e=de,0===Zo&&E(zt)),e===de&&(8205===u.charCodeAt(Vo)?(e=Mt,Vo++):(e=de,0===Zo&&E(Gt))))))),e}function z(){var u;return u=gu(),u===de&&(u=fu(),u===de&&(u=hu(),u===de&&(u=Fu(),u===de&&(u=du(),u===de&&(u=mu()))))),u}function M(){var u;return u=Bu(),u===de&&(u=Du()),u}function G(){var u;return u=V(),u===de&&(u=Y(),u===de&&(u=Xu(),u===de&&(u=W()))),u}function V(){var u;return u=Pu(),u===de&&(u=_u(),u===de&&(u=yu(),u===de&&(u=ku(),u===de&&(u=Su(),u===de&&(u=Iu(),u===de&&(u=Ou(),u===de&&(u=ju(),u===de&&(u=Lu(),u===de&&(u=Hu(),u===de&&(u=qu(),u===de&&(u=zu(),u===de&&(u=Mu(),u===de&&(u=Vu(),u===de&&(u=Yu(),u===de&&(u=Wu(),u===de&&(u=Ju(),u===de&&(u=Ku(),u===de&&(u=Qu(),u===de&&(u=ue(),u===de&&(u=te(),u===de&&(u=re(),u===de&&(u=ne(),u===de&&(u=oe(),u===de&&(u=se(),u===de&&(u=ie()))))))))))))))))))))))))),u}function Y(){var u;return u=$u(),u===de&&(u=Ru(),u===de&&(u=wu(),u===de&&(u=Tu(),u===de&&(u=Nu(),u===de&&(u=Gu(),u===de&&(u=Zu())))))),u}function W(){var u;return u=ee(),u===de&&(u=Uu()),u}function X(){var e,t,r;return Zo++,e=Vo,t=J(),t!==de?(105===u.charCodeAt(Vo)?(r=Yt,Vo++):(r=de,0===Zo&&E(Wt)),r===de&&(r=null),r!==de?(Yo=e,t=Xt(t,r),e=t):(Vo=e,e=de)):(Vo=e,e=de),Zo--,e===de&&(t=de,0===Zo&&E(Vt)),e}function J(){var e,t,r,n;if(Zo++,e=Vo,34===u.charCodeAt(Vo)?(t=Zt,Vo++):(t=de,0===Zo&&E(Kt)),t!==de){for(r=[],n=Z();n!==de;)r.push(n),n=Z();r!==de?(34===u.charCodeAt(Vo)?(n=Zt,Vo++):(n=de,0===Zo&&E(Kt)),n!==de?(Yo=e,t=Qt(r),e=t):(Vo=e,e=de)):(Vo=e,e=de)}else Vo=e,e=de;if(e===de)if(e=Vo,39===u.charCodeAt(Vo)?(t=ur,Vo+