1
0

parser.js 101 KB

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