parser.js 98 KB

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