parser.js 99 KB

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