2
0

parser.js 100 KB

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