1
0

parser.js 102 KB

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