parser.js 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146
  1. /*
  2. * Generated by PEG.js 0.10.0.
  3. *
  4. * http://pegjs.org/
  5. */
  6. define(["./boot"], function($boot) {
  7. "use strict";
  8. function peg$subclass(child, parent) {
  9. function ctor() { this.constructor = child; }
  10. ctor.prototype = parent.prototype;
  11. child.prototype = new ctor();
  12. }
  13. function peg$SyntaxError(message, expected, found, location) {
  14. this.message = message;
  15. this.expected = expected;
  16. this.found = found;
  17. this.location = location;
  18. this.name = "SyntaxError";
  19. if (typeof Error.captureStackTrace === "function") {
  20. Error.captureStackTrace(this, peg$SyntaxError);
  21. }
  22. }
  23. peg$subclass(peg$SyntaxError, Error);
  24. peg$SyntaxError.buildMessage = function(expected, found) {
  25. var DESCRIBE_EXPECTATION_FNS = {
  26. literal: function(expectation) {
  27. return "\"" + literalEscape(expectation.text) + "\"";
  28. },
  29. "class": function(expectation) {
  30. var escapedParts = "",
  31. i;
  32. for (i = 0; i < expectation.parts.length; i++) {
  33. escapedParts += expectation.parts[i] instanceof Array
  34. ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
  35. : classEscape(expectation.parts[i]);
  36. }
  37. return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
  38. },
  39. any: function(expectation) {
  40. return "any character";
  41. },
  42. end: function(expectation) {
  43. return "end of input";
  44. },
  45. other: function(expectation) {
  46. return expectation.description;
  47. }
  48. };
  49. function hex(ch) {
  50. return ch.charCodeAt(0).toString(16).toUpperCase();
  51. }
  52. function literalEscape(s) {
  53. return s
  54. .replace(/\\/g, '\\\\')
  55. .replace(/"/g, '\\"')
  56. .replace(/\0/g, '\\0')
  57. .replace(/\t/g, '\\t')
  58. .replace(/\n/g, '\\n')
  59. .replace(/\r/g, '\\r')
  60. .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
  61. .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
  62. }
  63. function classEscape(s) {
  64. return s
  65. .replace(/\\/g, '\\\\')
  66. .replace(/\]/g, '\\]')
  67. .replace(/\^/g, '\\^')
  68. .replace(/-/g, '\\-')
  69. .replace(/\0/g, '\\0')
  70. .replace(/\t/g, '\\t')
  71. .replace(/\n/g, '\\n')
  72. .replace(/\r/g, '\\r')
  73. .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
  74. .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
  75. }
  76. function describeExpectation(expectation) {
  77. return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
  78. }
  79. function describeExpected(expected) {
  80. var descriptions = new Array(expected.length),
  81. i, j;
  82. for (i = 0; i < expected.length; i++) {
  83. descriptions[i] = describeExpectation(expected[i]);
  84. }
  85. descriptions.sort();
  86. if (descriptions.length > 0) {
  87. for (i = 1, j = 1; i < descriptions.length; i++) {
  88. if (descriptions[i - 1] !== descriptions[i]) {
  89. descriptions[j] = descriptions[i];
  90. j++;
  91. }
  92. }
  93. descriptions.length = j;
  94. }
  95. switch (descriptions.length) {
  96. case 1:
  97. return descriptions[0];
  98. case 2:
  99. return descriptions[0] + " or " + descriptions[1];
  100. default:
  101. return descriptions.slice(0, -1).join(", ")
  102. + ", or "
  103. + descriptions[descriptions.length - 1];
  104. }
  105. }
  106. function describeFound(found) {
  107. return found ? "\"" + literalEscape(found) + "\"" : "end of input";
  108. }
  109. return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
  110. };
  111. function peg$parse(input, options) {
  112. options = options !== void 0 ? options : {};
  113. var peg$FAILED = {},
  114. peg$startRuleFunctions = { start: peg$parsestart },
  115. peg$startRuleFunction = peg$parsestart,
  116. peg$c0 = /^[ \t\x0B\f\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF\n\r\u2028\u2029]/,
  117. peg$c1 = peg$classExpectation([" ", "\t", "\x0B", "\f", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u202F", "\u205F", "\u3000", "\uFEFF", "\n", "\r", "\u2028", "\u2029"], false, false),
  118. peg$c2 = "\"",
  119. peg$c3 = peg$literalExpectation("\"", false),
  120. peg$c4 = /^[^"]/,
  121. peg$c5 = peg$classExpectation(["\""], true, false),
  122. peg$c6 = ".",
  123. peg$c7 = peg$literalExpectation(".", false),
  124. peg$c8 = /^[a-zA-Z]/,
  125. peg$c9 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false),
  126. peg$c10 = /^[a-zA-Z0-9]/,
  127. peg$c11 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false),
  128. peg$c12 = ":",
  129. peg$c13 = peg$literalExpectation(":", false),
  130. peg$c14 = /^[A-Z]/,
  131. peg$c15 = peg$classExpectation([["A", "Z"]], false, false),
  132. peg$c16 = function(val) {
  133. return $globals.ValueNode._new()
  134. ._location_(location())
  135. ._source_(text())
  136. ._value_(val);
  137. },
  138. peg$c17 = "'",
  139. peg$c18 = peg$literalExpectation("'", false),
  140. peg$c19 = "''",
  141. peg$c20 = peg$literalExpectation("''", false),
  142. peg$c21 = function() {return '\'';},
  143. peg$c22 = /^[^']/,
  144. peg$c23 = peg$classExpectation(["'"], true, false),
  145. peg$c24 = function(val) {return val.join('');},
  146. peg$c25 = "$",
  147. peg$c26 = peg$literalExpectation("$", false),
  148. peg$c27 = peg$anyExpectation(),
  149. peg$c28 = function(char) {
  150. return $globals.ValueNode._new()
  151. ._location_(location())
  152. ._source_(text())
  153. ._value_(char);
  154. },
  155. peg$c29 = "#",
  156. peg$c30 = peg$literalExpectation("#", false),
  157. peg$c31 = function(rest) {return rest;},
  158. peg$c32 = "e",
  159. peg$c33 = peg$literalExpectation("e", false),
  160. peg$c34 = function(n) {return parseFloat(n);},
  161. peg$c35 = "-",
  162. peg$c36 = peg$literalExpectation("-", false),
  163. peg$c37 = "16r",
  164. peg$c38 = peg$literalExpectation("16r", false),
  165. peg$c39 = /^[0-9a-fA-F]/,
  166. peg$c40 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false),
  167. peg$c41 = function(neg, num) {
  168. return parseInt(((neg || '') + num), 16);
  169. },
  170. peg$c42 = /^[0-9]/,
  171. peg$c43 = peg$classExpectation([["0", "9"]], false, false),
  172. peg$c44 = function(n) {return parseFloat(n, 10);},
  173. peg$c45 = function(n) {return parseInt(n, 10);},
  174. peg$c46 = "#(",
  175. peg$c47 = peg$literalExpectation("#(", false),
  176. peg$c48 = ")",
  177. peg$c49 = peg$literalExpectation(")", false),
  178. peg$c50 = function(rest) {
  179. return rest
  180. ._location_(location())
  181. ._source_(text());
  182. },
  183. peg$c51 = "(",
  184. peg$c52 = peg$literalExpectation("(", false),
  185. peg$c53 = function(lit) {return lit._value();},
  186. peg$c54 = function(lits) {
  187. return $globals.ValueNode._new()
  188. ._value_(lits);
  189. },
  190. peg$c55 = "{",
  191. peg$c56 = peg$literalExpectation("{", false),
  192. peg$c57 = "}",
  193. peg$c58 = peg$literalExpectation("}", false),
  194. peg$c59 = function(expressions) {
  195. return $globals.DynamicArrayNode._new()
  196. ._location_(location())
  197. ._source_(text())
  198. ._dagChildren_(expressions || []);
  199. },
  200. peg$c60 = "#{",
  201. peg$c61 = peg$literalExpectation("#{", false),
  202. peg$c62 = function(expressions) {
  203. return $globals.DynamicDictionaryNode._new()
  204. ._location_(location())
  205. ._source_(text())
  206. ._dagChildren_(expressions || []);
  207. },
  208. peg$c63 = "true",
  209. peg$c64 = peg$literalExpectation("true", false),
  210. peg$c65 = function() {return true;},
  211. peg$c66 = "false",
  212. peg$c67 = peg$literalExpectation("false", false),
  213. peg$c68 = function() {return false;},
  214. peg$c69 = "nil",
  215. peg$c70 = peg$literalExpectation("nil", false),
  216. peg$c71 = function() {return null;},
  217. peg$c72 = function(identifier) {
  218. return $globals.VariableNode._new()
  219. ._location_(location())
  220. ._source_(text())
  221. ._value_(identifier);
  222. },
  223. peg$c73 = /^[\\+*\/=><,@%~|&\-]/,
  224. peg$c74 = peg$classExpectation(["\\", "+", "*", "/", "=", ">", "<", ",", "@", "%", "~", "|", "&", "-"], false, false),
  225. peg$c75 = function(key, arg) {return {key:key, arg:arg};},
  226. peg$c76 = function(pairs) {
  227. var selector = '';
  228. var params = [];
  229. for(var i = 0; i < pairs.length; i++) {
  230. selector += pairs[i].key;
  231. params.push(pairs[i].arg);
  232. }
  233. return [selector, params];
  234. },
  235. peg$c77 = function(selector, arg) {
  236. return [selector, [arg]];
  237. },
  238. peg$c78 = function(selector) {return [selector, []];},
  239. peg$c79 = function(expression) {
  240. return expression;
  241. },
  242. peg$c80 = function(first, others) {
  243. return [first].concat(others);
  244. },
  245. peg$c81 = function(selector) {
  246. return $globals.Message._selector_arguments_(selector, []);
  247. },
  248. peg$c82 = function(pairs) {
  249. var selector = '';
  250. var args = [];
  251. for(var i = 0; i < pairs.length; i++) {
  252. selector += pairs[i].key;
  253. args.push(pairs[i].arg._value());
  254. }
  255. return $globals.Message._selector_arguments_(selector, args)
  256. },
  257. peg$c83 = "<",
  258. peg$c84 = peg$literalExpectation("<", false),
  259. peg$c85 = ">",
  260. peg$c86 = peg$literalExpectation(">", false),
  261. peg$c87 = function(message) {return message;},
  262. peg$c88 = ":=",
  263. peg$c89 = peg$literalExpectation(":=", false),
  264. peg$c90 = function(variable, expression) {
  265. return $globals.AssignmentNode._new()
  266. ._location_(location())
  267. ._source_(text())
  268. ._left_(variable)
  269. ._right_(expression);
  270. },
  271. peg$c91 = "^",
  272. peg$c92 = peg$literalExpectation("^", false),
  273. peg$c93 = function(expression) {
  274. return $globals.ReturnNode._new()
  275. ._location_(location())
  276. ._source_(text())
  277. ._dagChildren_([expression]);
  278. },
  279. peg$c94 = "|",
  280. peg$c95 = peg$literalExpectation("|", false),
  281. peg$c96 = function(variable) {return variable;},
  282. peg$c97 = function(vars) {
  283. return vars;
  284. },
  285. peg$c98 = function(param) {return param;},
  286. peg$c99 = function(params) {
  287. return params;
  288. },
  289. peg$c100 = function(ret) {return [ret];},
  290. peg$c101 = function(exps, ret) {
  291. var expressions = exps;
  292. expressions.push(ret);
  293. return expressions;
  294. },
  295. peg$c102 = function(expressions) {return expressions || [];},
  296. peg$c103 = function(aPragmas, temps, zPragmas, statements) {
  297. return $globals.SequenceNode._new()
  298. ._location_(location())
  299. ._source_(text())
  300. ._temps_(temps || [])
  301. ._pragmas_((aPragmas || []).concat(zPragmas || []))
  302. ._dagChildren_(statements || []);
  303. },
  304. peg$c104 = function(temps, statements) {
  305. return $globals.BlockSequenceNode._new()
  306. ._location_(location())
  307. ._source_(text())
  308. ._temps_(temps || [])
  309. ._dagChildren_(statements || []);
  310. },
  311. peg$c105 = "[",
  312. peg$c106 = peg$literalExpectation("[", false),
  313. peg$c107 = "]",
  314. peg$c108 = peg$literalExpectation("]", false),
  315. peg$c109 = function(params, sequence) {
  316. return $globals.BlockNode._new()
  317. ._location_(location())
  318. ._source_(text())
  319. ._parameters_(params || [])
  320. ._dagChildren_([sequence]);
  321. },
  322. peg$c110 = function(selector) {
  323. return $globals.SendNode._new()
  324. ._location_(location())
  325. ._source_(text())
  326. ._selector_(selector);
  327. },
  328. peg$c111 = function(receiver, tail) {
  329. return receiver._withTail_(tail);
  330. },
  331. peg$c112 = function(selector, arg) {
  332. return $globals.SendNode._new()
  333. ._location_(location())
  334. ._source_(text())
  335. ._selector_(selector)
  336. ._arguments_([arg]);
  337. },
  338. peg$c113 = function(unarys, binarys) { return unarys.concat(binarys); },
  339. peg$c114 = function(pairs) {
  340. var selector = '';
  341. var args = [];
  342. for(var i = 0; i < pairs.length; i++) {
  343. selector += pairs[i].key;
  344. args.push(pairs[i].arg);
  345. }
  346. return $globals.SendNode._new()
  347. ._location_(location())
  348. ._source_(text())
  349. ._selector_(selector)
  350. ._arguments_(args);
  351. },
  352. peg$c115 = function(binarys, final) {
  353. if (final) binarys.push(final);
  354. return binarys;
  355. },
  356. peg$c116 = function(receiver, tail) {return tail.length > 0;},
  357. peg$c117 = ";",
  358. peg$c118 = peg$literalExpectation(";", false),
  359. peg$c119 = function(receiver, tail, mess) {return mess;},
  360. peg$c120 = function(receiver, tail, messages) {
  361. messages.unshift(receiver._withTail_(tail));
  362. return $globals.CascadeNode._new()
  363. ._location_(location())
  364. ._source_(text())
  365. ._dagChildren_(messages);
  366. },
  367. peg$c121 = function(pattern, sequence) {
  368. return $globals.MethodNode._new()
  369. ._location_(location())
  370. ._source_(text())
  371. ._selector_(pattern[0])
  372. ._arguments_(pattern[1])
  373. ._dagChildren_([sequence]);
  374. },
  375. peg$c122 = function(receiver, tail) { return tail.length > 0 && tail[tail.length-1]._selector() === '->' },
  376. peg$c123 = function(receiver, tail) {
  377. var last = tail.pop();
  378. return [receiver._withTail_(tail), last._arguments()[0]];
  379. },
  380. peg$c124 = function(first, others) {
  381. return first.concat.apply(first, others);
  382. },
  383. peg$currPos = 0,
  384. peg$savedPos = 0,
  385. peg$posDetailsCache = [{ line: 1, column: 1 }],
  386. peg$maxFailPos = 0,
  387. peg$maxFailExpected = [],
  388. peg$silentFails = 0,
  389. peg$resultsCache = {},
  390. peg$result;
  391. if ("startRule" in options) {
  392. if (!(options.startRule in peg$startRuleFunctions)) {
  393. throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
  394. }
  395. peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
  396. }
  397. function text() {
  398. return input.substring(peg$savedPos, peg$currPos);
  399. }
  400. function location() {
  401. return peg$computeLocation(peg$savedPos, peg$currPos);
  402. }
  403. function expected(description, location) {
  404. location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  405. throw peg$buildStructuredError(
  406. [peg$otherExpectation(description)],
  407. input.substring(peg$savedPos, peg$currPos),
  408. location
  409. );
  410. }
  411. function error(message, location) {
  412. location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
  413. throw peg$buildSimpleError(message, location);
  414. }
  415. function peg$literalExpectation(text, ignoreCase) {
  416. return { type: "literal", text: text, ignoreCase: ignoreCase };
  417. }
  418. function peg$classExpectation(parts, inverted, ignoreCase) {
  419. return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
  420. }
  421. function peg$anyExpectation() {
  422. return { type: "any" };
  423. }
  424. function peg$endExpectation() {
  425. return { type: "end" };
  426. }
  427. function peg$otherExpectation(description) {
  428. return { type: "other", description: description };
  429. }
  430. function peg$computePosDetails(pos) {
  431. var details = peg$posDetailsCache[pos], p;
  432. if (details) {
  433. return details;
  434. } else {
  435. p = pos - 1;
  436. while (!peg$posDetailsCache[p]) {
  437. p--;
  438. }
  439. details = peg$posDetailsCache[p];
  440. details = {
  441. line: details.line,
  442. column: details.column
  443. };
  444. while (p < pos) {
  445. if (input.charCodeAt(p) === 10) {
  446. details.line++;
  447. details.column = 1;
  448. } else {
  449. details.column++;
  450. }
  451. p++;
  452. }
  453. peg$posDetailsCache[pos] = details;
  454. return details;
  455. }
  456. }
  457. function peg$computeLocation(startPos, endPos) {
  458. var startPosDetails = peg$computePosDetails(startPos),
  459. endPosDetails = peg$computePosDetails(endPos);
  460. return {
  461. start: {
  462. offset: startPos,
  463. line: startPosDetails.line,
  464. column: startPosDetails.column
  465. },
  466. end: {
  467. offset: endPos,
  468. line: endPosDetails.line,
  469. column: endPosDetails.column
  470. }
  471. };
  472. }
  473. function peg$fail(expected) {
  474. if (peg$currPos < peg$maxFailPos) { return; }
  475. if (peg$currPos > peg$maxFailPos) {
  476. peg$maxFailPos = peg$currPos;
  477. peg$maxFailExpected = [];
  478. }
  479. peg$maxFailExpected.push(expected);
  480. }
  481. function peg$buildSimpleError(message, location) {
  482. return new peg$SyntaxError(message, null, null, location);
  483. }
  484. function peg$buildStructuredError(expected, found, location) {
  485. return new peg$SyntaxError(
  486. peg$SyntaxError.buildMessage(expected, found),
  487. expected,
  488. found,
  489. location
  490. );
  491. }
  492. function peg$parsestart() {
  493. var s0;
  494. var key = peg$currPos * 67 + 0,
  495. cached = peg$resultsCache[key];
  496. if (cached) {
  497. peg$currPos = cached.nextPos;
  498. return cached.result;
  499. }
  500. s0 = peg$parsemethod();
  501. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  502. return s0;
  503. }
  504. function peg$parseseparator() {
  505. var s0, s1;
  506. var key = peg$currPos * 67 + 1,
  507. cached = peg$resultsCache[key];
  508. if (cached) {
  509. peg$currPos = cached.nextPos;
  510. return cached.result;
  511. }
  512. s0 = [];
  513. if (peg$c0.test(input.charAt(peg$currPos))) {
  514. s1 = input.charAt(peg$currPos);
  515. peg$currPos++;
  516. } else {
  517. s1 = peg$FAILED;
  518. if (peg$silentFails === 0) { peg$fail(peg$c1); }
  519. }
  520. if (s1 !== peg$FAILED) {
  521. while (s1 !== peg$FAILED) {
  522. s0.push(s1);
  523. if (peg$c0.test(input.charAt(peg$currPos))) {
  524. s1 = input.charAt(peg$currPos);
  525. peg$currPos++;
  526. } else {
  527. s1 = peg$FAILED;
  528. if (peg$silentFails === 0) { peg$fail(peg$c1); }
  529. }
  530. }
  531. } else {
  532. s0 = peg$FAILED;
  533. }
  534. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  535. return s0;
  536. }
  537. function peg$parsecomments() {
  538. var s0, s1, s2, s3, s4;
  539. var key = peg$currPos * 67 + 2,
  540. cached = peg$resultsCache[key];
  541. if (cached) {
  542. peg$currPos = cached.nextPos;
  543. return cached.result;
  544. }
  545. s0 = [];
  546. s1 = peg$currPos;
  547. if (input.charCodeAt(peg$currPos) === 34) {
  548. s2 = peg$c2;
  549. peg$currPos++;
  550. } else {
  551. s2 = peg$FAILED;
  552. if (peg$silentFails === 0) { peg$fail(peg$c3); }
  553. }
  554. if (s2 !== peg$FAILED) {
  555. s3 = [];
  556. if (peg$c4.test(input.charAt(peg$currPos))) {
  557. s4 = input.charAt(peg$currPos);
  558. peg$currPos++;
  559. } else {
  560. s4 = peg$FAILED;
  561. if (peg$silentFails === 0) { peg$fail(peg$c5); }
  562. }
  563. while (s4 !== peg$FAILED) {
  564. s3.push(s4);
  565. if (peg$c4.test(input.charAt(peg$currPos))) {
  566. s4 = input.charAt(peg$currPos);
  567. peg$currPos++;
  568. } else {
  569. s4 = peg$FAILED;
  570. if (peg$silentFails === 0) { peg$fail(peg$c5); }
  571. }
  572. }
  573. if (s3 !== peg$FAILED) {
  574. if (input.charCodeAt(peg$currPos) === 34) {
  575. s4 = peg$c2;
  576. peg$currPos++;
  577. } else {
  578. s4 = peg$FAILED;
  579. if (peg$silentFails === 0) { peg$fail(peg$c3); }
  580. }
  581. if (s4 !== peg$FAILED) {
  582. s2 = [s2, s3, s4];
  583. s1 = s2;
  584. } else {
  585. peg$currPos = s1;
  586. s1 = peg$FAILED;
  587. }
  588. } else {
  589. peg$currPos = s1;
  590. s1 = peg$FAILED;
  591. }
  592. } else {
  593. peg$currPos = s1;
  594. s1 = peg$FAILED;
  595. }
  596. if (s1 !== peg$FAILED) {
  597. while (s1 !== peg$FAILED) {
  598. s0.push(s1);
  599. s1 = peg$currPos;
  600. if (input.charCodeAt(peg$currPos) === 34) {
  601. s2 = peg$c2;
  602. peg$currPos++;
  603. } else {
  604. s2 = peg$FAILED;
  605. if (peg$silentFails === 0) { peg$fail(peg$c3); }
  606. }
  607. if (s2 !== peg$FAILED) {
  608. s3 = [];
  609. if (peg$c4.test(input.charAt(peg$currPos))) {
  610. s4 = input.charAt(peg$currPos);
  611. peg$currPos++;
  612. } else {
  613. s4 = peg$FAILED;
  614. if (peg$silentFails === 0) { peg$fail(peg$c5); }
  615. }
  616. while (s4 !== peg$FAILED) {
  617. s3.push(s4);
  618. if (peg$c4.test(input.charAt(peg$currPos))) {
  619. s4 = input.charAt(peg$currPos);
  620. peg$currPos++;
  621. } else {
  622. s4 = peg$FAILED;
  623. if (peg$silentFails === 0) { peg$fail(peg$c5); }
  624. }
  625. }
  626. if (s3 !== peg$FAILED) {
  627. if (input.charCodeAt(peg$currPos) === 34) {
  628. s4 = peg$c2;
  629. peg$currPos++;
  630. } else {
  631. s4 = peg$FAILED;
  632. if (peg$silentFails === 0) { peg$fail(peg$c3); }
  633. }
  634. if (s4 !== peg$FAILED) {
  635. s2 = [s2, s3, s4];
  636. s1 = s2;
  637. } else {
  638. peg$currPos = s1;
  639. s1 = peg$FAILED;
  640. }
  641. } else {
  642. peg$currPos = s1;
  643. s1 = peg$FAILED;
  644. }
  645. } else {
  646. peg$currPos = s1;
  647. s1 = peg$FAILED;
  648. }
  649. }
  650. } else {
  651. s0 = peg$FAILED;
  652. }
  653. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  654. return s0;
  655. }
  656. function peg$parsews() {
  657. var s0, s1;
  658. var key = peg$currPos * 67 + 3,
  659. cached = peg$resultsCache[key];
  660. if (cached) {
  661. peg$currPos = cached.nextPos;
  662. return cached.result;
  663. }
  664. s0 = [];
  665. s1 = peg$parseseparator();
  666. if (s1 === peg$FAILED) {
  667. s1 = peg$parsecomments();
  668. }
  669. while (s1 !== peg$FAILED) {
  670. s0.push(s1);
  671. s1 = peg$parseseparator();
  672. if (s1 === peg$FAILED) {
  673. s1 = peg$parsecomments();
  674. }
  675. }
  676. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  677. return s0;
  678. }
  679. function peg$parsemaybeDotsWs() {
  680. var s0, s1;
  681. var key = peg$currPos * 67 + 4,
  682. cached = peg$resultsCache[key];
  683. if (cached) {
  684. peg$currPos = cached.nextPos;
  685. return cached.result;
  686. }
  687. s0 = [];
  688. if (input.charCodeAt(peg$currPos) === 46) {
  689. s1 = peg$c6;
  690. peg$currPos++;
  691. } else {
  692. s1 = peg$FAILED;
  693. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  694. }
  695. if (s1 === peg$FAILED) {
  696. s1 = peg$parseseparator();
  697. if (s1 === peg$FAILED) {
  698. s1 = peg$parsecomments();
  699. }
  700. }
  701. while (s1 !== peg$FAILED) {
  702. s0.push(s1);
  703. if (input.charCodeAt(peg$currPos) === 46) {
  704. s1 = peg$c6;
  705. peg$currPos++;
  706. } else {
  707. s1 = peg$FAILED;
  708. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  709. }
  710. if (s1 === peg$FAILED) {
  711. s1 = peg$parseseparator();
  712. if (s1 === peg$FAILED) {
  713. s1 = peg$parsecomments();
  714. }
  715. }
  716. }
  717. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  718. return s0;
  719. }
  720. function peg$parsesomeDotsWs() {
  721. var s0, s1, s2, s3;
  722. var key = peg$currPos * 67 + 5,
  723. cached = peg$resultsCache[key];
  724. if (cached) {
  725. peg$currPos = cached.nextPos;
  726. return cached.result;
  727. }
  728. s0 = peg$currPos;
  729. s1 = peg$parsews();
  730. if (s1 !== peg$FAILED) {
  731. if (input.charCodeAt(peg$currPos) === 46) {
  732. s2 = peg$c6;
  733. peg$currPos++;
  734. } else {
  735. s2 = peg$FAILED;
  736. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  737. }
  738. if (s2 !== peg$FAILED) {
  739. s3 = peg$parsemaybeDotsWs();
  740. if (s3 !== peg$FAILED) {
  741. s1 = [s1, s2, s3];
  742. s0 = s1;
  743. } else {
  744. peg$currPos = s0;
  745. s0 = peg$FAILED;
  746. }
  747. } else {
  748. peg$currPos = s0;
  749. s0 = peg$FAILED;
  750. }
  751. } else {
  752. peg$currPos = s0;
  753. s0 = peg$FAILED;
  754. }
  755. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  756. return s0;
  757. }
  758. function peg$parseidentifier() {
  759. var s0, s1, s2, s3, s4;
  760. var key = peg$currPos * 67 + 6,
  761. cached = peg$resultsCache[key];
  762. if (cached) {
  763. peg$currPos = cached.nextPos;
  764. return cached.result;
  765. }
  766. s0 = peg$currPos;
  767. s1 = peg$currPos;
  768. if (peg$c8.test(input.charAt(peg$currPos))) {
  769. s2 = input.charAt(peg$currPos);
  770. peg$currPos++;
  771. } else {
  772. s2 = peg$FAILED;
  773. if (peg$silentFails === 0) { peg$fail(peg$c9); }
  774. }
  775. if (s2 !== peg$FAILED) {
  776. s3 = [];
  777. if (peg$c10.test(input.charAt(peg$currPos))) {
  778. s4 = input.charAt(peg$currPos);
  779. peg$currPos++;
  780. } else {
  781. s4 = peg$FAILED;
  782. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  783. }
  784. while (s4 !== peg$FAILED) {
  785. s3.push(s4);
  786. if (peg$c10.test(input.charAt(peg$currPos))) {
  787. s4 = input.charAt(peg$currPos);
  788. peg$currPos++;
  789. } else {
  790. s4 = peg$FAILED;
  791. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  792. }
  793. }
  794. if (s3 !== peg$FAILED) {
  795. s2 = [s2, s3];
  796. s1 = s2;
  797. } else {
  798. peg$currPos = s1;
  799. s1 = peg$FAILED;
  800. }
  801. } else {
  802. peg$currPos = s1;
  803. s1 = peg$FAILED;
  804. }
  805. if (s1 !== peg$FAILED) {
  806. s0 = input.substring(s0, peg$currPos);
  807. } else {
  808. s0 = s1;
  809. }
  810. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  811. return s0;
  812. }
  813. function peg$parsekeyword() {
  814. var s0, s1, s2, s3;
  815. var key = peg$currPos * 67 + 7,
  816. cached = peg$resultsCache[key];
  817. if (cached) {
  818. peg$currPos = cached.nextPos;
  819. return cached.result;
  820. }
  821. s0 = peg$currPos;
  822. s1 = peg$currPos;
  823. s2 = peg$parseidentifier();
  824. if (s2 !== peg$FAILED) {
  825. if (input.charCodeAt(peg$currPos) === 58) {
  826. s3 = peg$c12;
  827. peg$currPos++;
  828. } else {
  829. s3 = peg$FAILED;
  830. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  831. }
  832. if (s3 !== peg$FAILED) {
  833. s2 = [s2, s3];
  834. s1 = s2;
  835. } else {
  836. peg$currPos = s1;
  837. s1 = peg$FAILED;
  838. }
  839. } else {
  840. peg$currPos = s1;
  841. s1 = peg$FAILED;
  842. }
  843. if (s1 !== peg$FAILED) {
  844. s0 = input.substring(s0, peg$currPos);
  845. } else {
  846. s0 = s1;
  847. }
  848. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  849. return s0;
  850. }
  851. function peg$parseclassName() {
  852. var s0, s1, s2, s3, s4;
  853. var key = peg$currPos * 67 + 8,
  854. cached = peg$resultsCache[key];
  855. if (cached) {
  856. peg$currPos = cached.nextPos;
  857. return cached.result;
  858. }
  859. s0 = peg$currPos;
  860. s1 = peg$currPos;
  861. if (peg$c14.test(input.charAt(peg$currPos))) {
  862. s2 = input.charAt(peg$currPos);
  863. peg$currPos++;
  864. } else {
  865. s2 = peg$FAILED;
  866. if (peg$silentFails === 0) { peg$fail(peg$c15); }
  867. }
  868. if (s2 !== peg$FAILED) {
  869. s3 = [];
  870. if (peg$c10.test(input.charAt(peg$currPos))) {
  871. s4 = input.charAt(peg$currPos);
  872. peg$currPos++;
  873. } else {
  874. s4 = peg$FAILED;
  875. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  876. }
  877. while (s4 !== peg$FAILED) {
  878. s3.push(s4);
  879. if (peg$c10.test(input.charAt(peg$currPos))) {
  880. s4 = input.charAt(peg$currPos);
  881. peg$currPos++;
  882. } else {
  883. s4 = peg$FAILED;
  884. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  885. }
  886. }
  887. if (s3 !== peg$FAILED) {
  888. s2 = [s2, s3];
  889. s1 = s2;
  890. } else {
  891. peg$currPos = s1;
  892. s1 = peg$FAILED;
  893. }
  894. } else {
  895. peg$currPos = s1;
  896. s1 = peg$FAILED;
  897. }
  898. if (s1 !== peg$FAILED) {
  899. s0 = input.substring(s0, peg$currPos);
  900. } else {
  901. s0 = s1;
  902. }
  903. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  904. return s0;
  905. }
  906. function peg$parsestring() {
  907. var s0, s1;
  908. var key = peg$currPos * 67 + 9,
  909. cached = peg$resultsCache[key];
  910. if (cached) {
  911. peg$currPos = cached.nextPos;
  912. return cached.result;
  913. }
  914. s0 = peg$currPos;
  915. s1 = peg$parserawString();
  916. if (s1 !== peg$FAILED) {
  917. peg$savedPos = s0;
  918. s1 = peg$c16(s1);
  919. }
  920. s0 = s1;
  921. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  922. return s0;
  923. }
  924. function peg$parserawString() {
  925. var s0, s1, s2, s3, s4;
  926. var key = peg$currPos * 67 + 10,
  927. cached = peg$resultsCache[key];
  928. if (cached) {
  929. peg$currPos = cached.nextPos;
  930. return cached.result;
  931. }
  932. s0 = peg$currPos;
  933. if (input.charCodeAt(peg$currPos) === 39) {
  934. s1 = peg$c17;
  935. peg$currPos++;
  936. } else {
  937. s1 = peg$FAILED;
  938. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  939. }
  940. if (s1 !== peg$FAILED) {
  941. s2 = [];
  942. s3 = peg$currPos;
  943. if (input.substr(peg$currPos, 2) === peg$c19) {
  944. s4 = peg$c19;
  945. peg$currPos += 2;
  946. } else {
  947. s4 = peg$FAILED;
  948. if (peg$silentFails === 0) { peg$fail(peg$c20); }
  949. }
  950. if (s4 !== peg$FAILED) {
  951. peg$savedPos = s3;
  952. s4 = peg$c21();
  953. }
  954. s3 = s4;
  955. if (s3 === peg$FAILED) {
  956. if (peg$c22.test(input.charAt(peg$currPos))) {
  957. s3 = input.charAt(peg$currPos);
  958. peg$currPos++;
  959. } else {
  960. s3 = peg$FAILED;
  961. if (peg$silentFails === 0) { peg$fail(peg$c23); }
  962. }
  963. }
  964. while (s3 !== peg$FAILED) {
  965. s2.push(s3);
  966. s3 = peg$currPos;
  967. if (input.substr(peg$currPos, 2) === peg$c19) {
  968. s4 = peg$c19;
  969. peg$currPos += 2;
  970. } else {
  971. s4 = peg$FAILED;
  972. if (peg$silentFails === 0) { peg$fail(peg$c20); }
  973. }
  974. if (s4 !== peg$FAILED) {
  975. peg$savedPos = s3;
  976. s4 = peg$c21();
  977. }
  978. s3 = s4;
  979. if (s3 === peg$FAILED) {
  980. if (peg$c22.test(input.charAt(peg$currPos))) {
  981. s3 = input.charAt(peg$currPos);
  982. peg$currPos++;
  983. } else {
  984. s3 = peg$FAILED;
  985. if (peg$silentFails === 0) { peg$fail(peg$c23); }
  986. }
  987. }
  988. }
  989. if (s2 !== peg$FAILED) {
  990. if (input.charCodeAt(peg$currPos) === 39) {
  991. s3 = peg$c17;
  992. peg$currPos++;
  993. } else {
  994. s3 = peg$FAILED;
  995. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  996. }
  997. if (s3 !== peg$FAILED) {
  998. peg$savedPos = s0;
  999. s1 = peg$c24(s2);
  1000. s0 = s1;
  1001. } else {
  1002. peg$currPos = s0;
  1003. s0 = peg$FAILED;
  1004. }
  1005. } else {
  1006. peg$currPos = s0;
  1007. s0 = peg$FAILED;
  1008. }
  1009. } else {
  1010. peg$currPos = s0;
  1011. s0 = peg$FAILED;
  1012. }
  1013. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1014. return s0;
  1015. }
  1016. function peg$parsecharacter() {
  1017. var s0, s1, s2;
  1018. var key = peg$currPos * 67 + 11,
  1019. cached = peg$resultsCache[key];
  1020. if (cached) {
  1021. peg$currPos = cached.nextPos;
  1022. return cached.result;
  1023. }
  1024. s0 = peg$currPos;
  1025. if (input.charCodeAt(peg$currPos) === 36) {
  1026. s1 = peg$c25;
  1027. peg$currPos++;
  1028. } else {
  1029. s1 = peg$FAILED;
  1030. if (peg$silentFails === 0) { peg$fail(peg$c26); }
  1031. }
  1032. if (s1 !== peg$FAILED) {
  1033. if (input.length > peg$currPos) {
  1034. s2 = input.charAt(peg$currPos);
  1035. peg$currPos++;
  1036. } else {
  1037. s2 = peg$FAILED;
  1038. if (peg$silentFails === 0) { peg$fail(peg$c27); }
  1039. }
  1040. if (s2 !== peg$FAILED) {
  1041. peg$savedPos = s0;
  1042. s1 = peg$c28(s2);
  1043. s0 = s1;
  1044. } else {
  1045. peg$currPos = s0;
  1046. s0 = peg$FAILED;
  1047. }
  1048. } else {
  1049. peg$currPos = s0;
  1050. s0 = peg$FAILED;
  1051. }
  1052. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1053. return s0;
  1054. }
  1055. function peg$parsesymbol() {
  1056. var s0, s1, s2;
  1057. var key = peg$currPos * 67 + 12,
  1058. cached = peg$resultsCache[key];
  1059. if (cached) {
  1060. peg$currPos = cached.nextPos;
  1061. return cached.result;
  1062. }
  1063. s0 = peg$currPos;
  1064. if (input.charCodeAt(peg$currPos) === 35) {
  1065. s1 = peg$c29;
  1066. peg$currPos++;
  1067. } else {
  1068. s1 = peg$FAILED;
  1069. if (peg$silentFails === 0) { peg$fail(peg$c30); }
  1070. }
  1071. if (s1 !== peg$FAILED) {
  1072. s2 = peg$parsebareSymbol();
  1073. if (s2 !== peg$FAILED) {
  1074. peg$savedPos = s0;
  1075. s1 = peg$c31(s2);
  1076. s0 = s1;
  1077. } else {
  1078. peg$currPos = s0;
  1079. s0 = peg$FAILED;
  1080. }
  1081. } else {
  1082. peg$currPos = s0;
  1083. s0 = peg$FAILED;
  1084. }
  1085. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1086. return s0;
  1087. }
  1088. function peg$parsebareSymbol() {
  1089. var s0, s1, s2, s3;
  1090. var key = peg$currPos * 67 + 13,
  1091. cached = peg$resultsCache[key];
  1092. if (cached) {
  1093. peg$currPos = cached.nextPos;
  1094. return cached.result;
  1095. }
  1096. s0 = peg$currPos;
  1097. s1 = peg$currPos;
  1098. s2 = [];
  1099. s3 = peg$parsekeyword();
  1100. if (s3 !== peg$FAILED) {
  1101. while (s3 !== peg$FAILED) {
  1102. s2.push(s3);
  1103. s3 = peg$parsekeyword();
  1104. }
  1105. } else {
  1106. s2 = peg$FAILED;
  1107. }
  1108. if (s2 !== peg$FAILED) {
  1109. s1 = input.substring(s1, peg$currPos);
  1110. } else {
  1111. s1 = s2;
  1112. }
  1113. if (s1 === peg$FAILED) {
  1114. s1 = peg$parsebinarySelector();
  1115. if (s1 === peg$FAILED) {
  1116. s1 = peg$parseidentifier();
  1117. if (s1 === peg$FAILED) {
  1118. s1 = peg$parserawString();
  1119. }
  1120. }
  1121. }
  1122. if (s1 !== peg$FAILED) {
  1123. peg$savedPos = s0;
  1124. s1 = peg$c16(s1);
  1125. }
  1126. s0 = s1;
  1127. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1128. return s0;
  1129. }
  1130. function peg$parsenumber() {
  1131. var s0, s1;
  1132. var key = peg$currPos * 67 + 14,
  1133. cached = peg$resultsCache[key];
  1134. if (cached) {
  1135. peg$currPos = cached.nextPos;
  1136. return cached.result;
  1137. }
  1138. s0 = peg$currPos;
  1139. s1 = peg$parserawNumber();
  1140. if (s1 !== peg$FAILED) {
  1141. peg$savedPos = s0;
  1142. s1 = peg$c16(s1);
  1143. }
  1144. s0 = s1;
  1145. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1146. return s0;
  1147. }
  1148. function peg$parserawNumber() {
  1149. var s0;
  1150. var key = peg$currPos * 67 + 15,
  1151. cached = peg$resultsCache[key];
  1152. if (cached) {
  1153. peg$currPos = cached.nextPos;
  1154. return cached.result;
  1155. }
  1156. s0 = peg$parsenumberExp();
  1157. if (s0 === peg$FAILED) {
  1158. s0 = peg$parsehex();
  1159. if (s0 === peg$FAILED) {
  1160. s0 = peg$parsefloat();
  1161. if (s0 === peg$FAILED) {
  1162. s0 = peg$parseinteger();
  1163. }
  1164. }
  1165. }
  1166. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1167. return s0;
  1168. }
  1169. function peg$parsenumberExp() {
  1170. var s0, s1, s2, s3, s4, s5;
  1171. var key = peg$currPos * 67 + 16,
  1172. cached = peg$resultsCache[key];
  1173. if (cached) {
  1174. peg$currPos = cached.nextPos;
  1175. return cached.result;
  1176. }
  1177. s0 = peg$currPos;
  1178. s1 = peg$currPos;
  1179. s2 = peg$currPos;
  1180. s3 = peg$parsefloat();
  1181. if (s3 === peg$FAILED) {
  1182. s3 = peg$parseinteger();
  1183. }
  1184. if (s3 !== peg$FAILED) {
  1185. if (input.charCodeAt(peg$currPos) === 101) {
  1186. s4 = peg$c32;
  1187. peg$currPos++;
  1188. } else {
  1189. s4 = peg$FAILED;
  1190. if (peg$silentFails === 0) { peg$fail(peg$c33); }
  1191. }
  1192. if (s4 !== peg$FAILED) {
  1193. s5 = peg$parseinteger();
  1194. if (s5 !== peg$FAILED) {
  1195. s3 = [s3, s4, s5];
  1196. s2 = s3;
  1197. } else {
  1198. peg$currPos = s2;
  1199. s2 = peg$FAILED;
  1200. }
  1201. } else {
  1202. peg$currPos = s2;
  1203. s2 = peg$FAILED;
  1204. }
  1205. } else {
  1206. peg$currPos = s2;
  1207. s2 = peg$FAILED;
  1208. }
  1209. if (s2 !== peg$FAILED) {
  1210. s1 = input.substring(s1, peg$currPos);
  1211. } else {
  1212. s1 = s2;
  1213. }
  1214. if (s1 !== peg$FAILED) {
  1215. peg$savedPos = s0;
  1216. s1 = peg$c34(s1);
  1217. }
  1218. s0 = s1;
  1219. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1220. return s0;
  1221. }
  1222. function peg$parsehex() {
  1223. var s0, s1, s2, s3, s4, s5;
  1224. var key = peg$currPos * 67 + 17,
  1225. cached = peg$resultsCache[key];
  1226. if (cached) {
  1227. peg$currPos = cached.nextPos;
  1228. return cached.result;
  1229. }
  1230. s0 = peg$currPos;
  1231. if (input.charCodeAt(peg$currPos) === 45) {
  1232. s1 = peg$c35;
  1233. peg$currPos++;
  1234. } else {
  1235. s1 = peg$FAILED;
  1236. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1237. }
  1238. if (s1 === peg$FAILED) {
  1239. s1 = null;
  1240. }
  1241. if (s1 !== peg$FAILED) {
  1242. if (input.substr(peg$currPos, 3) === peg$c37) {
  1243. s2 = peg$c37;
  1244. peg$currPos += 3;
  1245. } else {
  1246. s2 = peg$FAILED;
  1247. if (peg$silentFails === 0) { peg$fail(peg$c38); }
  1248. }
  1249. if (s2 !== peg$FAILED) {
  1250. s3 = peg$currPos;
  1251. s4 = [];
  1252. if (peg$c39.test(input.charAt(peg$currPos))) {
  1253. s5 = input.charAt(peg$currPos);
  1254. peg$currPos++;
  1255. } else {
  1256. s5 = peg$FAILED;
  1257. if (peg$silentFails === 0) { peg$fail(peg$c40); }
  1258. }
  1259. if (s5 !== peg$FAILED) {
  1260. while (s5 !== peg$FAILED) {
  1261. s4.push(s5);
  1262. if (peg$c39.test(input.charAt(peg$currPos))) {
  1263. s5 = input.charAt(peg$currPos);
  1264. peg$currPos++;
  1265. } else {
  1266. s5 = peg$FAILED;
  1267. if (peg$silentFails === 0) { peg$fail(peg$c40); }
  1268. }
  1269. }
  1270. } else {
  1271. s4 = peg$FAILED;
  1272. }
  1273. if (s4 !== peg$FAILED) {
  1274. s3 = input.substring(s3, peg$currPos);
  1275. } else {
  1276. s3 = s4;
  1277. }
  1278. if (s3 !== peg$FAILED) {
  1279. peg$savedPos = s0;
  1280. s1 = peg$c41(s1, s3);
  1281. s0 = s1;
  1282. } else {
  1283. peg$currPos = s0;
  1284. s0 = peg$FAILED;
  1285. }
  1286. } else {
  1287. peg$currPos = s0;
  1288. s0 = peg$FAILED;
  1289. }
  1290. } else {
  1291. peg$currPos = s0;
  1292. s0 = peg$FAILED;
  1293. }
  1294. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1295. return s0;
  1296. }
  1297. function peg$parsefloat() {
  1298. var s0, s1, s2, s3, s4, s5, s6, s7;
  1299. var key = peg$currPos * 67 + 18,
  1300. cached = peg$resultsCache[key];
  1301. if (cached) {
  1302. peg$currPos = cached.nextPos;
  1303. return cached.result;
  1304. }
  1305. s0 = peg$currPos;
  1306. s1 = peg$currPos;
  1307. s2 = peg$currPos;
  1308. if (input.charCodeAt(peg$currPos) === 45) {
  1309. s3 = peg$c35;
  1310. peg$currPos++;
  1311. } else {
  1312. s3 = peg$FAILED;
  1313. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1314. }
  1315. if (s3 === peg$FAILED) {
  1316. s3 = null;
  1317. }
  1318. if (s3 !== peg$FAILED) {
  1319. s4 = [];
  1320. if (peg$c42.test(input.charAt(peg$currPos))) {
  1321. s5 = input.charAt(peg$currPos);
  1322. peg$currPos++;
  1323. } else {
  1324. s5 = peg$FAILED;
  1325. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1326. }
  1327. if (s5 !== peg$FAILED) {
  1328. while (s5 !== peg$FAILED) {
  1329. s4.push(s5);
  1330. if (peg$c42.test(input.charAt(peg$currPos))) {
  1331. s5 = input.charAt(peg$currPos);
  1332. peg$currPos++;
  1333. } else {
  1334. s5 = peg$FAILED;
  1335. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1336. }
  1337. }
  1338. } else {
  1339. s4 = peg$FAILED;
  1340. }
  1341. if (s4 !== peg$FAILED) {
  1342. if (input.charCodeAt(peg$currPos) === 46) {
  1343. s5 = peg$c6;
  1344. peg$currPos++;
  1345. } else {
  1346. s5 = peg$FAILED;
  1347. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  1348. }
  1349. if (s5 !== peg$FAILED) {
  1350. s6 = [];
  1351. if (peg$c42.test(input.charAt(peg$currPos))) {
  1352. s7 = input.charAt(peg$currPos);
  1353. peg$currPos++;
  1354. } else {
  1355. s7 = peg$FAILED;
  1356. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1357. }
  1358. if (s7 !== peg$FAILED) {
  1359. while (s7 !== peg$FAILED) {
  1360. s6.push(s7);
  1361. if (peg$c42.test(input.charAt(peg$currPos))) {
  1362. s7 = input.charAt(peg$currPos);
  1363. peg$currPos++;
  1364. } else {
  1365. s7 = peg$FAILED;
  1366. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1367. }
  1368. }
  1369. } else {
  1370. s6 = peg$FAILED;
  1371. }
  1372. if (s6 !== peg$FAILED) {
  1373. s3 = [s3, s4, s5, s6];
  1374. s2 = s3;
  1375. } else {
  1376. peg$currPos = s2;
  1377. s2 = peg$FAILED;
  1378. }
  1379. } else {
  1380. peg$currPos = s2;
  1381. s2 = peg$FAILED;
  1382. }
  1383. } else {
  1384. peg$currPos = s2;
  1385. s2 = peg$FAILED;
  1386. }
  1387. } else {
  1388. peg$currPos = s2;
  1389. s2 = peg$FAILED;
  1390. }
  1391. if (s2 !== peg$FAILED) {
  1392. s1 = input.substring(s1, peg$currPos);
  1393. } else {
  1394. s1 = s2;
  1395. }
  1396. if (s1 !== peg$FAILED) {
  1397. peg$savedPos = s0;
  1398. s1 = peg$c44(s1);
  1399. }
  1400. s0 = s1;
  1401. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1402. return s0;
  1403. }
  1404. function peg$parseinteger() {
  1405. var s0, s1, s2, s3, s4, s5;
  1406. var key = peg$currPos * 67 + 19,
  1407. cached = peg$resultsCache[key];
  1408. if (cached) {
  1409. peg$currPos = cached.nextPos;
  1410. return cached.result;
  1411. }
  1412. s0 = peg$currPos;
  1413. s1 = peg$currPos;
  1414. s2 = peg$currPos;
  1415. if (input.charCodeAt(peg$currPos) === 45) {
  1416. s3 = peg$c35;
  1417. peg$currPos++;
  1418. } else {
  1419. s3 = peg$FAILED;
  1420. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1421. }
  1422. if (s3 === peg$FAILED) {
  1423. s3 = null;
  1424. }
  1425. if (s3 !== peg$FAILED) {
  1426. s4 = [];
  1427. if (peg$c42.test(input.charAt(peg$currPos))) {
  1428. s5 = input.charAt(peg$currPos);
  1429. peg$currPos++;
  1430. } else {
  1431. s5 = peg$FAILED;
  1432. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1433. }
  1434. if (s5 !== peg$FAILED) {
  1435. while (s5 !== peg$FAILED) {
  1436. s4.push(s5);
  1437. if (peg$c42.test(input.charAt(peg$currPos))) {
  1438. s5 = input.charAt(peg$currPos);
  1439. peg$currPos++;
  1440. } else {
  1441. s5 = peg$FAILED;
  1442. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1443. }
  1444. }
  1445. } else {
  1446. s4 = peg$FAILED;
  1447. }
  1448. if (s4 !== peg$FAILED) {
  1449. s3 = [s3, s4];
  1450. s2 = s3;
  1451. } else {
  1452. peg$currPos = s2;
  1453. s2 = peg$FAILED;
  1454. }
  1455. } else {
  1456. peg$currPos = s2;
  1457. s2 = peg$FAILED;
  1458. }
  1459. if (s2 !== peg$FAILED) {
  1460. s1 = input.substring(s1, peg$currPos);
  1461. } else {
  1462. s1 = s2;
  1463. }
  1464. if (s1 !== peg$FAILED) {
  1465. peg$savedPos = s0;
  1466. s1 = peg$c45(s1);
  1467. }
  1468. s0 = s1;
  1469. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1470. return s0;
  1471. }
  1472. function peg$parseliteralArray() {
  1473. var s0, s1, s2, s3, s4;
  1474. var key = peg$currPos * 67 + 20,
  1475. cached = peg$resultsCache[key];
  1476. if (cached) {
  1477. peg$currPos = cached.nextPos;
  1478. return cached.result;
  1479. }
  1480. s0 = peg$currPos;
  1481. if (input.substr(peg$currPos, 2) === peg$c46) {
  1482. s1 = peg$c46;
  1483. peg$currPos += 2;
  1484. } else {
  1485. s1 = peg$FAILED;
  1486. if (peg$silentFails === 0) { peg$fail(peg$c47); }
  1487. }
  1488. if (s1 !== peg$FAILED) {
  1489. s2 = peg$parsewsLiteralArrayContents();
  1490. if (s2 !== peg$FAILED) {
  1491. s3 = peg$parsews();
  1492. if (s3 !== peg$FAILED) {
  1493. if (input.charCodeAt(peg$currPos) === 41) {
  1494. s4 = peg$c48;
  1495. peg$currPos++;
  1496. } else {
  1497. s4 = peg$FAILED;
  1498. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  1499. }
  1500. if (s4 !== peg$FAILED) {
  1501. peg$savedPos = s0;
  1502. s1 = peg$c50(s2);
  1503. s0 = s1;
  1504. } else {
  1505. peg$currPos = s0;
  1506. s0 = peg$FAILED;
  1507. }
  1508. } else {
  1509. peg$currPos = s0;
  1510. s0 = peg$FAILED;
  1511. }
  1512. } else {
  1513. peg$currPos = s0;
  1514. s0 = peg$FAILED;
  1515. }
  1516. } else {
  1517. peg$currPos = s0;
  1518. s0 = peg$FAILED;
  1519. }
  1520. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1521. return s0;
  1522. }
  1523. function peg$parsebareLiteralArray() {
  1524. var s0, s1, s2, s3, s4;
  1525. var key = peg$currPos * 67 + 21,
  1526. cached = peg$resultsCache[key];
  1527. if (cached) {
  1528. peg$currPos = cached.nextPos;
  1529. return cached.result;
  1530. }
  1531. s0 = peg$currPos;
  1532. if (input.charCodeAt(peg$currPos) === 40) {
  1533. s1 = peg$c51;
  1534. peg$currPos++;
  1535. } else {
  1536. s1 = peg$FAILED;
  1537. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  1538. }
  1539. if (s1 !== peg$FAILED) {
  1540. s2 = peg$parsewsLiteralArrayContents();
  1541. if (s2 !== peg$FAILED) {
  1542. s3 = peg$parsews();
  1543. if (s3 !== peg$FAILED) {
  1544. if (input.charCodeAt(peg$currPos) === 41) {
  1545. s4 = peg$c48;
  1546. peg$currPos++;
  1547. } else {
  1548. s4 = peg$FAILED;
  1549. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  1550. }
  1551. if (s4 !== peg$FAILED) {
  1552. peg$savedPos = s0;
  1553. s1 = peg$c50(s2);
  1554. s0 = s1;
  1555. } else {
  1556. peg$currPos = s0;
  1557. s0 = peg$FAILED;
  1558. }
  1559. } else {
  1560. peg$currPos = s0;
  1561. s0 = peg$FAILED;
  1562. }
  1563. } else {
  1564. peg$currPos = s0;
  1565. s0 = peg$FAILED;
  1566. }
  1567. } else {
  1568. peg$currPos = s0;
  1569. s0 = peg$FAILED;
  1570. }
  1571. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1572. return s0;
  1573. }
  1574. function peg$parseliteralArrayElement() {
  1575. var s0;
  1576. var key = peg$currPos * 67 + 22,
  1577. cached = peg$resultsCache[key];
  1578. if (cached) {
  1579. peg$currPos = cached.nextPos;
  1580. return cached.result;
  1581. }
  1582. s0 = peg$parseparseTimeLiteral();
  1583. if (s0 === peg$FAILED) {
  1584. s0 = peg$parsebareLiteralArray();
  1585. if (s0 === peg$FAILED) {
  1586. s0 = peg$parsebareSymbol();
  1587. }
  1588. }
  1589. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1590. return s0;
  1591. }
  1592. function peg$parsewsLiteralArrayContents() {
  1593. var s0, s1, s2, s3, s4;
  1594. var key = peg$currPos * 67 + 23,
  1595. cached = peg$resultsCache[key];
  1596. if (cached) {
  1597. peg$currPos = cached.nextPos;
  1598. return cached.result;
  1599. }
  1600. s0 = peg$currPos;
  1601. s1 = [];
  1602. s2 = peg$currPos;
  1603. s3 = peg$parsews();
  1604. if (s3 !== peg$FAILED) {
  1605. s4 = peg$parseliteralArrayElement();
  1606. if (s4 !== peg$FAILED) {
  1607. peg$savedPos = s2;
  1608. s3 = peg$c53(s4);
  1609. s2 = s3;
  1610. } else {
  1611. peg$currPos = s2;
  1612. s2 = peg$FAILED;
  1613. }
  1614. } else {
  1615. peg$currPos = s2;
  1616. s2 = peg$FAILED;
  1617. }
  1618. while (s2 !== peg$FAILED) {
  1619. s1.push(s2);
  1620. s2 = peg$currPos;
  1621. s3 = peg$parsews();
  1622. if (s3 !== peg$FAILED) {
  1623. s4 = peg$parseliteralArrayElement();
  1624. if (s4 !== peg$FAILED) {
  1625. peg$savedPos = s2;
  1626. s3 = peg$c53(s4);
  1627. s2 = s3;
  1628. } else {
  1629. peg$currPos = s2;
  1630. s2 = peg$FAILED;
  1631. }
  1632. } else {
  1633. peg$currPos = s2;
  1634. s2 = peg$FAILED;
  1635. }
  1636. }
  1637. if (s1 !== peg$FAILED) {
  1638. peg$savedPos = s0;
  1639. s1 = peg$c54(s1);
  1640. }
  1641. s0 = s1;
  1642. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1643. return s0;
  1644. }
  1645. function peg$parsedynamicArray() {
  1646. var s0, s1, s2, s3, s4;
  1647. var key = peg$currPos * 67 + 24,
  1648. cached = peg$resultsCache[key];
  1649. if (cached) {
  1650. peg$currPos = cached.nextPos;
  1651. return cached.result;
  1652. }
  1653. s0 = peg$currPos;
  1654. if (input.charCodeAt(peg$currPos) === 123) {
  1655. s1 = peg$c55;
  1656. peg$currPos++;
  1657. } else {
  1658. s1 = peg$FAILED;
  1659. if (peg$silentFails === 0) { peg$fail(peg$c56); }
  1660. }
  1661. if (s1 !== peg$FAILED) {
  1662. s2 = peg$parsewsExpressions();
  1663. if (s2 === peg$FAILED) {
  1664. s2 = null;
  1665. }
  1666. if (s2 !== peg$FAILED) {
  1667. s3 = peg$parsemaybeDotsWs();
  1668. if (s3 !== peg$FAILED) {
  1669. if (input.charCodeAt(peg$currPos) === 125) {
  1670. s4 = peg$c57;
  1671. peg$currPos++;
  1672. } else {
  1673. s4 = peg$FAILED;
  1674. if (peg$silentFails === 0) { peg$fail(peg$c58); }
  1675. }
  1676. if (s4 !== peg$FAILED) {
  1677. peg$savedPos = s0;
  1678. s1 = peg$c59(s2);
  1679. s0 = s1;
  1680. } else {
  1681. peg$currPos = s0;
  1682. s0 = peg$FAILED;
  1683. }
  1684. } else {
  1685. peg$currPos = s0;
  1686. s0 = peg$FAILED;
  1687. }
  1688. } else {
  1689. peg$currPos = s0;
  1690. s0 = peg$FAILED;
  1691. }
  1692. } else {
  1693. peg$currPos = s0;
  1694. s0 = peg$FAILED;
  1695. }
  1696. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1697. return s0;
  1698. }
  1699. function peg$parsedynamicDictionary() {
  1700. var s0, s1, s2, s3, s4;
  1701. var key = peg$currPos * 67 + 25,
  1702. cached = peg$resultsCache[key];
  1703. if (cached) {
  1704. peg$currPos = cached.nextPos;
  1705. return cached.result;
  1706. }
  1707. s0 = peg$currPos;
  1708. if (input.substr(peg$currPos, 2) === peg$c60) {
  1709. s1 = peg$c60;
  1710. peg$currPos += 2;
  1711. } else {
  1712. s1 = peg$FAILED;
  1713. if (peg$silentFails === 0) { peg$fail(peg$c61); }
  1714. }
  1715. if (s1 !== peg$FAILED) {
  1716. s2 = peg$parsewsAssociations();
  1717. if (s2 === peg$FAILED) {
  1718. s2 = null;
  1719. }
  1720. if (s2 !== peg$FAILED) {
  1721. s3 = peg$parsemaybeDotsWs();
  1722. if (s3 !== peg$FAILED) {
  1723. if (input.charCodeAt(peg$currPos) === 125) {
  1724. s4 = peg$c57;
  1725. peg$currPos++;
  1726. } else {
  1727. s4 = peg$FAILED;
  1728. if (peg$silentFails === 0) { peg$fail(peg$c58); }
  1729. }
  1730. if (s4 !== peg$FAILED) {
  1731. peg$savedPos = s0;
  1732. s1 = peg$c62(s2);
  1733. s0 = s1;
  1734. } else {
  1735. peg$currPos = s0;
  1736. s0 = peg$FAILED;
  1737. }
  1738. } else {
  1739. peg$currPos = s0;
  1740. s0 = peg$FAILED;
  1741. }
  1742. } else {
  1743. peg$currPos = s0;
  1744. s0 = peg$FAILED;
  1745. }
  1746. } else {
  1747. peg$currPos = s0;
  1748. s0 = peg$FAILED;
  1749. }
  1750. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1751. return s0;
  1752. }
  1753. function peg$parsepseudoVariable() {
  1754. var s0, s1, s2;
  1755. var key = peg$currPos * 67 + 26,
  1756. cached = peg$resultsCache[key];
  1757. if (cached) {
  1758. peg$currPos = cached.nextPos;
  1759. return cached.result;
  1760. }
  1761. s0 = peg$currPos;
  1762. s1 = peg$currPos;
  1763. if (input.substr(peg$currPos, 4) === peg$c63) {
  1764. s2 = peg$c63;
  1765. peg$currPos += 4;
  1766. } else {
  1767. s2 = peg$FAILED;
  1768. if (peg$silentFails === 0) { peg$fail(peg$c64); }
  1769. }
  1770. if (s2 !== peg$FAILED) {
  1771. peg$savedPos = s1;
  1772. s2 = peg$c65();
  1773. }
  1774. s1 = s2;
  1775. if (s1 === peg$FAILED) {
  1776. s1 = peg$currPos;
  1777. if (input.substr(peg$currPos, 5) === peg$c66) {
  1778. s2 = peg$c66;
  1779. peg$currPos += 5;
  1780. } else {
  1781. s2 = peg$FAILED;
  1782. if (peg$silentFails === 0) { peg$fail(peg$c67); }
  1783. }
  1784. if (s2 !== peg$FAILED) {
  1785. peg$savedPos = s1;
  1786. s2 = peg$c68();
  1787. }
  1788. s1 = s2;
  1789. if (s1 === peg$FAILED) {
  1790. s1 = peg$currPos;
  1791. if (input.substr(peg$currPos, 3) === peg$c69) {
  1792. s2 = peg$c69;
  1793. peg$currPos += 3;
  1794. } else {
  1795. s2 = peg$FAILED;
  1796. if (peg$silentFails === 0) { peg$fail(peg$c70); }
  1797. }
  1798. if (s2 !== peg$FAILED) {
  1799. peg$savedPos = s1;
  1800. s2 = peg$c71();
  1801. }
  1802. s1 = s2;
  1803. }
  1804. }
  1805. if (s1 !== peg$FAILED) {
  1806. peg$savedPos = s0;
  1807. s1 = peg$c16(s1);
  1808. }
  1809. s0 = s1;
  1810. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1811. return s0;
  1812. }
  1813. function peg$parseparseTimeLiteral() {
  1814. var s0;
  1815. var key = peg$currPos * 67 + 27,
  1816. cached = peg$resultsCache[key];
  1817. if (cached) {
  1818. peg$currPos = cached.nextPos;
  1819. return cached.result;
  1820. }
  1821. s0 = peg$parsepseudoVariable();
  1822. if (s0 === peg$FAILED) {
  1823. s0 = peg$parsenumber();
  1824. if (s0 === peg$FAILED) {
  1825. s0 = peg$parseliteralArray();
  1826. if (s0 === peg$FAILED) {
  1827. s0 = peg$parsestring();
  1828. if (s0 === peg$FAILED) {
  1829. s0 = peg$parsesymbol();
  1830. if (s0 === peg$FAILED) {
  1831. s0 = peg$parsecharacter();
  1832. }
  1833. }
  1834. }
  1835. }
  1836. }
  1837. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1838. return s0;
  1839. }
  1840. function peg$parseruntimeLiteral() {
  1841. var s0;
  1842. var key = peg$currPos * 67 + 28,
  1843. cached = peg$resultsCache[key];
  1844. if (cached) {
  1845. peg$currPos = cached.nextPos;
  1846. return cached.result;
  1847. }
  1848. s0 = peg$parsedynamicDictionary();
  1849. if (s0 === peg$FAILED) {
  1850. s0 = peg$parsedynamicArray();
  1851. if (s0 === peg$FAILED) {
  1852. s0 = peg$parseblock();
  1853. }
  1854. }
  1855. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1856. return s0;
  1857. }
  1858. function peg$parseliteral() {
  1859. var s0;
  1860. var key = peg$currPos * 67 + 29,
  1861. cached = peg$resultsCache[key];
  1862. if (cached) {
  1863. peg$currPos = cached.nextPos;
  1864. return cached.result;
  1865. }
  1866. s0 = peg$parseruntimeLiteral();
  1867. if (s0 === peg$FAILED) {
  1868. s0 = peg$parseparseTimeLiteral();
  1869. }
  1870. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1871. return s0;
  1872. }
  1873. function peg$parsevariable() {
  1874. var s0, s1;
  1875. var key = peg$currPos * 67 + 30,
  1876. cached = peg$resultsCache[key];
  1877. if (cached) {
  1878. peg$currPos = cached.nextPos;
  1879. return cached.result;
  1880. }
  1881. s0 = peg$currPos;
  1882. s1 = peg$parseidentifier();
  1883. if (s1 !== peg$FAILED) {
  1884. peg$savedPos = s0;
  1885. s1 = peg$c72(s1);
  1886. }
  1887. s0 = s1;
  1888. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1889. return s0;
  1890. }
  1891. function peg$parsebinarySelector() {
  1892. var s0, s1, s2;
  1893. var key = peg$currPos * 67 + 31,
  1894. cached = peg$resultsCache[key];
  1895. if (cached) {
  1896. peg$currPos = cached.nextPos;
  1897. return cached.result;
  1898. }
  1899. s0 = peg$currPos;
  1900. s1 = [];
  1901. if (peg$c73.test(input.charAt(peg$currPos))) {
  1902. s2 = input.charAt(peg$currPos);
  1903. peg$currPos++;
  1904. } else {
  1905. s2 = peg$FAILED;
  1906. if (peg$silentFails === 0) { peg$fail(peg$c74); }
  1907. }
  1908. if (s2 !== peg$FAILED) {
  1909. while (s2 !== peg$FAILED) {
  1910. s1.push(s2);
  1911. if (peg$c73.test(input.charAt(peg$currPos))) {
  1912. s2 = input.charAt(peg$currPos);
  1913. peg$currPos++;
  1914. } else {
  1915. s2 = peg$FAILED;
  1916. if (peg$silentFails === 0) { peg$fail(peg$c74); }
  1917. }
  1918. }
  1919. } else {
  1920. s1 = peg$FAILED;
  1921. }
  1922. if (s1 !== peg$FAILED) {
  1923. s0 = input.substring(s0, peg$currPos);
  1924. } else {
  1925. s0 = s1;
  1926. }
  1927. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1928. return s0;
  1929. }
  1930. function peg$parsewsKeywordPattern() {
  1931. var s0, s1, s2, s3, s4, s5, s6;
  1932. var key = peg$currPos * 67 + 32,
  1933. cached = peg$resultsCache[key];
  1934. if (cached) {
  1935. peg$currPos = cached.nextPos;
  1936. return cached.result;
  1937. }
  1938. s0 = peg$currPos;
  1939. s1 = [];
  1940. s2 = peg$currPos;
  1941. s3 = peg$parsews();
  1942. if (s3 !== peg$FAILED) {
  1943. s4 = peg$parsekeyword();
  1944. if (s4 !== peg$FAILED) {
  1945. s5 = peg$parsews();
  1946. if (s5 !== peg$FAILED) {
  1947. s6 = peg$parseidentifier();
  1948. if (s6 !== peg$FAILED) {
  1949. peg$savedPos = s2;
  1950. s3 = peg$c75(s4, s6);
  1951. s2 = s3;
  1952. } else {
  1953. peg$currPos = s2;
  1954. s2 = peg$FAILED;
  1955. }
  1956. } else {
  1957. peg$currPos = s2;
  1958. s2 = peg$FAILED;
  1959. }
  1960. } else {
  1961. peg$currPos = s2;
  1962. s2 = peg$FAILED;
  1963. }
  1964. } else {
  1965. peg$currPos = s2;
  1966. s2 = peg$FAILED;
  1967. }
  1968. if (s2 !== peg$FAILED) {
  1969. while (s2 !== peg$FAILED) {
  1970. s1.push(s2);
  1971. s2 = peg$currPos;
  1972. s3 = peg$parsews();
  1973. if (s3 !== peg$FAILED) {
  1974. s4 = peg$parsekeyword();
  1975. if (s4 !== peg$FAILED) {
  1976. s5 = peg$parsews();
  1977. if (s5 !== peg$FAILED) {
  1978. s6 = peg$parseidentifier();
  1979. if (s6 !== peg$FAILED) {
  1980. peg$savedPos = s2;
  1981. s3 = peg$c75(s4, s6);
  1982. s2 = s3;
  1983. } else {
  1984. peg$currPos = s2;
  1985. s2 = peg$FAILED;
  1986. }
  1987. } else {
  1988. peg$currPos = s2;
  1989. s2 = peg$FAILED;
  1990. }
  1991. } else {
  1992. peg$currPos = s2;
  1993. s2 = peg$FAILED;
  1994. }
  1995. } else {
  1996. peg$currPos = s2;
  1997. s2 = peg$FAILED;
  1998. }
  1999. }
  2000. } else {
  2001. s1 = peg$FAILED;
  2002. }
  2003. if (s1 !== peg$FAILED) {
  2004. peg$savedPos = s0;
  2005. s1 = peg$c76(s1);
  2006. }
  2007. s0 = s1;
  2008. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2009. return s0;
  2010. }
  2011. function peg$parsewsBinaryPattern() {
  2012. var s0, s1, s2, s3, s4;
  2013. var key = peg$currPos * 67 + 33,
  2014. cached = peg$resultsCache[key];
  2015. if (cached) {
  2016. peg$currPos = cached.nextPos;
  2017. return cached.result;
  2018. }
  2019. s0 = peg$currPos;
  2020. s1 = peg$parsews();
  2021. if (s1 !== peg$FAILED) {
  2022. s2 = peg$parsebinarySelector();
  2023. if (s2 !== peg$FAILED) {
  2024. s3 = peg$parsews();
  2025. if (s3 !== peg$FAILED) {
  2026. s4 = peg$parseidentifier();
  2027. if (s4 !== peg$FAILED) {
  2028. peg$savedPos = s0;
  2029. s1 = peg$c77(s2, s4);
  2030. s0 = s1;
  2031. } else {
  2032. peg$currPos = s0;
  2033. s0 = peg$FAILED;
  2034. }
  2035. } else {
  2036. peg$currPos = s0;
  2037. s0 = peg$FAILED;
  2038. }
  2039. } else {
  2040. peg$currPos = s0;
  2041. s0 = peg$FAILED;
  2042. }
  2043. } else {
  2044. peg$currPos = s0;
  2045. s0 = peg$FAILED;
  2046. }
  2047. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2048. return s0;
  2049. }
  2050. function peg$parsewsUnaryPattern() {
  2051. var s0, s1, s2;
  2052. var key = peg$currPos * 67 + 34,
  2053. cached = peg$resultsCache[key];
  2054. if (cached) {
  2055. peg$currPos = cached.nextPos;
  2056. return cached.result;
  2057. }
  2058. s0 = peg$currPos;
  2059. s1 = peg$parsews();
  2060. if (s1 !== peg$FAILED) {
  2061. s2 = peg$parseidentifier();
  2062. if (s2 !== peg$FAILED) {
  2063. peg$savedPos = s0;
  2064. s1 = peg$c78(s2);
  2065. s0 = s1;
  2066. } else {
  2067. peg$currPos = s0;
  2068. s0 = peg$FAILED;
  2069. }
  2070. } else {
  2071. peg$currPos = s0;
  2072. s0 = peg$FAILED;
  2073. }
  2074. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2075. return s0;
  2076. }
  2077. function peg$parseexpression() {
  2078. var s0;
  2079. var key = peg$currPos * 67 + 35,
  2080. cached = peg$resultsCache[key];
  2081. if (cached) {
  2082. peg$currPos = cached.nextPos;
  2083. return cached.result;
  2084. }
  2085. s0 = peg$parseassignment();
  2086. if (s0 === peg$FAILED) {
  2087. s0 = peg$parsecascade();
  2088. if (s0 === peg$FAILED) {
  2089. s0 = peg$parsekeywordSend();
  2090. }
  2091. }
  2092. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2093. return s0;
  2094. }
  2095. function peg$parsewsExpressionsRest() {
  2096. var s0, s1, s2;
  2097. var key = peg$currPos * 67 + 36,
  2098. cached = peg$resultsCache[key];
  2099. if (cached) {
  2100. peg$currPos = cached.nextPos;
  2101. return cached.result;
  2102. }
  2103. s0 = peg$currPos;
  2104. s1 = peg$parsesomeDotsWs();
  2105. if (s1 !== peg$FAILED) {
  2106. s2 = peg$parseexpression();
  2107. if (s2 !== peg$FAILED) {
  2108. peg$savedPos = s0;
  2109. s1 = peg$c79(s2);
  2110. s0 = s1;
  2111. } else {
  2112. peg$currPos = s0;
  2113. s0 = peg$FAILED;
  2114. }
  2115. } else {
  2116. peg$currPos = s0;
  2117. s0 = peg$FAILED;
  2118. }
  2119. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2120. return s0;
  2121. }
  2122. function peg$parsewsExpressions() {
  2123. var s0, s1, s2, s3, s4;
  2124. var key = peg$currPos * 67 + 37,
  2125. cached = peg$resultsCache[key];
  2126. if (cached) {
  2127. peg$currPos = cached.nextPos;
  2128. return cached.result;
  2129. }
  2130. s0 = peg$currPos;
  2131. s1 = peg$parsemaybeDotsWs();
  2132. if (s1 !== peg$FAILED) {
  2133. s2 = peg$parseexpression();
  2134. if (s2 !== peg$FAILED) {
  2135. s3 = [];
  2136. s4 = peg$parsewsExpressionsRest();
  2137. while (s4 !== peg$FAILED) {
  2138. s3.push(s4);
  2139. s4 = peg$parsewsExpressionsRest();
  2140. }
  2141. if (s3 !== peg$FAILED) {
  2142. peg$savedPos = s0;
  2143. s1 = peg$c80(s2, s3);
  2144. s0 = s1;
  2145. } else {
  2146. peg$currPos = s0;
  2147. s0 = peg$FAILED;
  2148. }
  2149. } else {
  2150. peg$currPos = s0;
  2151. s0 = peg$FAILED;
  2152. }
  2153. } else {
  2154. peg$currPos = s0;
  2155. s0 = peg$FAILED;
  2156. }
  2157. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2158. return s0;
  2159. }
  2160. function peg$parsewsUnaryPragmaMessage() {
  2161. var s0, s1, s2, s3, s4;
  2162. var key = peg$currPos * 67 + 38,
  2163. cached = peg$resultsCache[key];
  2164. if (cached) {
  2165. peg$currPos = cached.nextPos;
  2166. return cached.result;
  2167. }
  2168. s0 = peg$currPos;
  2169. s1 = peg$parsews();
  2170. if (s1 !== peg$FAILED) {
  2171. s2 = peg$parseidentifier();
  2172. if (s2 !== peg$FAILED) {
  2173. s3 = peg$currPos;
  2174. peg$silentFails++;
  2175. if (input.charCodeAt(peg$currPos) === 58) {
  2176. s4 = peg$c12;
  2177. peg$currPos++;
  2178. } else {
  2179. s4 = peg$FAILED;
  2180. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2181. }
  2182. peg$silentFails--;
  2183. if (s4 === peg$FAILED) {
  2184. s3 = void 0;
  2185. } else {
  2186. peg$currPos = s3;
  2187. s3 = peg$FAILED;
  2188. }
  2189. if (s3 !== peg$FAILED) {
  2190. peg$savedPos = s0;
  2191. s1 = peg$c81(s2);
  2192. s0 = s1;
  2193. } else {
  2194. peg$currPos = s0;
  2195. s0 = peg$FAILED;
  2196. }
  2197. } else {
  2198. peg$currPos = s0;
  2199. s0 = peg$FAILED;
  2200. }
  2201. } else {
  2202. peg$currPos = s0;
  2203. s0 = peg$FAILED;
  2204. }
  2205. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2206. return s0;
  2207. }
  2208. function peg$parsewsKeywordPragmaMessage() {
  2209. var s0, s1, s2, s3, s4, s5, s6;
  2210. var key = peg$currPos * 67 + 39,
  2211. cached = peg$resultsCache[key];
  2212. if (cached) {
  2213. peg$currPos = cached.nextPos;
  2214. return cached.result;
  2215. }
  2216. s0 = peg$currPos;
  2217. s1 = [];
  2218. s2 = peg$currPos;
  2219. s3 = peg$parsews();
  2220. if (s3 !== peg$FAILED) {
  2221. s4 = peg$parsekeyword();
  2222. if (s4 !== peg$FAILED) {
  2223. s5 = peg$parsews();
  2224. if (s5 !== peg$FAILED) {
  2225. s6 = peg$parseparseTimeLiteral();
  2226. if (s6 !== peg$FAILED) {
  2227. peg$savedPos = s2;
  2228. s3 = peg$c75(s4, s6);
  2229. s2 = s3;
  2230. } else {
  2231. peg$currPos = s2;
  2232. s2 = peg$FAILED;
  2233. }
  2234. } else {
  2235. peg$currPos = s2;
  2236. s2 = peg$FAILED;
  2237. }
  2238. } else {
  2239. peg$currPos = s2;
  2240. s2 = peg$FAILED;
  2241. }
  2242. } else {
  2243. peg$currPos = s2;
  2244. s2 = peg$FAILED;
  2245. }
  2246. if (s2 !== peg$FAILED) {
  2247. while (s2 !== peg$FAILED) {
  2248. s1.push(s2);
  2249. s2 = peg$currPos;
  2250. s3 = peg$parsews();
  2251. if (s3 !== peg$FAILED) {
  2252. s4 = peg$parsekeyword();
  2253. if (s4 !== peg$FAILED) {
  2254. s5 = peg$parsews();
  2255. if (s5 !== peg$FAILED) {
  2256. s6 = peg$parseparseTimeLiteral();
  2257. if (s6 !== peg$FAILED) {
  2258. peg$savedPos = s2;
  2259. s3 = peg$c75(s4, s6);
  2260. s2 = s3;
  2261. } else {
  2262. peg$currPos = s2;
  2263. s2 = peg$FAILED;
  2264. }
  2265. } else {
  2266. peg$currPos = s2;
  2267. s2 = peg$FAILED;
  2268. }
  2269. } else {
  2270. peg$currPos = s2;
  2271. s2 = peg$FAILED;
  2272. }
  2273. } else {
  2274. peg$currPos = s2;
  2275. s2 = peg$FAILED;
  2276. }
  2277. }
  2278. } else {
  2279. s1 = peg$FAILED;
  2280. }
  2281. if (s1 !== peg$FAILED) {
  2282. peg$savedPos = s0;
  2283. s1 = peg$c82(s1);
  2284. }
  2285. s0 = s1;
  2286. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2287. return s0;
  2288. }
  2289. function peg$parsewsPragmaMessage() {
  2290. var s0;
  2291. var key = peg$currPos * 67 + 40,
  2292. cached = peg$resultsCache[key];
  2293. if (cached) {
  2294. peg$currPos = cached.nextPos;
  2295. return cached.result;
  2296. }
  2297. s0 = peg$parsewsUnaryPragmaMessage();
  2298. if (s0 === peg$FAILED) {
  2299. s0 = peg$parsewsKeywordPragmaMessage();
  2300. }
  2301. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2302. return s0;
  2303. }
  2304. function peg$parsewsPragmas() {
  2305. var s0, s1, s2, s3, s4, s5, s6;
  2306. var key = peg$currPos * 67 + 41,
  2307. cached = peg$resultsCache[key];
  2308. if (cached) {
  2309. peg$currPos = cached.nextPos;
  2310. return cached.result;
  2311. }
  2312. s0 = [];
  2313. s1 = peg$currPos;
  2314. s2 = peg$parsews();
  2315. if (s2 !== peg$FAILED) {
  2316. if (input.charCodeAt(peg$currPos) === 60) {
  2317. s3 = peg$c83;
  2318. peg$currPos++;
  2319. } else {
  2320. s3 = peg$FAILED;
  2321. if (peg$silentFails === 0) { peg$fail(peg$c84); }
  2322. }
  2323. if (s3 !== peg$FAILED) {
  2324. s4 = peg$parsewsPragmaMessage();
  2325. if (s4 !== peg$FAILED) {
  2326. s5 = peg$parsews();
  2327. if (s5 !== peg$FAILED) {
  2328. if (input.charCodeAt(peg$currPos) === 62) {
  2329. s6 = peg$c85;
  2330. peg$currPos++;
  2331. } else {
  2332. s6 = peg$FAILED;
  2333. if (peg$silentFails === 0) { peg$fail(peg$c86); }
  2334. }
  2335. if (s6 !== peg$FAILED) {
  2336. peg$savedPos = s1;
  2337. s2 = peg$c87(s4);
  2338. s1 = s2;
  2339. } else {
  2340. peg$currPos = s1;
  2341. s1 = peg$FAILED;
  2342. }
  2343. } else {
  2344. peg$currPos = s1;
  2345. s1 = peg$FAILED;
  2346. }
  2347. } else {
  2348. peg$currPos = s1;
  2349. s1 = peg$FAILED;
  2350. }
  2351. } else {
  2352. peg$currPos = s1;
  2353. s1 = peg$FAILED;
  2354. }
  2355. } else {
  2356. peg$currPos = s1;
  2357. s1 = peg$FAILED;
  2358. }
  2359. while (s1 !== peg$FAILED) {
  2360. s0.push(s1);
  2361. s1 = peg$currPos;
  2362. s2 = peg$parsews();
  2363. if (s2 !== peg$FAILED) {
  2364. if (input.charCodeAt(peg$currPos) === 60) {
  2365. s3 = peg$c83;
  2366. peg$currPos++;
  2367. } else {
  2368. s3 = peg$FAILED;
  2369. if (peg$silentFails === 0) { peg$fail(peg$c84); }
  2370. }
  2371. if (s3 !== peg$FAILED) {
  2372. s4 = peg$parsewsPragmaMessage();
  2373. if (s4 !== peg$FAILED) {
  2374. s5 = peg$parsews();
  2375. if (s5 !== peg$FAILED) {
  2376. if (input.charCodeAt(peg$currPos) === 62) {
  2377. s6 = peg$c85;
  2378. peg$currPos++;
  2379. } else {
  2380. s6 = peg$FAILED;
  2381. if (peg$silentFails === 0) { peg$fail(peg$c86); }
  2382. }
  2383. if (s6 !== peg$FAILED) {
  2384. peg$savedPos = s1;
  2385. s2 = peg$c87(s4);
  2386. s1 = s2;
  2387. } else {
  2388. peg$currPos = s1;
  2389. s1 = peg$FAILED;
  2390. }
  2391. } else {
  2392. peg$currPos = s1;
  2393. s1 = peg$FAILED;
  2394. }
  2395. } else {
  2396. peg$currPos = s1;
  2397. s1 = peg$FAILED;
  2398. }
  2399. } else {
  2400. peg$currPos = s1;
  2401. s1 = peg$FAILED;
  2402. }
  2403. } else {
  2404. peg$currPos = s1;
  2405. s1 = peg$FAILED;
  2406. }
  2407. }
  2408. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2409. return s0;
  2410. }
  2411. function peg$parseassignment() {
  2412. var s0, s1, s2, s3, s4, s5;
  2413. var key = peg$currPos * 67 + 42,
  2414. cached = peg$resultsCache[key];
  2415. if (cached) {
  2416. peg$currPos = cached.nextPos;
  2417. return cached.result;
  2418. }
  2419. s0 = peg$currPos;
  2420. s1 = peg$parsevariable();
  2421. if (s1 !== peg$FAILED) {
  2422. s2 = peg$parsews();
  2423. if (s2 !== peg$FAILED) {
  2424. if (input.substr(peg$currPos, 2) === peg$c88) {
  2425. s3 = peg$c88;
  2426. peg$currPos += 2;
  2427. } else {
  2428. s3 = peg$FAILED;
  2429. if (peg$silentFails === 0) { peg$fail(peg$c89); }
  2430. }
  2431. if (s3 !== peg$FAILED) {
  2432. s4 = peg$parsews();
  2433. if (s4 !== peg$FAILED) {
  2434. s5 = peg$parseexpression();
  2435. if (s5 !== peg$FAILED) {
  2436. peg$savedPos = s0;
  2437. s1 = peg$c90(s1, s5);
  2438. s0 = s1;
  2439. } else {
  2440. peg$currPos = s0;
  2441. s0 = peg$FAILED;
  2442. }
  2443. } else {
  2444. peg$currPos = s0;
  2445. s0 = peg$FAILED;
  2446. }
  2447. } else {
  2448. peg$currPos = s0;
  2449. s0 = peg$FAILED;
  2450. }
  2451. } else {
  2452. peg$currPos = s0;
  2453. s0 = peg$FAILED;
  2454. }
  2455. } else {
  2456. peg$currPos = s0;
  2457. s0 = peg$FAILED;
  2458. }
  2459. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2460. return s0;
  2461. }
  2462. function peg$parseret() {
  2463. var s0, s1, s2, s3;
  2464. var key = peg$currPos * 67 + 43,
  2465. cached = peg$resultsCache[key];
  2466. if (cached) {
  2467. peg$currPos = cached.nextPos;
  2468. return cached.result;
  2469. }
  2470. s0 = peg$currPos;
  2471. if (input.charCodeAt(peg$currPos) === 94) {
  2472. s1 = peg$c91;
  2473. peg$currPos++;
  2474. } else {
  2475. s1 = peg$FAILED;
  2476. if (peg$silentFails === 0) { peg$fail(peg$c92); }
  2477. }
  2478. if (s1 !== peg$FAILED) {
  2479. s2 = peg$parsews();
  2480. if (s2 !== peg$FAILED) {
  2481. s3 = peg$parseexpression();
  2482. if (s3 !== peg$FAILED) {
  2483. peg$savedPos = s0;
  2484. s1 = peg$c93(s3);
  2485. s0 = s1;
  2486. } else {
  2487. peg$currPos = s0;
  2488. s0 = peg$FAILED;
  2489. }
  2490. } else {
  2491. peg$currPos = s0;
  2492. s0 = peg$FAILED;
  2493. }
  2494. } else {
  2495. peg$currPos = s0;
  2496. s0 = peg$FAILED;
  2497. }
  2498. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2499. return s0;
  2500. }
  2501. function peg$parsetemps() {
  2502. var s0, s1, s2, s3, s4, s5;
  2503. var key = peg$currPos * 67 + 44,
  2504. cached = peg$resultsCache[key];
  2505. if (cached) {
  2506. peg$currPos = cached.nextPos;
  2507. return cached.result;
  2508. }
  2509. s0 = peg$currPos;
  2510. if (input.charCodeAt(peg$currPos) === 124) {
  2511. s1 = peg$c94;
  2512. peg$currPos++;
  2513. } else {
  2514. s1 = peg$FAILED;
  2515. if (peg$silentFails === 0) { peg$fail(peg$c95); }
  2516. }
  2517. if (s1 !== peg$FAILED) {
  2518. s2 = [];
  2519. s3 = peg$currPos;
  2520. s4 = peg$parsews();
  2521. if (s4 !== peg$FAILED) {
  2522. s5 = peg$parseidentifier();
  2523. if (s5 !== peg$FAILED) {
  2524. peg$savedPos = s3;
  2525. s4 = peg$c96(s5);
  2526. s3 = s4;
  2527. } else {
  2528. peg$currPos = s3;
  2529. s3 = peg$FAILED;
  2530. }
  2531. } else {
  2532. peg$currPos = s3;
  2533. s3 = peg$FAILED;
  2534. }
  2535. while (s3 !== peg$FAILED) {
  2536. s2.push(s3);
  2537. s3 = peg$currPos;
  2538. s4 = peg$parsews();
  2539. if (s4 !== peg$FAILED) {
  2540. s5 = peg$parseidentifier();
  2541. if (s5 !== peg$FAILED) {
  2542. peg$savedPos = s3;
  2543. s4 = peg$c96(s5);
  2544. s3 = s4;
  2545. } else {
  2546. peg$currPos = s3;
  2547. s3 = peg$FAILED;
  2548. }
  2549. } else {
  2550. peg$currPos = s3;
  2551. s3 = peg$FAILED;
  2552. }
  2553. }
  2554. if (s2 !== peg$FAILED) {
  2555. s3 = peg$parsews();
  2556. if (s3 !== peg$FAILED) {
  2557. if (input.charCodeAt(peg$currPos) === 124) {
  2558. s4 = peg$c94;
  2559. peg$currPos++;
  2560. } else {
  2561. s4 = peg$FAILED;
  2562. if (peg$silentFails === 0) { peg$fail(peg$c95); }
  2563. }
  2564. if (s4 !== peg$FAILED) {
  2565. peg$savedPos = s0;
  2566. s1 = peg$c97(s2);
  2567. s0 = s1;
  2568. } else {
  2569. peg$currPos = s0;
  2570. s0 = peg$FAILED;
  2571. }
  2572. } else {
  2573. peg$currPos = s0;
  2574. s0 = peg$FAILED;
  2575. }
  2576. } else {
  2577. peg$currPos = s0;
  2578. s0 = peg$FAILED;
  2579. }
  2580. } else {
  2581. peg$currPos = s0;
  2582. s0 = peg$FAILED;
  2583. }
  2584. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2585. return s0;
  2586. }
  2587. function peg$parsewsBlockParamList() {
  2588. var s0, s1, s2, s3, s4, s5, s6;
  2589. var key = peg$currPos * 67 + 45,
  2590. cached = peg$resultsCache[key];
  2591. if (cached) {
  2592. peg$currPos = cached.nextPos;
  2593. return cached.result;
  2594. }
  2595. s0 = peg$currPos;
  2596. s1 = [];
  2597. s2 = peg$currPos;
  2598. s3 = peg$parsews();
  2599. if (s3 !== peg$FAILED) {
  2600. if (input.charCodeAt(peg$currPos) === 58) {
  2601. s4 = peg$c12;
  2602. peg$currPos++;
  2603. } else {
  2604. s4 = peg$FAILED;
  2605. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2606. }
  2607. if (s4 !== peg$FAILED) {
  2608. s5 = peg$parsews();
  2609. if (s5 !== peg$FAILED) {
  2610. s6 = peg$parseidentifier();
  2611. if (s6 !== peg$FAILED) {
  2612. peg$savedPos = s2;
  2613. s3 = peg$c98(s6);
  2614. s2 = s3;
  2615. } else {
  2616. peg$currPos = s2;
  2617. s2 = peg$FAILED;
  2618. }
  2619. } else {
  2620. peg$currPos = s2;
  2621. s2 = peg$FAILED;
  2622. }
  2623. } else {
  2624. peg$currPos = s2;
  2625. s2 = peg$FAILED;
  2626. }
  2627. } else {
  2628. peg$currPos = s2;
  2629. s2 = peg$FAILED;
  2630. }
  2631. if (s2 !== peg$FAILED) {
  2632. while (s2 !== peg$FAILED) {
  2633. s1.push(s2);
  2634. s2 = peg$currPos;
  2635. s3 = peg$parsews();
  2636. if (s3 !== peg$FAILED) {
  2637. if (input.charCodeAt(peg$currPos) === 58) {
  2638. s4 = peg$c12;
  2639. peg$currPos++;
  2640. } else {
  2641. s4 = peg$FAILED;
  2642. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2643. }
  2644. if (s4 !== peg$FAILED) {
  2645. s5 = peg$parsews();
  2646. if (s5 !== peg$FAILED) {
  2647. s6 = peg$parseidentifier();
  2648. if (s6 !== peg$FAILED) {
  2649. peg$savedPos = s2;
  2650. s3 = peg$c98(s6);
  2651. s2 = s3;
  2652. } else {
  2653. peg$currPos = s2;
  2654. s2 = peg$FAILED;
  2655. }
  2656. } else {
  2657. peg$currPos = s2;
  2658. s2 = peg$FAILED;
  2659. }
  2660. } else {
  2661. peg$currPos = s2;
  2662. s2 = peg$FAILED;
  2663. }
  2664. } else {
  2665. peg$currPos = s2;
  2666. s2 = peg$FAILED;
  2667. }
  2668. }
  2669. } else {
  2670. s1 = peg$FAILED;
  2671. }
  2672. if (s1 !== peg$FAILED) {
  2673. s2 = peg$parsews();
  2674. if (s2 !== peg$FAILED) {
  2675. if (input.charCodeAt(peg$currPos) === 124) {
  2676. s3 = peg$c94;
  2677. peg$currPos++;
  2678. } else {
  2679. s3 = peg$FAILED;
  2680. if (peg$silentFails === 0) { peg$fail(peg$c95); }
  2681. }
  2682. if (s3 !== peg$FAILED) {
  2683. peg$savedPos = s0;
  2684. s1 = peg$c99(s1);
  2685. s0 = s1;
  2686. } else {
  2687. peg$currPos = s0;
  2688. s0 = peg$FAILED;
  2689. }
  2690. } else {
  2691. peg$currPos = s0;
  2692. s0 = peg$FAILED;
  2693. }
  2694. } else {
  2695. peg$currPos = s0;
  2696. s0 = peg$FAILED;
  2697. }
  2698. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2699. return s0;
  2700. }
  2701. function peg$parsesubexpression() {
  2702. var s0, s1, s2, s3, s4, s5;
  2703. var key = peg$currPos * 67 + 46,
  2704. cached = peg$resultsCache[key];
  2705. if (cached) {
  2706. peg$currPos = cached.nextPos;
  2707. return cached.result;
  2708. }
  2709. s0 = peg$currPos;
  2710. if (input.charCodeAt(peg$currPos) === 40) {
  2711. s1 = peg$c51;
  2712. peg$currPos++;
  2713. } else {
  2714. s1 = peg$FAILED;
  2715. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  2716. }
  2717. if (s1 !== peg$FAILED) {
  2718. s2 = peg$parsews();
  2719. if (s2 !== peg$FAILED) {
  2720. s3 = peg$parseexpression();
  2721. if (s3 !== peg$FAILED) {
  2722. s4 = peg$parsews();
  2723. if (s4 !== peg$FAILED) {
  2724. if (input.charCodeAt(peg$currPos) === 41) {
  2725. s5 = peg$c48;
  2726. peg$currPos++;
  2727. } else {
  2728. s5 = peg$FAILED;
  2729. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  2730. }
  2731. if (s5 !== peg$FAILED) {
  2732. peg$savedPos = s0;
  2733. s1 = peg$c79(s3);
  2734. s0 = s1;
  2735. } else {
  2736. peg$currPos = s0;
  2737. s0 = peg$FAILED;
  2738. }
  2739. } else {
  2740. peg$currPos = s0;
  2741. s0 = peg$FAILED;
  2742. }
  2743. } else {
  2744. peg$currPos = s0;
  2745. s0 = peg$FAILED;
  2746. }
  2747. } else {
  2748. peg$currPos = s0;
  2749. s0 = peg$FAILED;
  2750. }
  2751. } else {
  2752. peg$currPos = s0;
  2753. s0 = peg$FAILED;
  2754. }
  2755. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2756. return s0;
  2757. }
  2758. function peg$parsewsStatements() {
  2759. var s0, s1, s2, s3;
  2760. var key = peg$currPos * 67 + 47,
  2761. cached = peg$resultsCache[key];
  2762. if (cached) {
  2763. peg$currPos = cached.nextPos;
  2764. return cached.result;
  2765. }
  2766. s0 = peg$currPos;
  2767. s1 = peg$parsemaybeDotsWs();
  2768. if (s1 !== peg$FAILED) {
  2769. s2 = peg$parseret();
  2770. if (s2 !== peg$FAILED) {
  2771. peg$savedPos = s0;
  2772. s1 = peg$c100(s2);
  2773. s0 = s1;
  2774. } else {
  2775. peg$currPos = s0;
  2776. s0 = peg$FAILED;
  2777. }
  2778. } else {
  2779. peg$currPos = s0;
  2780. s0 = peg$FAILED;
  2781. }
  2782. if (s0 === peg$FAILED) {
  2783. s0 = peg$currPos;
  2784. s1 = peg$parsewsExpressions();
  2785. if (s1 !== peg$FAILED) {
  2786. s2 = peg$parsesomeDotsWs();
  2787. if (s2 !== peg$FAILED) {
  2788. s3 = peg$parseret();
  2789. if (s3 !== peg$FAILED) {
  2790. peg$savedPos = s0;
  2791. s1 = peg$c101(s1, s3);
  2792. s0 = s1;
  2793. } else {
  2794. peg$currPos = s0;
  2795. s0 = peg$FAILED;
  2796. }
  2797. } else {
  2798. peg$currPos = s0;
  2799. s0 = peg$FAILED;
  2800. }
  2801. } else {
  2802. peg$currPos = s0;
  2803. s0 = peg$FAILED;
  2804. }
  2805. if (s0 === peg$FAILED) {
  2806. s0 = peg$currPos;
  2807. s1 = peg$parsewsExpressions();
  2808. if (s1 === peg$FAILED) {
  2809. s1 = null;
  2810. }
  2811. if (s1 !== peg$FAILED) {
  2812. peg$savedPos = s0;
  2813. s1 = peg$c102(s1);
  2814. }
  2815. s0 = s1;
  2816. }
  2817. }
  2818. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2819. return s0;
  2820. }
  2821. function peg$parsewsSequenceWs() {
  2822. var s0, s1, s2, s3, s4, s5, s6;
  2823. var key = peg$currPos * 67 + 48,
  2824. cached = peg$resultsCache[key];
  2825. if (cached) {
  2826. peg$currPos = cached.nextPos;
  2827. return cached.result;
  2828. }
  2829. s0 = peg$currPos;
  2830. s1 = peg$parsewsPragmas();
  2831. if (s1 === peg$FAILED) {
  2832. s1 = null;
  2833. }
  2834. if (s1 !== peg$FAILED) {
  2835. s2 = peg$parsews();
  2836. if (s2 !== peg$FAILED) {
  2837. s3 = peg$parsetemps();
  2838. if (s3 === peg$FAILED) {
  2839. s3 = null;
  2840. }
  2841. if (s3 !== peg$FAILED) {
  2842. s4 = peg$parsewsPragmas();
  2843. if (s4 === peg$FAILED) {
  2844. s4 = null;
  2845. }
  2846. if (s4 !== peg$FAILED) {
  2847. s5 = peg$parsewsStatements();
  2848. if (s5 === peg$FAILED) {
  2849. s5 = null;
  2850. }
  2851. if (s5 !== peg$FAILED) {
  2852. s6 = peg$parsemaybeDotsWs();
  2853. if (s6 !== peg$FAILED) {
  2854. peg$savedPos = s0;
  2855. s1 = peg$c103(s1, s3, s4, s5);
  2856. s0 = s1;
  2857. } else {
  2858. peg$currPos = s0;
  2859. s0 = peg$FAILED;
  2860. }
  2861. } else {
  2862. peg$currPos = s0;
  2863. s0 = peg$FAILED;
  2864. }
  2865. } else {
  2866. peg$currPos = s0;
  2867. s0 = peg$FAILED;
  2868. }
  2869. } else {
  2870. peg$currPos = s0;
  2871. s0 = peg$FAILED;
  2872. }
  2873. } else {
  2874. peg$currPos = s0;
  2875. s0 = peg$FAILED;
  2876. }
  2877. } else {
  2878. peg$currPos = s0;
  2879. s0 = peg$FAILED;
  2880. }
  2881. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2882. return s0;
  2883. }
  2884. function peg$parsewsBlockSequenceWs() {
  2885. var s0, s1, s2, s3, s4;
  2886. var key = peg$currPos * 67 + 49,
  2887. cached = peg$resultsCache[key];
  2888. if (cached) {
  2889. peg$currPos = cached.nextPos;
  2890. return cached.result;
  2891. }
  2892. s0 = peg$currPos;
  2893. s1 = peg$parsews();
  2894. if (s1 !== peg$FAILED) {
  2895. s2 = peg$parsetemps();
  2896. if (s2 === peg$FAILED) {
  2897. s2 = null;
  2898. }
  2899. if (s2 !== peg$FAILED) {
  2900. s3 = peg$parsewsStatements();
  2901. if (s3 === peg$FAILED) {
  2902. s3 = null;
  2903. }
  2904. if (s3 !== peg$FAILED) {
  2905. s4 = peg$parsemaybeDotsWs();
  2906. if (s4 !== peg$FAILED) {
  2907. peg$savedPos = s0;
  2908. s1 = peg$c104(s2, s3);
  2909. s0 = s1;
  2910. } else {
  2911. peg$currPos = s0;
  2912. s0 = peg$FAILED;
  2913. }
  2914. } else {
  2915. peg$currPos = s0;
  2916. s0 = peg$FAILED;
  2917. }
  2918. } else {
  2919. peg$currPos = s0;
  2920. s0 = peg$FAILED;
  2921. }
  2922. } else {
  2923. peg$currPos = s0;
  2924. s0 = peg$FAILED;
  2925. }
  2926. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2927. return s0;
  2928. }
  2929. function peg$parseblock() {
  2930. var s0, s1, s2, s3, s4;
  2931. var key = peg$currPos * 67 + 50,
  2932. cached = peg$resultsCache[key];
  2933. if (cached) {
  2934. peg$currPos = cached.nextPos;
  2935. return cached.result;
  2936. }
  2937. s0 = peg$currPos;
  2938. if (input.charCodeAt(peg$currPos) === 91) {
  2939. s1 = peg$c105;
  2940. peg$currPos++;
  2941. } else {
  2942. s1 = peg$FAILED;
  2943. if (peg$silentFails === 0) { peg$fail(peg$c106); }
  2944. }
  2945. if (s1 !== peg$FAILED) {
  2946. s2 = peg$parsewsBlockParamList();
  2947. if (s2 === peg$FAILED) {
  2948. s2 = null;
  2949. }
  2950. if (s2 !== peg$FAILED) {
  2951. s3 = peg$parsewsBlockSequenceWs();
  2952. if (s3 !== peg$FAILED) {
  2953. if (input.charCodeAt(peg$currPos) === 93) {
  2954. s4 = peg$c107;
  2955. peg$currPos++;
  2956. } else {
  2957. s4 = peg$FAILED;
  2958. if (peg$silentFails === 0) { peg$fail(peg$c108); }
  2959. }
  2960. if (s4 !== peg$FAILED) {
  2961. peg$savedPos = s0;
  2962. s1 = peg$c109(s2, s3);
  2963. s0 = s1;
  2964. } else {
  2965. peg$currPos = s0;
  2966. s0 = peg$FAILED;
  2967. }
  2968. } else {
  2969. peg$currPos = s0;
  2970. s0 = peg$FAILED;
  2971. }
  2972. } else {
  2973. peg$currPos = s0;
  2974. s0 = peg$FAILED;
  2975. }
  2976. } else {
  2977. peg$currPos = s0;
  2978. s0 = peg$FAILED;
  2979. }
  2980. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2981. return s0;
  2982. }
  2983. function peg$parseoperand() {
  2984. var s0;
  2985. var key = peg$currPos * 67 + 51,
  2986. cached = peg$resultsCache[key];
  2987. if (cached) {
  2988. peg$currPos = cached.nextPos;
  2989. return cached.result;
  2990. }
  2991. s0 = peg$parseliteral();
  2992. if (s0 === peg$FAILED) {
  2993. s0 = peg$parsevariable();
  2994. if (s0 === peg$FAILED) {
  2995. s0 = peg$parsesubexpression();
  2996. }
  2997. }
  2998. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2999. return s0;
  3000. }
  3001. function peg$parsewsUnaryMessage() {
  3002. var s0, s1, s2, s3, s4;
  3003. var key = peg$currPos * 67 + 52,
  3004. cached = peg$resultsCache[key];
  3005. if (cached) {
  3006. peg$currPos = cached.nextPos;
  3007. return cached.result;
  3008. }
  3009. s0 = peg$currPos;
  3010. s1 = peg$parsews();
  3011. if (s1 !== peg$FAILED) {
  3012. s2 = peg$parseidentifier();
  3013. if (s2 !== peg$FAILED) {
  3014. s3 = peg$currPos;
  3015. peg$silentFails++;
  3016. if (input.charCodeAt(peg$currPos) === 58) {
  3017. s4 = peg$c12;
  3018. peg$currPos++;
  3019. } else {
  3020. s4 = peg$FAILED;
  3021. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  3022. }
  3023. peg$silentFails--;
  3024. if (s4 === peg$FAILED) {
  3025. s3 = void 0;
  3026. } else {
  3027. peg$currPos = s3;
  3028. s3 = peg$FAILED;
  3029. }
  3030. if (s3 !== peg$FAILED) {
  3031. peg$savedPos = s0;
  3032. s1 = peg$c110(s2);
  3033. s0 = s1;
  3034. } else {
  3035. peg$currPos = s0;
  3036. s0 = peg$FAILED;
  3037. }
  3038. } else {
  3039. peg$currPos = s0;
  3040. s0 = peg$FAILED;
  3041. }
  3042. } else {
  3043. peg$currPos = s0;
  3044. s0 = peg$FAILED;
  3045. }
  3046. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3047. return s0;
  3048. }
  3049. function peg$parsewsUnaryTail() {
  3050. var s0, s1;
  3051. var key = peg$currPos * 67 + 53,
  3052. cached = peg$resultsCache[key];
  3053. if (cached) {
  3054. peg$currPos = cached.nextPos;
  3055. return cached.result;
  3056. }
  3057. s0 = [];
  3058. s1 = peg$parsewsUnaryMessage();
  3059. while (s1 !== peg$FAILED) {
  3060. s0.push(s1);
  3061. s1 = peg$parsewsUnaryMessage();
  3062. }
  3063. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3064. return s0;
  3065. }
  3066. function peg$parseunarySend() {
  3067. var s0, s1, s2;
  3068. var key = peg$currPos * 67 + 54,
  3069. cached = peg$resultsCache[key];
  3070. if (cached) {
  3071. peg$currPos = cached.nextPos;
  3072. return cached.result;
  3073. }
  3074. s0 = peg$currPos;
  3075. s1 = peg$parseoperand();
  3076. if (s1 !== peg$FAILED) {
  3077. s2 = peg$parsewsUnaryTail();
  3078. if (s2 !== peg$FAILED) {
  3079. peg$savedPos = s0;
  3080. s1 = peg$c111(s1, s2);
  3081. s0 = s1;
  3082. } else {
  3083. peg$currPos = s0;
  3084. s0 = peg$FAILED;
  3085. }
  3086. } else {
  3087. peg$currPos = s0;
  3088. s0 = peg$FAILED;
  3089. }
  3090. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3091. return s0;
  3092. }
  3093. function peg$parsewsBinaryMessage() {
  3094. var s0, s1, s2, s3, s4;
  3095. var key = peg$currPos * 67 + 55,
  3096. cached = peg$resultsCache[key];
  3097. if (cached) {
  3098. peg$currPos = cached.nextPos;
  3099. return cached.result;
  3100. }
  3101. s0 = peg$currPos;
  3102. s1 = peg$parsews();
  3103. if (s1 !== peg$FAILED) {
  3104. s2 = peg$parsebinarySelector();
  3105. if (s2 !== peg$FAILED) {
  3106. s3 = peg$parsews();
  3107. if (s3 !== peg$FAILED) {
  3108. s4 = peg$parseunarySend();
  3109. if (s4 !== peg$FAILED) {
  3110. peg$savedPos = s0;
  3111. s1 = peg$c112(s2, s4);
  3112. s0 = s1;
  3113. } else {
  3114. peg$currPos = s0;
  3115. s0 = peg$FAILED;
  3116. }
  3117. } else {
  3118. peg$currPos = s0;
  3119. s0 = peg$FAILED;
  3120. }
  3121. } else {
  3122. peg$currPos = s0;
  3123. s0 = peg$FAILED;
  3124. }
  3125. } else {
  3126. peg$currPos = s0;
  3127. s0 = peg$FAILED;
  3128. }
  3129. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3130. return s0;
  3131. }
  3132. function peg$parsewsBinaryTail() {
  3133. var s0, s1, s2, s3;
  3134. var key = peg$currPos * 67 + 56,
  3135. cached = peg$resultsCache[key];
  3136. if (cached) {
  3137. peg$currPos = cached.nextPos;
  3138. return cached.result;
  3139. }
  3140. s0 = peg$currPos;
  3141. s1 = peg$parsewsUnaryTail();
  3142. if (s1 !== peg$FAILED) {
  3143. s2 = [];
  3144. s3 = peg$parsewsBinaryMessage();
  3145. while (s3 !== peg$FAILED) {
  3146. s2.push(s3);
  3147. s3 = peg$parsewsBinaryMessage();
  3148. }
  3149. if (s2 !== peg$FAILED) {
  3150. peg$savedPos = s0;
  3151. s1 = peg$c113(s1, s2);
  3152. s0 = s1;
  3153. } else {
  3154. peg$currPos = s0;
  3155. s0 = peg$FAILED;
  3156. }
  3157. } else {
  3158. peg$currPos = s0;
  3159. s0 = peg$FAILED;
  3160. }
  3161. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3162. return s0;
  3163. }
  3164. function peg$parsebinarySend() {
  3165. var s0, s1, s2;
  3166. var key = peg$currPos * 67 + 57,
  3167. cached = peg$resultsCache[key];
  3168. if (cached) {
  3169. peg$currPos = cached.nextPos;
  3170. return cached.result;
  3171. }
  3172. s0 = peg$currPos;
  3173. s1 = peg$parseoperand();
  3174. if (s1 !== peg$FAILED) {
  3175. s2 = peg$parsewsBinaryTail();
  3176. if (s2 !== peg$FAILED) {
  3177. peg$savedPos = s0;
  3178. s1 = peg$c111(s1, s2);
  3179. s0 = s1;
  3180. } else {
  3181. peg$currPos = s0;
  3182. s0 = peg$FAILED;
  3183. }
  3184. } else {
  3185. peg$currPos = s0;
  3186. s0 = peg$FAILED;
  3187. }
  3188. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3189. return s0;
  3190. }
  3191. function peg$parsewsKeywordMessage() {
  3192. var s0, s1, s2, s3, s4, s5, s6;
  3193. var key = peg$currPos * 67 + 58,
  3194. cached = peg$resultsCache[key];
  3195. if (cached) {
  3196. peg$currPos = cached.nextPos;
  3197. return cached.result;
  3198. }
  3199. s0 = peg$currPos;
  3200. s1 = [];
  3201. s2 = peg$currPos;
  3202. s3 = peg$parsews();
  3203. if (s3 !== peg$FAILED) {
  3204. s4 = peg$parsekeyword();
  3205. if (s4 !== peg$FAILED) {
  3206. s5 = peg$parsews();
  3207. if (s5 !== peg$FAILED) {
  3208. s6 = peg$parsebinarySend();
  3209. if (s6 !== peg$FAILED) {
  3210. peg$savedPos = s2;
  3211. s3 = peg$c75(s4, s6);
  3212. s2 = s3;
  3213. } else {
  3214. peg$currPos = s2;
  3215. s2 = peg$FAILED;
  3216. }
  3217. } else {
  3218. peg$currPos = s2;
  3219. s2 = peg$FAILED;
  3220. }
  3221. } else {
  3222. peg$currPos = s2;
  3223. s2 = peg$FAILED;
  3224. }
  3225. } else {
  3226. peg$currPos = s2;
  3227. s2 = peg$FAILED;
  3228. }
  3229. if (s2 !== peg$FAILED) {
  3230. while (s2 !== peg$FAILED) {
  3231. s1.push(s2);
  3232. s2 = peg$currPos;
  3233. s3 = peg$parsews();
  3234. if (s3 !== peg$FAILED) {
  3235. s4 = peg$parsekeyword();
  3236. if (s4 !== peg$FAILED) {
  3237. s5 = peg$parsews();
  3238. if (s5 !== peg$FAILED) {
  3239. s6 = peg$parsebinarySend();
  3240. if (s6 !== peg$FAILED) {
  3241. peg$savedPos = s2;
  3242. s3 = peg$c75(s4, s6);
  3243. s2 = s3;
  3244. } else {
  3245. peg$currPos = s2;
  3246. s2 = peg$FAILED;
  3247. }
  3248. } else {
  3249. peg$currPos = s2;
  3250. s2 = peg$FAILED;
  3251. }
  3252. } else {
  3253. peg$currPos = s2;
  3254. s2 = peg$FAILED;
  3255. }
  3256. } else {
  3257. peg$currPos = s2;
  3258. s2 = peg$FAILED;
  3259. }
  3260. }
  3261. } else {
  3262. s1 = peg$FAILED;
  3263. }
  3264. if (s1 !== peg$FAILED) {
  3265. peg$savedPos = s0;
  3266. s1 = peg$c114(s1);
  3267. }
  3268. s0 = s1;
  3269. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3270. return s0;
  3271. }
  3272. function peg$parsewsKeywordTail() {
  3273. var s0, s1, s2;
  3274. var key = peg$currPos * 67 + 59,
  3275. cached = peg$resultsCache[key];
  3276. if (cached) {
  3277. peg$currPos = cached.nextPos;
  3278. return cached.result;
  3279. }
  3280. s0 = peg$currPos;
  3281. s1 = peg$parsewsBinaryTail();
  3282. if (s1 !== peg$FAILED) {
  3283. s2 = peg$parsewsKeywordMessage();
  3284. if (s2 === peg$FAILED) {
  3285. s2 = null;
  3286. }
  3287. if (s2 !== peg$FAILED) {
  3288. peg$savedPos = s0;
  3289. s1 = peg$c115(s1, s2);
  3290. s0 = s1;
  3291. } else {
  3292. peg$currPos = s0;
  3293. s0 = peg$FAILED;
  3294. }
  3295. } else {
  3296. peg$currPos = s0;
  3297. s0 = peg$FAILED;
  3298. }
  3299. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3300. return s0;
  3301. }
  3302. function peg$parsekeywordSend() {
  3303. var s0, s1, s2;
  3304. var key = peg$currPos * 67 + 60,
  3305. cached = peg$resultsCache[key];
  3306. if (cached) {
  3307. peg$currPos = cached.nextPos;
  3308. return cached.result;
  3309. }
  3310. s0 = peg$currPos;
  3311. s1 = peg$parseoperand();
  3312. if (s1 !== peg$FAILED) {
  3313. s2 = peg$parsewsKeywordTail();
  3314. if (s2 !== peg$FAILED) {
  3315. peg$savedPos = s0;
  3316. s1 = peg$c111(s1, s2);
  3317. s0 = s1;
  3318. } else {
  3319. peg$currPos = s0;
  3320. s0 = peg$FAILED;
  3321. }
  3322. } else {
  3323. peg$currPos = s0;
  3324. s0 = peg$FAILED;
  3325. }
  3326. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3327. return s0;
  3328. }
  3329. function peg$parsewsMessage() {
  3330. var s0;
  3331. var key = peg$currPos * 67 + 61,
  3332. cached = peg$resultsCache[key];
  3333. if (cached) {
  3334. peg$currPos = cached.nextPos;
  3335. return cached.result;
  3336. }
  3337. s0 = peg$parsewsBinaryMessage();
  3338. if (s0 === peg$FAILED) {
  3339. s0 = peg$parsewsUnaryMessage();
  3340. if (s0 === peg$FAILED) {
  3341. s0 = peg$parsewsKeywordMessage();
  3342. }
  3343. }
  3344. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3345. return s0;
  3346. }
  3347. function peg$parsecascade() {
  3348. var s0, s1, s2, s3, s4, s5, s6, s7, s8;
  3349. var key = peg$currPos * 67 + 62,
  3350. cached = peg$resultsCache[key];
  3351. if (cached) {
  3352. peg$currPos = cached.nextPos;
  3353. return cached.result;
  3354. }
  3355. s0 = peg$currPos;
  3356. s1 = peg$parseoperand();
  3357. if (s1 !== peg$FAILED) {
  3358. s2 = peg$parsewsKeywordTail();
  3359. if (s2 !== peg$FAILED) {
  3360. peg$savedPos = peg$currPos;
  3361. s3 = peg$c116(s1, s2);
  3362. if (s3) {
  3363. s3 = void 0;
  3364. } else {
  3365. s3 = peg$FAILED;
  3366. }
  3367. if (s3 !== peg$FAILED) {
  3368. s4 = [];
  3369. s5 = peg$currPos;
  3370. s6 = peg$parsews();
  3371. if (s6 !== peg$FAILED) {
  3372. if (input.charCodeAt(peg$currPos) === 59) {
  3373. s7 = peg$c117;
  3374. peg$currPos++;
  3375. } else {
  3376. s7 = peg$FAILED;
  3377. if (peg$silentFails === 0) { peg$fail(peg$c118); }
  3378. }
  3379. if (s7 !== peg$FAILED) {
  3380. s8 = peg$parsewsMessage();
  3381. if (s8 !== peg$FAILED) {
  3382. peg$savedPos = s5;
  3383. s6 = peg$c119(s1, s2, s8);
  3384. s5 = s6;
  3385. } else {
  3386. peg$currPos = s5;
  3387. s5 = peg$FAILED;
  3388. }
  3389. } else {
  3390. peg$currPos = s5;
  3391. s5 = peg$FAILED;
  3392. }
  3393. } else {
  3394. peg$currPos = s5;
  3395. s5 = peg$FAILED;
  3396. }
  3397. if (s5 !== peg$FAILED) {
  3398. while (s5 !== peg$FAILED) {
  3399. s4.push(s5);
  3400. s5 = peg$currPos;
  3401. s6 = peg$parsews();
  3402. if (s6 !== peg$FAILED) {
  3403. if (input.charCodeAt(peg$currPos) === 59) {
  3404. s7 = peg$c117;
  3405. peg$currPos++;
  3406. } else {
  3407. s7 = peg$FAILED;
  3408. if (peg$silentFails === 0) { peg$fail(peg$c118); }
  3409. }
  3410. if (s7 !== peg$FAILED) {
  3411. s8 = peg$parsewsMessage();
  3412. if (s8 !== peg$FAILED) {
  3413. peg$savedPos = s5;
  3414. s6 = peg$c119(s1, s2, s8);
  3415. s5 = s6;
  3416. } else {
  3417. peg$currPos = s5;
  3418. s5 = peg$FAILED;
  3419. }
  3420. } else {
  3421. peg$currPos = s5;
  3422. s5 = peg$FAILED;
  3423. }
  3424. } else {
  3425. peg$currPos = s5;
  3426. s5 = peg$FAILED;
  3427. }
  3428. }
  3429. } else {
  3430. s4 = peg$FAILED;
  3431. }
  3432. if (s4 !== peg$FAILED) {
  3433. peg$savedPos = s0;
  3434. s1 = peg$c120(s1, s2, s4);
  3435. s0 = s1;
  3436. } else {
  3437. peg$currPos = s0;
  3438. s0 = peg$FAILED;
  3439. }
  3440. } else {
  3441. peg$currPos = s0;
  3442. s0 = peg$FAILED;
  3443. }
  3444. } else {
  3445. peg$currPos = s0;
  3446. s0 = peg$FAILED;
  3447. }
  3448. } else {
  3449. peg$currPos = s0;
  3450. s0 = peg$FAILED;
  3451. }
  3452. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3453. return s0;
  3454. }
  3455. function peg$parsemethod() {
  3456. var s0, s1, s2;
  3457. var key = peg$currPos * 67 + 63,
  3458. cached = peg$resultsCache[key];
  3459. if (cached) {
  3460. peg$currPos = cached.nextPos;
  3461. return cached.result;
  3462. }
  3463. s0 = peg$currPos;
  3464. s1 = peg$parsewsKeywordPattern();
  3465. if (s1 === peg$FAILED) {
  3466. s1 = peg$parsewsBinaryPattern();
  3467. if (s1 === peg$FAILED) {
  3468. s1 = peg$parsewsUnaryPattern();
  3469. }
  3470. }
  3471. if (s1 !== peg$FAILED) {
  3472. s2 = peg$parsewsSequenceWs();
  3473. if (s2 !== peg$FAILED) {
  3474. peg$savedPos = s0;
  3475. s1 = peg$c121(s1, s2);
  3476. s0 = s1;
  3477. } else {
  3478. peg$currPos = s0;
  3479. s0 = peg$FAILED;
  3480. }
  3481. } else {
  3482. peg$currPos = s0;
  3483. s0 = peg$FAILED;
  3484. }
  3485. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3486. return s0;
  3487. }
  3488. function peg$parseassociationSend() {
  3489. var s0, s1, s2, s3;
  3490. var key = peg$currPos * 67 + 64,
  3491. cached = peg$resultsCache[key];
  3492. if (cached) {
  3493. peg$currPos = cached.nextPos;
  3494. return cached.result;
  3495. }
  3496. s0 = peg$currPos;
  3497. s1 = peg$parseoperand();
  3498. if (s1 !== peg$FAILED) {
  3499. s2 = peg$parsewsBinaryTail();
  3500. if (s2 !== peg$FAILED) {
  3501. peg$savedPos = peg$currPos;
  3502. s3 = peg$c122(s1, s2);
  3503. if (s3) {
  3504. s3 = void 0;
  3505. } else {
  3506. s3 = peg$FAILED;
  3507. }
  3508. if (s3 !== peg$FAILED) {
  3509. peg$savedPos = s0;
  3510. s1 = peg$c123(s1, s2);
  3511. s0 = s1;
  3512. } else {
  3513. peg$currPos = s0;
  3514. s0 = peg$FAILED;
  3515. }
  3516. } else {
  3517. peg$currPos = s0;
  3518. s0 = peg$FAILED;
  3519. }
  3520. } else {
  3521. peg$currPos = s0;
  3522. s0 = peg$FAILED;
  3523. }
  3524. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3525. return s0;
  3526. }
  3527. function peg$parsewsAssociationsRest() {
  3528. var s0, s1, s2;
  3529. var key = peg$currPos * 67 + 65,
  3530. cached = peg$resultsCache[key];
  3531. if (cached) {
  3532. peg$currPos = cached.nextPos;
  3533. return cached.result;
  3534. }
  3535. s0 = peg$currPos;
  3536. s1 = peg$parsesomeDotsWs();
  3537. if (s1 !== peg$FAILED) {
  3538. s2 = peg$parseassociationSend();
  3539. if (s2 !== peg$FAILED) {
  3540. peg$savedPos = s0;
  3541. s1 = peg$c79(s2);
  3542. s0 = s1;
  3543. } else {
  3544. peg$currPos = s0;
  3545. s0 = peg$FAILED;
  3546. }
  3547. } else {
  3548. peg$currPos = s0;
  3549. s0 = peg$FAILED;
  3550. }
  3551. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3552. return s0;
  3553. }
  3554. function peg$parsewsAssociations() {
  3555. var s0, s1, s2, s3, s4;
  3556. var key = peg$currPos * 67 + 66,
  3557. cached = peg$resultsCache[key];
  3558. if (cached) {
  3559. peg$currPos = cached.nextPos;
  3560. return cached.result;
  3561. }
  3562. s0 = peg$currPos;
  3563. s1 = peg$parsemaybeDotsWs();
  3564. if (s1 !== peg$FAILED) {
  3565. s2 = peg$parseassociationSend();
  3566. if (s2 !== peg$FAILED) {
  3567. s3 = [];
  3568. s4 = peg$parsewsAssociationsRest();
  3569. while (s4 !== peg$FAILED) {
  3570. s3.push(s4);
  3571. s4 = peg$parsewsAssociationsRest();
  3572. }
  3573. if (s3 !== peg$FAILED) {
  3574. peg$savedPos = s0;
  3575. s1 = peg$c124(s2, s3);
  3576. s0 = s1;
  3577. } else {
  3578. peg$currPos = s0;
  3579. s0 = peg$FAILED;
  3580. }
  3581. } else {
  3582. peg$currPos = s0;
  3583. s0 = peg$FAILED;
  3584. }
  3585. } else {
  3586. peg$currPos = s0;
  3587. s0 = peg$FAILED;
  3588. }
  3589. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3590. return s0;
  3591. }
  3592. var $globals = $boot.globals;
  3593. peg$result = peg$startRuleFunction();
  3594. if (peg$result !== peg$FAILED && peg$currPos === input.length) {
  3595. return peg$result;
  3596. } else {
  3597. if (peg$result !== peg$FAILED && peg$currPos < input.length) {
  3598. peg$fail(peg$endExpectation());
  3599. }
  3600. throw peg$buildStructuredError(
  3601. peg$maxFailExpected,
  3602. peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
  3603. peg$maxFailPos < input.length
  3604. ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
  3605. : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
  3606. );
  3607. }
  3608. }
  3609. return {
  3610. SyntaxError: peg$SyntaxError,
  3611. parse: peg$parse
  3612. };
  3613. });