1
0

parser.js 108 KB

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