2
0

parser.js 99 KB

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