1
0

parser.js 101 KB

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