parser.js 105 KB

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