parser.js 98 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897
  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 * 63 + 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 * 63 + 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 * 63 + 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 * 63 + 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 * 63 + 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$parsesomeDotsWs() {
  680. var s0, s1, s2, s3;
  681. var key = peg$currPos * 63 + 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$parsews();
  689. if (s1 !== peg$FAILED) {
  690. if (input.charCodeAt(peg$currPos) === 46) {
  691. s2 = peg$c6;
  692. peg$currPos++;
  693. } else {
  694. s2 = peg$FAILED;
  695. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  696. }
  697. if (s2 !== peg$FAILED) {
  698. s3 = peg$parsemaybeDotsWs();
  699. if (s3 !== peg$FAILED) {
  700. s1 = [s1, s2, s3];
  701. s0 = s1;
  702. } else {
  703. peg$currPos = s0;
  704. s0 = peg$FAILED;
  705. }
  706. } else {
  707. peg$currPos = s0;
  708. s0 = peg$FAILED;
  709. }
  710. } else {
  711. peg$currPos = s0;
  712. s0 = peg$FAILED;
  713. }
  714. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  715. return s0;
  716. }
  717. function peg$parseidentifier() {
  718. var s0, s1, s2, s3, s4;
  719. var key = peg$currPos * 63 + 6,
  720. cached = peg$resultsCache[key];
  721. if (cached) {
  722. peg$currPos = cached.nextPos;
  723. return cached.result;
  724. }
  725. s0 = peg$currPos;
  726. s1 = peg$currPos;
  727. if (peg$c8.test(input.charAt(peg$currPos))) {
  728. s2 = input.charAt(peg$currPos);
  729. peg$currPos++;
  730. } else {
  731. s2 = peg$FAILED;
  732. if (peg$silentFails === 0) { peg$fail(peg$c9); }
  733. }
  734. if (s2 !== peg$FAILED) {
  735. s3 = [];
  736. if (peg$c10.test(input.charAt(peg$currPos))) {
  737. s4 = input.charAt(peg$currPos);
  738. peg$currPos++;
  739. } else {
  740. s4 = peg$FAILED;
  741. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  742. }
  743. while (s4 !== peg$FAILED) {
  744. s3.push(s4);
  745. if (peg$c10.test(input.charAt(peg$currPos))) {
  746. s4 = input.charAt(peg$currPos);
  747. peg$currPos++;
  748. } else {
  749. s4 = peg$FAILED;
  750. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  751. }
  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$parsekeyword() {
  773. var s0, s1, s2, s3;
  774. var key = peg$currPos * 63 + 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. s2 = peg$parseidentifier();
  783. if (s2 !== peg$FAILED) {
  784. if (input.charCodeAt(peg$currPos) === 58) {
  785. s3 = peg$c12;
  786. peg$currPos++;
  787. } else {
  788. s3 = peg$FAILED;
  789. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  790. }
  791. if (s3 !== peg$FAILED) {
  792. s2 = [s2, s3];
  793. s1 = s2;
  794. } else {
  795. peg$currPos = s1;
  796. s1 = peg$FAILED;
  797. }
  798. } else {
  799. peg$currPos = s1;
  800. s1 = peg$FAILED;
  801. }
  802. if (s1 !== peg$FAILED) {
  803. s0 = input.substring(s0, peg$currPos);
  804. } else {
  805. s0 = s1;
  806. }
  807. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  808. return s0;
  809. }
  810. function peg$parseclassName() {
  811. var s0, s1, s2, s3, s4;
  812. var key = peg$currPos * 63 + 8,
  813. cached = peg$resultsCache[key];
  814. if (cached) {
  815. peg$currPos = cached.nextPos;
  816. return cached.result;
  817. }
  818. s0 = peg$currPos;
  819. s1 = peg$currPos;
  820. if (peg$c14.test(input.charAt(peg$currPos))) {
  821. s2 = input.charAt(peg$currPos);
  822. peg$currPos++;
  823. } else {
  824. s2 = peg$FAILED;
  825. if (peg$silentFails === 0) { peg$fail(peg$c15); }
  826. }
  827. if (s2 !== peg$FAILED) {
  828. s3 = [];
  829. if (peg$c10.test(input.charAt(peg$currPos))) {
  830. s4 = input.charAt(peg$currPos);
  831. peg$currPos++;
  832. } else {
  833. s4 = peg$FAILED;
  834. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  835. }
  836. while (s4 !== peg$FAILED) {
  837. s3.push(s4);
  838. if (peg$c10.test(input.charAt(peg$currPos))) {
  839. s4 = input.charAt(peg$currPos);
  840. peg$currPos++;
  841. } else {
  842. s4 = peg$FAILED;
  843. if (peg$silentFails === 0) { peg$fail(peg$c11); }
  844. }
  845. }
  846. if (s3 !== peg$FAILED) {
  847. s2 = [s2, s3];
  848. s1 = s2;
  849. } else {
  850. peg$currPos = s1;
  851. s1 = peg$FAILED;
  852. }
  853. } else {
  854. peg$currPos = s1;
  855. s1 = peg$FAILED;
  856. }
  857. if (s1 !== peg$FAILED) {
  858. s0 = input.substring(s0, peg$currPos);
  859. } else {
  860. s0 = s1;
  861. }
  862. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  863. return s0;
  864. }
  865. function peg$parsestring() {
  866. var s0, s1;
  867. var key = peg$currPos * 63 + 9,
  868. cached = peg$resultsCache[key];
  869. if (cached) {
  870. peg$currPos = cached.nextPos;
  871. return cached.result;
  872. }
  873. s0 = peg$currPos;
  874. s1 = peg$parserawString();
  875. if (s1 !== peg$FAILED) {
  876. peg$savedPos = s0;
  877. s1 = peg$c16(s1);
  878. }
  879. s0 = s1;
  880. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  881. return s0;
  882. }
  883. function peg$parserawString() {
  884. var s0, s1, s2, s3, s4;
  885. var key = peg$currPos * 63 + 10,
  886. cached = peg$resultsCache[key];
  887. if (cached) {
  888. peg$currPos = cached.nextPos;
  889. return cached.result;
  890. }
  891. s0 = peg$currPos;
  892. if (input.charCodeAt(peg$currPos) === 39) {
  893. s1 = peg$c17;
  894. peg$currPos++;
  895. } else {
  896. s1 = peg$FAILED;
  897. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  898. }
  899. if (s1 !== peg$FAILED) {
  900. s2 = [];
  901. s3 = peg$currPos;
  902. if (input.substr(peg$currPos, 2) === peg$c19) {
  903. s4 = peg$c19;
  904. peg$currPos += 2;
  905. } else {
  906. s4 = peg$FAILED;
  907. if (peg$silentFails === 0) { peg$fail(peg$c20); }
  908. }
  909. if (s4 !== peg$FAILED) {
  910. peg$savedPos = s3;
  911. s4 = peg$c21();
  912. }
  913. s3 = s4;
  914. if (s3 === peg$FAILED) {
  915. if (peg$c22.test(input.charAt(peg$currPos))) {
  916. s3 = input.charAt(peg$currPos);
  917. peg$currPos++;
  918. } else {
  919. s3 = peg$FAILED;
  920. if (peg$silentFails === 0) { peg$fail(peg$c23); }
  921. }
  922. }
  923. while (s3 !== peg$FAILED) {
  924. s2.push(s3);
  925. s3 = peg$currPos;
  926. if (input.substr(peg$currPos, 2) === peg$c19) {
  927. s4 = peg$c19;
  928. peg$currPos += 2;
  929. } else {
  930. s4 = peg$FAILED;
  931. if (peg$silentFails === 0) { peg$fail(peg$c20); }
  932. }
  933. if (s4 !== peg$FAILED) {
  934. peg$savedPos = s3;
  935. s4 = peg$c21();
  936. }
  937. s3 = s4;
  938. if (s3 === peg$FAILED) {
  939. if (peg$c22.test(input.charAt(peg$currPos))) {
  940. s3 = input.charAt(peg$currPos);
  941. peg$currPos++;
  942. } else {
  943. s3 = peg$FAILED;
  944. if (peg$silentFails === 0) { peg$fail(peg$c23); }
  945. }
  946. }
  947. }
  948. if (s2 !== peg$FAILED) {
  949. if (input.charCodeAt(peg$currPos) === 39) {
  950. s3 = peg$c17;
  951. peg$currPos++;
  952. } else {
  953. s3 = peg$FAILED;
  954. if (peg$silentFails === 0) { peg$fail(peg$c18); }
  955. }
  956. if (s3 !== peg$FAILED) {
  957. peg$savedPos = s0;
  958. s1 = peg$c24(s2);
  959. s0 = s1;
  960. } else {
  961. peg$currPos = s0;
  962. s0 = peg$FAILED;
  963. }
  964. } else {
  965. peg$currPos = s0;
  966. s0 = peg$FAILED;
  967. }
  968. } else {
  969. peg$currPos = s0;
  970. s0 = peg$FAILED;
  971. }
  972. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  973. return s0;
  974. }
  975. function peg$parsecharacter() {
  976. var s0, s1, s2;
  977. var key = peg$currPos * 63 + 11,
  978. cached = peg$resultsCache[key];
  979. if (cached) {
  980. peg$currPos = cached.nextPos;
  981. return cached.result;
  982. }
  983. s0 = peg$currPos;
  984. if (input.charCodeAt(peg$currPos) === 36) {
  985. s1 = peg$c25;
  986. peg$currPos++;
  987. } else {
  988. s1 = peg$FAILED;
  989. if (peg$silentFails === 0) { peg$fail(peg$c26); }
  990. }
  991. if (s1 !== peg$FAILED) {
  992. if (input.length > peg$currPos) {
  993. s2 = input.charAt(peg$currPos);
  994. peg$currPos++;
  995. } else {
  996. s2 = peg$FAILED;
  997. if (peg$silentFails === 0) { peg$fail(peg$c27); }
  998. }
  999. if (s2 !== peg$FAILED) {
  1000. peg$savedPos = s0;
  1001. s1 = peg$c28(s2);
  1002. s0 = s1;
  1003. } else {
  1004. peg$currPos = s0;
  1005. s0 = peg$FAILED;
  1006. }
  1007. } else {
  1008. peg$currPos = s0;
  1009. s0 = peg$FAILED;
  1010. }
  1011. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1012. return s0;
  1013. }
  1014. function peg$parsesymbol() {
  1015. var s0, s1, s2;
  1016. var key = peg$currPos * 63 + 12,
  1017. cached = peg$resultsCache[key];
  1018. if (cached) {
  1019. peg$currPos = cached.nextPos;
  1020. return cached.result;
  1021. }
  1022. s0 = peg$currPos;
  1023. if (input.charCodeAt(peg$currPos) === 35) {
  1024. s1 = peg$c29;
  1025. peg$currPos++;
  1026. } else {
  1027. s1 = peg$FAILED;
  1028. if (peg$silentFails === 0) { peg$fail(peg$c30); }
  1029. }
  1030. if (s1 !== peg$FAILED) {
  1031. s2 = peg$parsebareSymbol();
  1032. if (s2 !== peg$FAILED) {
  1033. peg$savedPos = s0;
  1034. s1 = peg$c31(s2);
  1035. s0 = s1;
  1036. } else {
  1037. peg$currPos = s0;
  1038. s0 = peg$FAILED;
  1039. }
  1040. } else {
  1041. peg$currPos = s0;
  1042. s0 = peg$FAILED;
  1043. }
  1044. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1045. return s0;
  1046. }
  1047. function peg$parsebareSymbol() {
  1048. var s0, s1, s2, s3;
  1049. var key = peg$currPos * 63 + 13,
  1050. cached = peg$resultsCache[key];
  1051. if (cached) {
  1052. peg$currPos = cached.nextPos;
  1053. return cached.result;
  1054. }
  1055. s0 = peg$currPos;
  1056. s1 = peg$currPos;
  1057. s2 = [];
  1058. s3 = peg$parsekeyword();
  1059. if (s3 !== peg$FAILED) {
  1060. while (s3 !== peg$FAILED) {
  1061. s2.push(s3);
  1062. s3 = peg$parsekeyword();
  1063. }
  1064. } else {
  1065. s2 = peg$FAILED;
  1066. }
  1067. if (s2 !== peg$FAILED) {
  1068. s1 = input.substring(s1, peg$currPos);
  1069. } else {
  1070. s1 = s2;
  1071. }
  1072. if (s1 === peg$FAILED) {
  1073. s1 = peg$parsebinarySelector();
  1074. if (s1 === peg$FAILED) {
  1075. s1 = peg$parseidentifier();
  1076. if (s1 === peg$FAILED) {
  1077. s1 = peg$parserawString();
  1078. }
  1079. }
  1080. }
  1081. if (s1 !== peg$FAILED) {
  1082. peg$savedPos = s0;
  1083. s1 = peg$c16(s1);
  1084. }
  1085. s0 = s1;
  1086. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1087. return s0;
  1088. }
  1089. function peg$parsenumber() {
  1090. var s0, s1;
  1091. var key = peg$currPos * 63 + 14,
  1092. cached = peg$resultsCache[key];
  1093. if (cached) {
  1094. peg$currPos = cached.nextPos;
  1095. return cached.result;
  1096. }
  1097. s0 = peg$currPos;
  1098. s1 = peg$parserawNumber();
  1099. if (s1 !== peg$FAILED) {
  1100. peg$savedPos = s0;
  1101. s1 = peg$c16(s1);
  1102. }
  1103. s0 = s1;
  1104. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1105. return s0;
  1106. }
  1107. function peg$parserawNumber() {
  1108. var s0;
  1109. var key = peg$currPos * 63 + 15,
  1110. cached = peg$resultsCache[key];
  1111. if (cached) {
  1112. peg$currPos = cached.nextPos;
  1113. return cached.result;
  1114. }
  1115. s0 = peg$parsenumberExp();
  1116. if (s0 === peg$FAILED) {
  1117. s0 = peg$parsehex();
  1118. if (s0 === peg$FAILED) {
  1119. s0 = peg$parsefloat();
  1120. if (s0 === peg$FAILED) {
  1121. s0 = peg$parseinteger();
  1122. }
  1123. }
  1124. }
  1125. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1126. return s0;
  1127. }
  1128. function peg$parsenumberExp() {
  1129. var s0, s1, s2, s3, s4, s5;
  1130. var key = peg$currPos * 63 + 16,
  1131. cached = peg$resultsCache[key];
  1132. if (cached) {
  1133. peg$currPos = cached.nextPos;
  1134. return cached.result;
  1135. }
  1136. s0 = peg$currPos;
  1137. s1 = peg$currPos;
  1138. s2 = peg$currPos;
  1139. s3 = peg$parsefloat();
  1140. if (s3 === peg$FAILED) {
  1141. s3 = peg$parseinteger();
  1142. }
  1143. if (s3 !== peg$FAILED) {
  1144. if (input.charCodeAt(peg$currPos) === 101) {
  1145. s4 = peg$c32;
  1146. peg$currPos++;
  1147. } else {
  1148. s4 = peg$FAILED;
  1149. if (peg$silentFails === 0) { peg$fail(peg$c33); }
  1150. }
  1151. if (s4 !== peg$FAILED) {
  1152. s5 = peg$parseinteger();
  1153. if (s5 !== peg$FAILED) {
  1154. s3 = [s3, s4, s5];
  1155. s2 = s3;
  1156. } else {
  1157. peg$currPos = s2;
  1158. s2 = peg$FAILED;
  1159. }
  1160. } else {
  1161. peg$currPos = s2;
  1162. s2 = peg$FAILED;
  1163. }
  1164. } else {
  1165. peg$currPos = s2;
  1166. s2 = peg$FAILED;
  1167. }
  1168. if (s2 !== peg$FAILED) {
  1169. s1 = input.substring(s1, peg$currPos);
  1170. } else {
  1171. s1 = s2;
  1172. }
  1173. if (s1 !== peg$FAILED) {
  1174. peg$savedPos = s0;
  1175. s1 = peg$c34(s1);
  1176. }
  1177. s0 = s1;
  1178. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1179. return s0;
  1180. }
  1181. function peg$parsehex() {
  1182. var s0, s1, s2, s3, s4, s5;
  1183. var key = peg$currPos * 63 + 17,
  1184. cached = peg$resultsCache[key];
  1185. if (cached) {
  1186. peg$currPos = cached.nextPos;
  1187. return cached.result;
  1188. }
  1189. s0 = peg$currPos;
  1190. if (input.charCodeAt(peg$currPos) === 45) {
  1191. s1 = peg$c35;
  1192. peg$currPos++;
  1193. } else {
  1194. s1 = peg$FAILED;
  1195. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1196. }
  1197. if (s1 === peg$FAILED) {
  1198. s1 = null;
  1199. }
  1200. if (s1 !== peg$FAILED) {
  1201. if (input.substr(peg$currPos, 3) === peg$c37) {
  1202. s2 = peg$c37;
  1203. peg$currPos += 3;
  1204. } else {
  1205. s2 = peg$FAILED;
  1206. if (peg$silentFails === 0) { peg$fail(peg$c38); }
  1207. }
  1208. if (s2 !== peg$FAILED) {
  1209. s3 = peg$currPos;
  1210. s4 = [];
  1211. if (peg$c39.test(input.charAt(peg$currPos))) {
  1212. s5 = input.charAt(peg$currPos);
  1213. peg$currPos++;
  1214. } else {
  1215. s5 = peg$FAILED;
  1216. if (peg$silentFails === 0) { peg$fail(peg$c40); }
  1217. }
  1218. if (s5 !== peg$FAILED) {
  1219. while (s5 !== peg$FAILED) {
  1220. s4.push(s5);
  1221. if (peg$c39.test(input.charAt(peg$currPos))) {
  1222. s5 = input.charAt(peg$currPos);
  1223. peg$currPos++;
  1224. } else {
  1225. s5 = peg$FAILED;
  1226. if (peg$silentFails === 0) { peg$fail(peg$c40); }
  1227. }
  1228. }
  1229. } else {
  1230. s4 = peg$FAILED;
  1231. }
  1232. if (s4 !== peg$FAILED) {
  1233. s3 = input.substring(s3, peg$currPos);
  1234. } else {
  1235. s3 = s4;
  1236. }
  1237. if (s3 !== peg$FAILED) {
  1238. peg$savedPos = s0;
  1239. s1 = peg$c41(s1, s3);
  1240. s0 = s1;
  1241. } else {
  1242. peg$currPos = s0;
  1243. s0 = peg$FAILED;
  1244. }
  1245. } else {
  1246. peg$currPos = s0;
  1247. s0 = peg$FAILED;
  1248. }
  1249. } else {
  1250. peg$currPos = s0;
  1251. s0 = peg$FAILED;
  1252. }
  1253. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1254. return s0;
  1255. }
  1256. function peg$parsefloat() {
  1257. var s0, s1, s2, s3, s4, s5, s6, s7;
  1258. var key = peg$currPos * 63 + 18,
  1259. cached = peg$resultsCache[key];
  1260. if (cached) {
  1261. peg$currPos = cached.nextPos;
  1262. return cached.result;
  1263. }
  1264. s0 = peg$currPos;
  1265. s1 = peg$currPos;
  1266. s2 = peg$currPos;
  1267. if (input.charCodeAt(peg$currPos) === 45) {
  1268. s3 = peg$c35;
  1269. peg$currPos++;
  1270. } else {
  1271. s3 = peg$FAILED;
  1272. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1273. }
  1274. if (s3 === peg$FAILED) {
  1275. s3 = null;
  1276. }
  1277. if (s3 !== peg$FAILED) {
  1278. s4 = [];
  1279. if (peg$c42.test(input.charAt(peg$currPos))) {
  1280. s5 = input.charAt(peg$currPos);
  1281. peg$currPos++;
  1282. } else {
  1283. s5 = peg$FAILED;
  1284. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1285. }
  1286. if (s5 !== peg$FAILED) {
  1287. while (s5 !== peg$FAILED) {
  1288. s4.push(s5);
  1289. if (peg$c42.test(input.charAt(peg$currPos))) {
  1290. s5 = input.charAt(peg$currPos);
  1291. peg$currPos++;
  1292. } else {
  1293. s5 = peg$FAILED;
  1294. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1295. }
  1296. }
  1297. } else {
  1298. s4 = peg$FAILED;
  1299. }
  1300. if (s4 !== peg$FAILED) {
  1301. if (input.charCodeAt(peg$currPos) === 46) {
  1302. s5 = peg$c6;
  1303. peg$currPos++;
  1304. } else {
  1305. s5 = peg$FAILED;
  1306. if (peg$silentFails === 0) { peg$fail(peg$c7); }
  1307. }
  1308. if (s5 !== peg$FAILED) {
  1309. s6 = [];
  1310. if (peg$c42.test(input.charAt(peg$currPos))) {
  1311. s7 = input.charAt(peg$currPos);
  1312. peg$currPos++;
  1313. } else {
  1314. s7 = peg$FAILED;
  1315. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1316. }
  1317. if (s7 !== peg$FAILED) {
  1318. while (s7 !== peg$FAILED) {
  1319. s6.push(s7);
  1320. if (peg$c42.test(input.charAt(peg$currPos))) {
  1321. s7 = input.charAt(peg$currPos);
  1322. peg$currPos++;
  1323. } else {
  1324. s7 = peg$FAILED;
  1325. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1326. }
  1327. }
  1328. } else {
  1329. s6 = peg$FAILED;
  1330. }
  1331. if (s6 !== peg$FAILED) {
  1332. s3 = [s3, s4, s5, s6];
  1333. s2 = s3;
  1334. } else {
  1335. peg$currPos = s2;
  1336. s2 = peg$FAILED;
  1337. }
  1338. } else {
  1339. peg$currPos = s2;
  1340. s2 = peg$FAILED;
  1341. }
  1342. } else {
  1343. peg$currPos = s2;
  1344. s2 = peg$FAILED;
  1345. }
  1346. } else {
  1347. peg$currPos = s2;
  1348. s2 = peg$FAILED;
  1349. }
  1350. if (s2 !== peg$FAILED) {
  1351. s1 = input.substring(s1, peg$currPos);
  1352. } else {
  1353. s1 = s2;
  1354. }
  1355. if (s1 !== peg$FAILED) {
  1356. peg$savedPos = s0;
  1357. s1 = peg$c44(s1);
  1358. }
  1359. s0 = s1;
  1360. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1361. return s0;
  1362. }
  1363. function peg$parseinteger() {
  1364. var s0, s1, s2, s3, s4, s5;
  1365. var key = peg$currPos * 63 + 19,
  1366. cached = peg$resultsCache[key];
  1367. if (cached) {
  1368. peg$currPos = cached.nextPos;
  1369. return cached.result;
  1370. }
  1371. s0 = peg$currPos;
  1372. s1 = peg$currPos;
  1373. s2 = peg$currPos;
  1374. if (input.charCodeAt(peg$currPos) === 45) {
  1375. s3 = peg$c35;
  1376. peg$currPos++;
  1377. } else {
  1378. s3 = peg$FAILED;
  1379. if (peg$silentFails === 0) { peg$fail(peg$c36); }
  1380. }
  1381. if (s3 === peg$FAILED) {
  1382. s3 = null;
  1383. }
  1384. if (s3 !== peg$FAILED) {
  1385. s4 = [];
  1386. if (peg$c42.test(input.charAt(peg$currPos))) {
  1387. s5 = input.charAt(peg$currPos);
  1388. peg$currPos++;
  1389. } else {
  1390. s5 = peg$FAILED;
  1391. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1392. }
  1393. if (s5 !== peg$FAILED) {
  1394. while (s5 !== peg$FAILED) {
  1395. s4.push(s5);
  1396. if (peg$c42.test(input.charAt(peg$currPos))) {
  1397. s5 = input.charAt(peg$currPos);
  1398. peg$currPos++;
  1399. } else {
  1400. s5 = peg$FAILED;
  1401. if (peg$silentFails === 0) { peg$fail(peg$c43); }
  1402. }
  1403. }
  1404. } else {
  1405. s4 = peg$FAILED;
  1406. }
  1407. if (s4 !== peg$FAILED) {
  1408. s3 = [s3, s4];
  1409. s2 = s3;
  1410. } else {
  1411. peg$currPos = s2;
  1412. s2 = peg$FAILED;
  1413. }
  1414. } else {
  1415. peg$currPos = s2;
  1416. s2 = peg$FAILED;
  1417. }
  1418. if (s2 !== peg$FAILED) {
  1419. s1 = input.substring(s1, peg$currPos);
  1420. } else {
  1421. s1 = s2;
  1422. }
  1423. if (s1 !== peg$FAILED) {
  1424. peg$savedPos = s0;
  1425. s1 = peg$c45(s1);
  1426. }
  1427. s0 = s1;
  1428. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1429. return s0;
  1430. }
  1431. function peg$parseliteralArray() {
  1432. var s0, s1, s2, s3, s4;
  1433. var key = peg$currPos * 63 + 20,
  1434. cached = peg$resultsCache[key];
  1435. if (cached) {
  1436. peg$currPos = cached.nextPos;
  1437. return cached.result;
  1438. }
  1439. s0 = peg$currPos;
  1440. if (input.substr(peg$currPos, 2) === peg$c46) {
  1441. s1 = peg$c46;
  1442. peg$currPos += 2;
  1443. } else {
  1444. s1 = peg$FAILED;
  1445. if (peg$silentFails === 0) { peg$fail(peg$c47); }
  1446. }
  1447. if (s1 !== peg$FAILED) {
  1448. s2 = peg$parsewsLiteralArrayContents();
  1449. if (s2 !== peg$FAILED) {
  1450. s3 = peg$parsews();
  1451. if (s3 !== peg$FAILED) {
  1452. if (input.charCodeAt(peg$currPos) === 41) {
  1453. s4 = peg$c48;
  1454. peg$currPos++;
  1455. } else {
  1456. s4 = peg$FAILED;
  1457. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  1458. }
  1459. if (s4 !== peg$FAILED) {
  1460. peg$savedPos = s0;
  1461. s1 = peg$c50(s2);
  1462. s0 = s1;
  1463. } else {
  1464. peg$currPos = s0;
  1465. s0 = peg$FAILED;
  1466. }
  1467. } else {
  1468. peg$currPos = s0;
  1469. s0 = peg$FAILED;
  1470. }
  1471. } else {
  1472. peg$currPos = s0;
  1473. s0 = peg$FAILED;
  1474. }
  1475. } else {
  1476. peg$currPos = s0;
  1477. s0 = peg$FAILED;
  1478. }
  1479. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1480. return s0;
  1481. }
  1482. function peg$parsebareLiteralArray() {
  1483. var s0, s1, s2, s3, s4;
  1484. var key = peg$currPos * 63 + 21,
  1485. cached = peg$resultsCache[key];
  1486. if (cached) {
  1487. peg$currPos = cached.nextPos;
  1488. return cached.result;
  1489. }
  1490. s0 = peg$currPos;
  1491. if (input.charCodeAt(peg$currPos) === 40) {
  1492. s1 = peg$c51;
  1493. peg$currPos++;
  1494. } else {
  1495. s1 = peg$FAILED;
  1496. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  1497. }
  1498. if (s1 !== peg$FAILED) {
  1499. s2 = peg$parsewsLiteralArrayContents();
  1500. if (s2 !== peg$FAILED) {
  1501. s3 = peg$parsews();
  1502. if (s3 !== peg$FAILED) {
  1503. if (input.charCodeAt(peg$currPos) === 41) {
  1504. s4 = peg$c48;
  1505. peg$currPos++;
  1506. } else {
  1507. s4 = peg$FAILED;
  1508. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  1509. }
  1510. if (s4 !== peg$FAILED) {
  1511. peg$savedPos = s0;
  1512. s1 = peg$c50(s2);
  1513. s0 = s1;
  1514. } else {
  1515. peg$currPos = s0;
  1516. s0 = peg$FAILED;
  1517. }
  1518. } else {
  1519. peg$currPos = s0;
  1520. s0 = peg$FAILED;
  1521. }
  1522. } else {
  1523. peg$currPos = s0;
  1524. s0 = peg$FAILED;
  1525. }
  1526. } else {
  1527. peg$currPos = s0;
  1528. s0 = peg$FAILED;
  1529. }
  1530. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1531. return s0;
  1532. }
  1533. function peg$parseliteralArrayElement() {
  1534. var s0;
  1535. var key = peg$currPos * 63 + 22,
  1536. cached = peg$resultsCache[key];
  1537. if (cached) {
  1538. peg$currPos = cached.nextPos;
  1539. return cached.result;
  1540. }
  1541. s0 = peg$parseparseTimeLiteral();
  1542. if (s0 === peg$FAILED) {
  1543. s0 = peg$parsebareLiteralArray();
  1544. if (s0 === peg$FAILED) {
  1545. s0 = peg$parsebareSymbol();
  1546. }
  1547. }
  1548. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1549. return s0;
  1550. }
  1551. function peg$parsewsLiteralArrayContents() {
  1552. var s0, s1, s2, s3, s4;
  1553. var key = peg$currPos * 63 + 23,
  1554. cached = peg$resultsCache[key];
  1555. if (cached) {
  1556. peg$currPos = cached.nextPos;
  1557. return cached.result;
  1558. }
  1559. s0 = peg$currPos;
  1560. s1 = [];
  1561. s2 = peg$currPos;
  1562. s3 = peg$parsews();
  1563. if (s3 !== peg$FAILED) {
  1564. s4 = peg$parseliteralArrayElement();
  1565. if (s4 !== peg$FAILED) {
  1566. peg$savedPos = s2;
  1567. s3 = peg$c53(s4);
  1568. s2 = s3;
  1569. } else {
  1570. peg$currPos = s2;
  1571. s2 = peg$FAILED;
  1572. }
  1573. } else {
  1574. peg$currPos = s2;
  1575. s2 = peg$FAILED;
  1576. }
  1577. while (s2 !== peg$FAILED) {
  1578. s1.push(s2);
  1579. s2 = peg$currPos;
  1580. s3 = peg$parsews();
  1581. if (s3 !== peg$FAILED) {
  1582. s4 = peg$parseliteralArrayElement();
  1583. if (s4 !== peg$FAILED) {
  1584. peg$savedPos = s2;
  1585. s3 = peg$c53(s4);
  1586. s2 = s3;
  1587. } else {
  1588. peg$currPos = s2;
  1589. s2 = peg$FAILED;
  1590. }
  1591. } else {
  1592. peg$currPos = s2;
  1593. s2 = peg$FAILED;
  1594. }
  1595. }
  1596. if (s1 !== peg$FAILED) {
  1597. peg$savedPos = s0;
  1598. s1 = peg$c54(s1);
  1599. }
  1600. s0 = s1;
  1601. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1602. return s0;
  1603. }
  1604. function peg$parsedynamicArray() {
  1605. var s0, s1, s2, s3, s4;
  1606. var key = peg$currPos * 63 + 24,
  1607. cached = peg$resultsCache[key];
  1608. if (cached) {
  1609. peg$currPos = cached.nextPos;
  1610. return cached.result;
  1611. }
  1612. s0 = peg$currPos;
  1613. if (input.charCodeAt(peg$currPos) === 123) {
  1614. s1 = peg$c55;
  1615. peg$currPos++;
  1616. } else {
  1617. s1 = peg$FAILED;
  1618. if (peg$silentFails === 0) { peg$fail(peg$c56); }
  1619. }
  1620. if (s1 !== peg$FAILED) {
  1621. s2 = peg$parsewsExpressions();
  1622. if (s2 === peg$FAILED) {
  1623. s2 = null;
  1624. }
  1625. if (s2 !== peg$FAILED) {
  1626. s3 = peg$parsemaybeDotsWs();
  1627. if (s3 !== peg$FAILED) {
  1628. if (input.charCodeAt(peg$currPos) === 125) {
  1629. s4 = peg$c57;
  1630. peg$currPos++;
  1631. } else {
  1632. s4 = peg$FAILED;
  1633. if (peg$silentFails === 0) { peg$fail(peg$c58); }
  1634. }
  1635. if (s4 !== peg$FAILED) {
  1636. peg$savedPos = s0;
  1637. s1 = peg$c59(s2);
  1638. s0 = s1;
  1639. } else {
  1640. peg$currPos = s0;
  1641. s0 = peg$FAILED;
  1642. }
  1643. } else {
  1644. peg$currPos = s0;
  1645. s0 = peg$FAILED;
  1646. }
  1647. } else {
  1648. peg$currPos = s0;
  1649. s0 = peg$FAILED;
  1650. }
  1651. } else {
  1652. peg$currPos = s0;
  1653. s0 = peg$FAILED;
  1654. }
  1655. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1656. return s0;
  1657. }
  1658. function peg$parsedynamicDictionary() {
  1659. var s0, s1, s2, s3, s4;
  1660. var key = peg$currPos * 63 + 25,
  1661. cached = peg$resultsCache[key];
  1662. if (cached) {
  1663. peg$currPos = cached.nextPos;
  1664. return cached.result;
  1665. }
  1666. s0 = peg$currPos;
  1667. if (input.substr(peg$currPos, 2) === peg$c60) {
  1668. s1 = peg$c60;
  1669. peg$currPos += 2;
  1670. } else {
  1671. s1 = peg$FAILED;
  1672. if (peg$silentFails === 0) { peg$fail(peg$c61); }
  1673. }
  1674. if (s1 !== peg$FAILED) {
  1675. s2 = peg$parsewsAssociations();
  1676. if (s2 === peg$FAILED) {
  1677. s2 = null;
  1678. }
  1679. if (s2 !== peg$FAILED) {
  1680. s3 = peg$parsemaybeDotsWs();
  1681. if (s3 !== peg$FAILED) {
  1682. if (input.charCodeAt(peg$currPos) === 125) {
  1683. s4 = peg$c57;
  1684. peg$currPos++;
  1685. } else {
  1686. s4 = peg$FAILED;
  1687. if (peg$silentFails === 0) { peg$fail(peg$c58); }
  1688. }
  1689. if (s4 !== peg$FAILED) {
  1690. peg$savedPos = s0;
  1691. s1 = peg$c62(s2);
  1692. s0 = s1;
  1693. } else {
  1694. peg$currPos = s0;
  1695. s0 = peg$FAILED;
  1696. }
  1697. } else {
  1698. peg$currPos = s0;
  1699. s0 = peg$FAILED;
  1700. }
  1701. } else {
  1702. peg$currPos = s0;
  1703. s0 = peg$FAILED;
  1704. }
  1705. } else {
  1706. peg$currPos = s0;
  1707. s0 = peg$FAILED;
  1708. }
  1709. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1710. return s0;
  1711. }
  1712. function peg$parsepseudoVariable() {
  1713. var s0, s1, s2;
  1714. var key = peg$currPos * 63 + 26,
  1715. cached = peg$resultsCache[key];
  1716. if (cached) {
  1717. peg$currPos = cached.nextPos;
  1718. return cached.result;
  1719. }
  1720. s0 = peg$currPos;
  1721. s1 = peg$currPos;
  1722. if (input.substr(peg$currPos, 4) === peg$c63) {
  1723. s2 = peg$c63;
  1724. peg$currPos += 4;
  1725. } else {
  1726. s2 = peg$FAILED;
  1727. if (peg$silentFails === 0) { peg$fail(peg$c64); }
  1728. }
  1729. if (s2 !== peg$FAILED) {
  1730. peg$savedPos = s1;
  1731. s2 = peg$c65();
  1732. }
  1733. s1 = s2;
  1734. if (s1 === peg$FAILED) {
  1735. s1 = peg$currPos;
  1736. if (input.substr(peg$currPos, 5) === peg$c66) {
  1737. s2 = peg$c66;
  1738. peg$currPos += 5;
  1739. } else {
  1740. s2 = peg$FAILED;
  1741. if (peg$silentFails === 0) { peg$fail(peg$c67); }
  1742. }
  1743. if (s2 !== peg$FAILED) {
  1744. peg$savedPos = s1;
  1745. s2 = peg$c68();
  1746. }
  1747. s1 = s2;
  1748. if (s1 === peg$FAILED) {
  1749. s1 = peg$currPos;
  1750. if (input.substr(peg$currPos, 3) === peg$c69) {
  1751. s2 = peg$c69;
  1752. peg$currPos += 3;
  1753. } else {
  1754. s2 = peg$FAILED;
  1755. if (peg$silentFails === 0) { peg$fail(peg$c70); }
  1756. }
  1757. if (s2 !== peg$FAILED) {
  1758. peg$savedPos = s1;
  1759. s2 = peg$c71();
  1760. }
  1761. s1 = s2;
  1762. }
  1763. }
  1764. if (s1 !== peg$FAILED) {
  1765. peg$savedPos = s0;
  1766. s1 = peg$c16(s1);
  1767. }
  1768. s0 = s1;
  1769. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1770. return s0;
  1771. }
  1772. function peg$parseparseTimeLiteral() {
  1773. var s0;
  1774. var key = peg$currPos * 63 + 27,
  1775. cached = peg$resultsCache[key];
  1776. if (cached) {
  1777. peg$currPos = cached.nextPos;
  1778. return cached.result;
  1779. }
  1780. s0 = peg$parsepseudoVariable();
  1781. if (s0 === peg$FAILED) {
  1782. s0 = peg$parsenumber();
  1783. if (s0 === peg$FAILED) {
  1784. s0 = peg$parseliteralArray();
  1785. if (s0 === peg$FAILED) {
  1786. s0 = peg$parsestring();
  1787. if (s0 === peg$FAILED) {
  1788. s0 = peg$parsesymbol();
  1789. if (s0 === peg$FAILED) {
  1790. s0 = peg$parsecharacter();
  1791. }
  1792. }
  1793. }
  1794. }
  1795. }
  1796. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1797. return s0;
  1798. }
  1799. function peg$parseruntimeLiteral() {
  1800. var s0;
  1801. var key = peg$currPos * 63 + 28,
  1802. cached = peg$resultsCache[key];
  1803. if (cached) {
  1804. peg$currPos = cached.nextPos;
  1805. return cached.result;
  1806. }
  1807. s0 = peg$parsedynamicDictionary();
  1808. if (s0 === peg$FAILED) {
  1809. s0 = peg$parsedynamicArray();
  1810. if (s0 === peg$FAILED) {
  1811. s0 = peg$parseblock();
  1812. }
  1813. }
  1814. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1815. return s0;
  1816. }
  1817. function peg$parseliteral() {
  1818. var s0;
  1819. var key = peg$currPos * 63 + 29,
  1820. cached = peg$resultsCache[key];
  1821. if (cached) {
  1822. peg$currPos = cached.nextPos;
  1823. return cached.result;
  1824. }
  1825. s0 = peg$parseruntimeLiteral();
  1826. if (s0 === peg$FAILED) {
  1827. s0 = peg$parseparseTimeLiteral();
  1828. }
  1829. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1830. return s0;
  1831. }
  1832. function peg$parsevariable() {
  1833. var s0, s1;
  1834. var key = peg$currPos * 63 + 30,
  1835. cached = peg$resultsCache[key];
  1836. if (cached) {
  1837. peg$currPos = cached.nextPos;
  1838. return cached.result;
  1839. }
  1840. s0 = peg$currPos;
  1841. s1 = peg$parseidentifier();
  1842. if (s1 !== peg$FAILED) {
  1843. peg$savedPos = s0;
  1844. s1 = peg$c72(s1);
  1845. }
  1846. s0 = s1;
  1847. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1848. return s0;
  1849. }
  1850. function peg$parsebinarySelector() {
  1851. var s0, s1, s2;
  1852. var key = peg$currPos * 63 + 31,
  1853. cached = peg$resultsCache[key];
  1854. if (cached) {
  1855. peg$currPos = cached.nextPos;
  1856. return cached.result;
  1857. }
  1858. s0 = peg$currPos;
  1859. s1 = [];
  1860. if (peg$c73.test(input.charAt(peg$currPos))) {
  1861. s2 = input.charAt(peg$currPos);
  1862. peg$currPos++;
  1863. } else {
  1864. s2 = peg$FAILED;
  1865. if (peg$silentFails === 0) { peg$fail(peg$c74); }
  1866. }
  1867. if (s2 !== peg$FAILED) {
  1868. while (s2 !== peg$FAILED) {
  1869. s1.push(s2);
  1870. if (peg$c73.test(input.charAt(peg$currPos))) {
  1871. s2 = input.charAt(peg$currPos);
  1872. peg$currPos++;
  1873. } else {
  1874. s2 = peg$FAILED;
  1875. if (peg$silentFails === 0) { peg$fail(peg$c74); }
  1876. }
  1877. }
  1878. } else {
  1879. s1 = peg$FAILED;
  1880. }
  1881. if (s1 !== peg$FAILED) {
  1882. s0 = input.substring(s0, peg$currPos);
  1883. } else {
  1884. s0 = s1;
  1885. }
  1886. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1887. return s0;
  1888. }
  1889. function peg$parsewsKeywordPattern() {
  1890. var s0, s1, s2, s3, s4, s5, s6;
  1891. var key = peg$currPos * 63 + 32,
  1892. cached = peg$resultsCache[key];
  1893. if (cached) {
  1894. peg$currPos = cached.nextPos;
  1895. return cached.result;
  1896. }
  1897. s0 = peg$currPos;
  1898. s1 = [];
  1899. s2 = peg$currPos;
  1900. s3 = peg$parsews();
  1901. if (s3 !== peg$FAILED) {
  1902. s4 = peg$parsekeyword();
  1903. if (s4 !== peg$FAILED) {
  1904. s5 = peg$parsews();
  1905. if (s5 !== peg$FAILED) {
  1906. s6 = peg$parseidentifier();
  1907. if (s6 !== peg$FAILED) {
  1908. peg$savedPos = s2;
  1909. s3 = peg$c75(s4, s6);
  1910. s2 = s3;
  1911. } else {
  1912. peg$currPos = s2;
  1913. s2 = peg$FAILED;
  1914. }
  1915. } else {
  1916. peg$currPos = s2;
  1917. s2 = peg$FAILED;
  1918. }
  1919. } else {
  1920. peg$currPos = s2;
  1921. s2 = peg$FAILED;
  1922. }
  1923. } else {
  1924. peg$currPos = s2;
  1925. s2 = peg$FAILED;
  1926. }
  1927. if (s2 !== peg$FAILED) {
  1928. while (s2 !== peg$FAILED) {
  1929. s1.push(s2);
  1930. s2 = peg$currPos;
  1931. s3 = peg$parsews();
  1932. if (s3 !== peg$FAILED) {
  1933. s4 = peg$parsekeyword();
  1934. if (s4 !== peg$FAILED) {
  1935. s5 = peg$parsews();
  1936. if (s5 !== peg$FAILED) {
  1937. s6 = peg$parseidentifier();
  1938. if (s6 !== peg$FAILED) {
  1939. peg$savedPos = s2;
  1940. s3 = peg$c75(s4, s6);
  1941. s2 = s3;
  1942. } else {
  1943. peg$currPos = s2;
  1944. s2 = peg$FAILED;
  1945. }
  1946. } else {
  1947. peg$currPos = s2;
  1948. s2 = peg$FAILED;
  1949. }
  1950. } else {
  1951. peg$currPos = s2;
  1952. s2 = peg$FAILED;
  1953. }
  1954. } else {
  1955. peg$currPos = s2;
  1956. s2 = peg$FAILED;
  1957. }
  1958. }
  1959. } else {
  1960. s1 = peg$FAILED;
  1961. }
  1962. if (s1 !== peg$FAILED) {
  1963. peg$savedPos = s0;
  1964. s1 = peg$c76(s1);
  1965. }
  1966. s0 = s1;
  1967. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  1968. return s0;
  1969. }
  1970. function peg$parsewsBinaryPattern() {
  1971. var s0, s1, s2, s3, s4;
  1972. var key = peg$currPos * 63 + 33,
  1973. cached = peg$resultsCache[key];
  1974. if (cached) {
  1975. peg$currPos = cached.nextPos;
  1976. return cached.result;
  1977. }
  1978. s0 = peg$currPos;
  1979. s1 = peg$parsews();
  1980. if (s1 !== peg$FAILED) {
  1981. s2 = peg$parsebinarySelector();
  1982. if (s2 !== peg$FAILED) {
  1983. s3 = peg$parsews();
  1984. if (s3 !== peg$FAILED) {
  1985. s4 = peg$parseidentifier();
  1986. if (s4 !== peg$FAILED) {
  1987. peg$savedPos = s0;
  1988. s1 = peg$c77(s2, s4);
  1989. s0 = s1;
  1990. } else {
  1991. peg$currPos = s0;
  1992. s0 = peg$FAILED;
  1993. }
  1994. } else {
  1995. peg$currPos = s0;
  1996. s0 = peg$FAILED;
  1997. }
  1998. } else {
  1999. peg$currPos = s0;
  2000. s0 = peg$FAILED;
  2001. }
  2002. } else {
  2003. peg$currPos = s0;
  2004. s0 = peg$FAILED;
  2005. }
  2006. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2007. return s0;
  2008. }
  2009. function peg$parsewsUnaryPattern() {
  2010. var s0, s1, s2;
  2011. var key = peg$currPos * 63 + 34,
  2012. cached = peg$resultsCache[key];
  2013. if (cached) {
  2014. peg$currPos = cached.nextPos;
  2015. return cached.result;
  2016. }
  2017. s0 = peg$currPos;
  2018. s1 = peg$parsews();
  2019. if (s1 !== peg$FAILED) {
  2020. s2 = peg$parseidentifier();
  2021. if (s2 !== peg$FAILED) {
  2022. peg$savedPos = s0;
  2023. s1 = peg$c78(s2);
  2024. s0 = s1;
  2025. } else {
  2026. peg$currPos = s0;
  2027. s0 = peg$FAILED;
  2028. }
  2029. } else {
  2030. peg$currPos = s0;
  2031. s0 = peg$FAILED;
  2032. }
  2033. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2034. return s0;
  2035. }
  2036. function peg$parseexpression() {
  2037. var s0;
  2038. var key = peg$currPos * 63 + 35,
  2039. cached = peg$resultsCache[key];
  2040. if (cached) {
  2041. peg$currPos = cached.nextPos;
  2042. return cached.result;
  2043. }
  2044. s0 = peg$parseassignment();
  2045. if (s0 === peg$FAILED) {
  2046. s0 = peg$parsecascade();
  2047. if (s0 === peg$FAILED) {
  2048. s0 = peg$parsekeywordSend();
  2049. }
  2050. }
  2051. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2052. return s0;
  2053. }
  2054. function peg$parsewsExpressionsRest() {
  2055. var s0, s1, s2;
  2056. var key = peg$currPos * 63 + 36,
  2057. cached = peg$resultsCache[key];
  2058. if (cached) {
  2059. peg$currPos = cached.nextPos;
  2060. return cached.result;
  2061. }
  2062. s0 = peg$currPos;
  2063. s1 = peg$parsesomeDotsWs();
  2064. if (s1 !== peg$FAILED) {
  2065. s2 = peg$parseexpression();
  2066. if (s2 !== peg$FAILED) {
  2067. peg$savedPos = s0;
  2068. s1 = peg$c79(s2);
  2069. s0 = s1;
  2070. } else {
  2071. peg$currPos = s0;
  2072. s0 = peg$FAILED;
  2073. }
  2074. } else {
  2075. peg$currPos = s0;
  2076. s0 = peg$FAILED;
  2077. }
  2078. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2079. return s0;
  2080. }
  2081. function peg$parsewsExpressions() {
  2082. var s0, s1, s2, s3, s4;
  2083. var key = peg$currPos * 63 + 37,
  2084. cached = peg$resultsCache[key];
  2085. if (cached) {
  2086. peg$currPos = cached.nextPos;
  2087. return cached.result;
  2088. }
  2089. s0 = peg$currPos;
  2090. s1 = peg$parsemaybeDotsWs();
  2091. if (s1 !== peg$FAILED) {
  2092. s2 = peg$parseexpression();
  2093. if (s2 !== peg$FAILED) {
  2094. s3 = [];
  2095. s4 = peg$parsewsExpressionsRest();
  2096. while (s4 !== peg$FAILED) {
  2097. s3.push(s4);
  2098. s4 = peg$parsewsExpressionsRest();
  2099. }
  2100. if (s3 !== peg$FAILED) {
  2101. peg$savedPos = s0;
  2102. s1 = peg$c80(s2, s3);
  2103. s0 = s1;
  2104. } else {
  2105. peg$currPos = s0;
  2106. s0 = peg$FAILED;
  2107. }
  2108. } else {
  2109. peg$currPos = s0;
  2110. s0 = peg$FAILED;
  2111. }
  2112. } else {
  2113. peg$currPos = s0;
  2114. s0 = peg$FAILED;
  2115. }
  2116. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2117. return s0;
  2118. }
  2119. function peg$parseassignment() {
  2120. var s0, s1, s2, s3, s4, s5;
  2121. var key = peg$currPos * 63 + 38,
  2122. cached = peg$resultsCache[key];
  2123. if (cached) {
  2124. peg$currPos = cached.nextPos;
  2125. return cached.result;
  2126. }
  2127. s0 = peg$currPos;
  2128. s1 = peg$parsevariable();
  2129. if (s1 !== peg$FAILED) {
  2130. s2 = peg$parsews();
  2131. if (s2 !== peg$FAILED) {
  2132. if (input.substr(peg$currPos, 2) === peg$c81) {
  2133. s3 = peg$c81;
  2134. peg$currPos += 2;
  2135. } else {
  2136. s3 = peg$FAILED;
  2137. if (peg$silentFails === 0) { peg$fail(peg$c82); }
  2138. }
  2139. if (s3 !== peg$FAILED) {
  2140. s4 = peg$parsews();
  2141. if (s4 !== peg$FAILED) {
  2142. s5 = peg$parseexpression();
  2143. if (s5 !== peg$FAILED) {
  2144. peg$savedPos = s0;
  2145. s1 = peg$c83(s1, s5);
  2146. s0 = s1;
  2147. } else {
  2148. peg$currPos = s0;
  2149. s0 = peg$FAILED;
  2150. }
  2151. } else {
  2152. peg$currPos = s0;
  2153. s0 = peg$FAILED;
  2154. }
  2155. } else {
  2156. peg$currPos = s0;
  2157. s0 = peg$FAILED;
  2158. }
  2159. } else {
  2160. peg$currPos = s0;
  2161. s0 = peg$FAILED;
  2162. }
  2163. } else {
  2164. peg$currPos = s0;
  2165. s0 = peg$FAILED;
  2166. }
  2167. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2168. return s0;
  2169. }
  2170. function peg$parseret() {
  2171. var s0, s1, s2, s3;
  2172. var key = peg$currPos * 63 + 39,
  2173. cached = peg$resultsCache[key];
  2174. if (cached) {
  2175. peg$currPos = cached.nextPos;
  2176. return cached.result;
  2177. }
  2178. s0 = peg$currPos;
  2179. if (input.charCodeAt(peg$currPos) === 94) {
  2180. s1 = peg$c84;
  2181. peg$currPos++;
  2182. } else {
  2183. s1 = peg$FAILED;
  2184. if (peg$silentFails === 0) { peg$fail(peg$c85); }
  2185. }
  2186. if (s1 !== peg$FAILED) {
  2187. s2 = peg$parsews();
  2188. if (s2 !== peg$FAILED) {
  2189. s3 = peg$parseexpression();
  2190. if (s3 !== peg$FAILED) {
  2191. peg$savedPos = s0;
  2192. s1 = peg$c86(s3);
  2193. s0 = s1;
  2194. } else {
  2195. peg$currPos = s0;
  2196. s0 = peg$FAILED;
  2197. }
  2198. } else {
  2199. peg$currPos = s0;
  2200. s0 = peg$FAILED;
  2201. }
  2202. } else {
  2203. peg$currPos = s0;
  2204. s0 = peg$FAILED;
  2205. }
  2206. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2207. return s0;
  2208. }
  2209. function peg$parsetemps() {
  2210. var s0, s1, s2, s3, s4, s5;
  2211. var key = peg$currPos * 63 + 40,
  2212. cached = peg$resultsCache[key];
  2213. if (cached) {
  2214. peg$currPos = cached.nextPos;
  2215. return cached.result;
  2216. }
  2217. s0 = peg$currPos;
  2218. if (input.charCodeAt(peg$currPos) === 124) {
  2219. s1 = peg$c87;
  2220. peg$currPos++;
  2221. } else {
  2222. s1 = peg$FAILED;
  2223. if (peg$silentFails === 0) { peg$fail(peg$c88); }
  2224. }
  2225. if (s1 !== peg$FAILED) {
  2226. s2 = [];
  2227. s3 = peg$currPos;
  2228. s4 = peg$parsews();
  2229. if (s4 !== peg$FAILED) {
  2230. s5 = peg$parseidentifier();
  2231. if (s5 !== peg$FAILED) {
  2232. peg$savedPos = s3;
  2233. s4 = peg$c89(s5);
  2234. s3 = s4;
  2235. } else {
  2236. peg$currPos = s3;
  2237. s3 = peg$FAILED;
  2238. }
  2239. } else {
  2240. peg$currPos = s3;
  2241. s3 = peg$FAILED;
  2242. }
  2243. while (s3 !== peg$FAILED) {
  2244. s2.push(s3);
  2245. s3 = peg$currPos;
  2246. s4 = peg$parsews();
  2247. if (s4 !== peg$FAILED) {
  2248. s5 = peg$parseidentifier();
  2249. if (s5 !== peg$FAILED) {
  2250. peg$savedPos = s3;
  2251. s4 = peg$c89(s5);
  2252. s3 = s4;
  2253. } else {
  2254. peg$currPos = s3;
  2255. s3 = peg$FAILED;
  2256. }
  2257. } else {
  2258. peg$currPos = s3;
  2259. s3 = peg$FAILED;
  2260. }
  2261. }
  2262. if (s2 !== peg$FAILED) {
  2263. s3 = peg$parsews();
  2264. if (s3 !== peg$FAILED) {
  2265. if (input.charCodeAt(peg$currPos) === 124) {
  2266. s4 = peg$c87;
  2267. peg$currPos++;
  2268. } else {
  2269. s4 = peg$FAILED;
  2270. if (peg$silentFails === 0) { peg$fail(peg$c88); }
  2271. }
  2272. if (s4 !== peg$FAILED) {
  2273. peg$savedPos = s0;
  2274. s1 = peg$c90(s2);
  2275. s0 = s1;
  2276. } else {
  2277. peg$currPos = s0;
  2278. s0 = peg$FAILED;
  2279. }
  2280. } else {
  2281. peg$currPos = s0;
  2282. s0 = peg$FAILED;
  2283. }
  2284. } else {
  2285. peg$currPos = s0;
  2286. s0 = peg$FAILED;
  2287. }
  2288. } else {
  2289. peg$currPos = s0;
  2290. s0 = peg$FAILED;
  2291. }
  2292. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2293. return s0;
  2294. }
  2295. function peg$parsewsBlockParamList() {
  2296. var s0, s1, s2, s3, s4, s5, s6;
  2297. var key = peg$currPos * 63 + 41,
  2298. cached = peg$resultsCache[key];
  2299. if (cached) {
  2300. peg$currPos = cached.nextPos;
  2301. return cached.result;
  2302. }
  2303. s0 = peg$currPos;
  2304. s1 = [];
  2305. s2 = peg$currPos;
  2306. s3 = peg$parsews();
  2307. if (s3 !== peg$FAILED) {
  2308. if (input.charCodeAt(peg$currPos) === 58) {
  2309. s4 = peg$c12;
  2310. peg$currPos++;
  2311. } else {
  2312. s4 = peg$FAILED;
  2313. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2314. }
  2315. if (s4 !== peg$FAILED) {
  2316. s5 = peg$parsews();
  2317. if (s5 !== peg$FAILED) {
  2318. s6 = peg$parseidentifier();
  2319. if (s6 !== peg$FAILED) {
  2320. peg$savedPos = s2;
  2321. s3 = peg$c91(s6);
  2322. s2 = s3;
  2323. } else {
  2324. peg$currPos = s2;
  2325. s2 = peg$FAILED;
  2326. }
  2327. } else {
  2328. peg$currPos = s2;
  2329. s2 = peg$FAILED;
  2330. }
  2331. } else {
  2332. peg$currPos = s2;
  2333. s2 = peg$FAILED;
  2334. }
  2335. } else {
  2336. peg$currPos = s2;
  2337. s2 = peg$FAILED;
  2338. }
  2339. if (s2 !== peg$FAILED) {
  2340. while (s2 !== peg$FAILED) {
  2341. s1.push(s2);
  2342. s2 = peg$currPos;
  2343. s3 = peg$parsews();
  2344. if (s3 !== peg$FAILED) {
  2345. if (input.charCodeAt(peg$currPos) === 58) {
  2346. s4 = peg$c12;
  2347. peg$currPos++;
  2348. } else {
  2349. s4 = peg$FAILED;
  2350. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2351. }
  2352. if (s4 !== peg$FAILED) {
  2353. s5 = peg$parsews();
  2354. if (s5 !== peg$FAILED) {
  2355. s6 = peg$parseidentifier();
  2356. if (s6 !== peg$FAILED) {
  2357. peg$savedPos = s2;
  2358. s3 = peg$c91(s6);
  2359. s2 = s3;
  2360. } else {
  2361. peg$currPos = s2;
  2362. s2 = peg$FAILED;
  2363. }
  2364. } else {
  2365. peg$currPos = s2;
  2366. s2 = peg$FAILED;
  2367. }
  2368. } else {
  2369. peg$currPos = s2;
  2370. s2 = peg$FAILED;
  2371. }
  2372. } else {
  2373. peg$currPos = s2;
  2374. s2 = peg$FAILED;
  2375. }
  2376. }
  2377. } else {
  2378. s1 = peg$FAILED;
  2379. }
  2380. if (s1 !== peg$FAILED) {
  2381. s2 = peg$parsews();
  2382. if (s2 !== peg$FAILED) {
  2383. if (input.charCodeAt(peg$currPos) === 124) {
  2384. s3 = peg$c87;
  2385. peg$currPos++;
  2386. } else {
  2387. s3 = peg$FAILED;
  2388. if (peg$silentFails === 0) { peg$fail(peg$c88); }
  2389. }
  2390. if (s3 !== peg$FAILED) {
  2391. peg$savedPos = s0;
  2392. s1 = peg$c92(s1);
  2393. s0 = s1;
  2394. } else {
  2395. peg$currPos = s0;
  2396. s0 = peg$FAILED;
  2397. }
  2398. } else {
  2399. peg$currPos = s0;
  2400. s0 = peg$FAILED;
  2401. }
  2402. } else {
  2403. peg$currPos = s0;
  2404. s0 = peg$FAILED;
  2405. }
  2406. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2407. return s0;
  2408. }
  2409. function peg$parsesubexpression() {
  2410. var s0, s1, s2, s3, s4, s5;
  2411. var key = peg$currPos * 63 + 42,
  2412. cached = peg$resultsCache[key];
  2413. if (cached) {
  2414. peg$currPos = cached.nextPos;
  2415. return cached.result;
  2416. }
  2417. s0 = peg$currPos;
  2418. if (input.charCodeAt(peg$currPos) === 40) {
  2419. s1 = peg$c51;
  2420. peg$currPos++;
  2421. } else {
  2422. s1 = peg$FAILED;
  2423. if (peg$silentFails === 0) { peg$fail(peg$c52); }
  2424. }
  2425. if (s1 !== peg$FAILED) {
  2426. s2 = peg$parsews();
  2427. if (s2 !== peg$FAILED) {
  2428. s3 = peg$parseexpression();
  2429. if (s3 !== peg$FAILED) {
  2430. s4 = peg$parsews();
  2431. if (s4 !== peg$FAILED) {
  2432. if (input.charCodeAt(peg$currPos) === 41) {
  2433. s5 = peg$c48;
  2434. peg$currPos++;
  2435. } else {
  2436. s5 = peg$FAILED;
  2437. if (peg$silentFails === 0) { peg$fail(peg$c49); }
  2438. }
  2439. if (s5 !== peg$FAILED) {
  2440. peg$savedPos = s0;
  2441. s1 = peg$c79(s3);
  2442. s0 = s1;
  2443. } else {
  2444. peg$currPos = s0;
  2445. s0 = peg$FAILED;
  2446. }
  2447. } else {
  2448. peg$currPos = s0;
  2449. s0 = peg$FAILED;
  2450. }
  2451. } else {
  2452. peg$currPos = s0;
  2453. s0 = peg$FAILED;
  2454. }
  2455. } else {
  2456. peg$currPos = s0;
  2457. s0 = peg$FAILED;
  2458. }
  2459. } else {
  2460. peg$currPos = s0;
  2461. s0 = peg$FAILED;
  2462. }
  2463. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2464. return s0;
  2465. }
  2466. function peg$parsewsStatements() {
  2467. var s0, s1, s2, s3;
  2468. var key = peg$currPos * 63 + 43,
  2469. cached = peg$resultsCache[key];
  2470. if (cached) {
  2471. peg$currPos = cached.nextPos;
  2472. return cached.result;
  2473. }
  2474. s0 = peg$currPos;
  2475. s1 = peg$parsemaybeDotsWs();
  2476. if (s1 !== peg$FAILED) {
  2477. s2 = peg$parseret();
  2478. if (s2 !== peg$FAILED) {
  2479. peg$savedPos = s0;
  2480. s1 = peg$c93(s2);
  2481. s0 = s1;
  2482. } else {
  2483. peg$currPos = s0;
  2484. s0 = peg$FAILED;
  2485. }
  2486. } else {
  2487. peg$currPos = s0;
  2488. s0 = peg$FAILED;
  2489. }
  2490. if (s0 === peg$FAILED) {
  2491. s0 = peg$currPos;
  2492. s1 = peg$parsewsExpressions();
  2493. if (s1 !== peg$FAILED) {
  2494. s2 = peg$parsesomeDotsWs();
  2495. if (s2 !== peg$FAILED) {
  2496. s3 = peg$parseret();
  2497. if (s3 !== peg$FAILED) {
  2498. peg$savedPos = s0;
  2499. s1 = peg$c94(s1, s3);
  2500. s0 = s1;
  2501. } else {
  2502. peg$currPos = s0;
  2503. s0 = peg$FAILED;
  2504. }
  2505. } else {
  2506. peg$currPos = s0;
  2507. s0 = peg$FAILED;
  2508. }
  2509. } else {
  2510. peg$currPos = s0;
  2511. s0 = peg$FAILED;
  2512. }
  2513. if (s0 === peg$FAILED) {
  2514. s0 = peg$currPos;
  2515. s1 = peg$parsewsExpressions();
  2516. if (s1 === peg$FAILED) {
  2517. s1 = null;
  2518. }
  2519. if (s1 !== peg$FAILED) {
  2520. peg$savedPos = s0;
  2521. s1 = peg$c95(s1);
  2522. }
  2523. s0 = s1;
  2524. }
  2525. }
  2526. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2527. return s0;
  2528. }
  2529. function peg$parsewsSequenceWs() {
  2530. var s0, s1, s2, s3;
  2531. var key = peg$currPos * 63 + 44,
  2532. cached = peg$resultsCache[key];
  2533. if (cached) {
  2534. peg$currPos = cached.nextPos;
  2535. return cached.result;
  2536. }
  2537. s0 = peg$currPos;
  2538. s1 = peg$parsews();
  2539. if (s1 !== peg$FAILED) {
  2540. s2 = peg$parsejsStatement();
  2541. if (s2 !== peg$FAILED) {
  2542. s3 = peg$parsews();
  2543. if (s3 !== peg$FAILED) {
  2544. peg$savedPos = s0;
  2545. s1 = peg$c96(s2);
  2546. s0 = s1;
  2547. } else {
  2548. peg$currPos = s0;
  2549. s0 = peg$FAILED;
  2550. }
  2551. } else {
  2552. peg$currPos = s0;
  2553. s0 = peg$FAILED;
  2554. }
  2555. } else {
  2556. peg$currPos = s0;
  2557. s0 = peg$FAILED;
  2558. }
  2559. if (s0 === peg$FAILED) {
  2560. s0 = peg$parsewsStSequenceWs();
  2561. }
  2562. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2563. return s0;
  2564. }
  2565. function peg$parsewsStSequenceWs() {
  2566. var s0, s1, s2, s3, s4;
  2567. var key = peg$currPos * 63 + 45,
  2568. cached = peg$resultsCache[key];
  2569. if (cached) {
  2570. peg$currPos = cached.nextPos;
  2571. return cached.result;
  2572. }
  2573. s0 = peg$currPos;
  2574. s1 = peg$parsews();
  2575. if (s1 !== peg$FAILED) {
  2576. s2 = peg$parsetemps();
  2577. if (s2 === peg$FAILED) {
  2578. s2 = null;
  2579. }
  2580. if (s2 !== peg$FAILED) {
  2581. s3 = peg$parsewsStatements();
  2582. if (s3 === peg$FAILED) {
  2583. s3 = null;
  2584. }
  2585. if (s3 !== peg$FAILED) {
  2586. s4 = peg$parsemaybeDotsWs();
  2587. if (s4 !== peg$FAILED) {
  2588. peg$savedPos = s0;
  2589. s1 = peg$c97(s2, s3);
  2590. s0 = s1;
  2591. } else {
  2592. peg$currPos = s0;
  2593. s0 = peg$FAILED;
  2594. }
  2595. } else {
  2596. peg$currPos = s0;
  2597. s0 = peg$FAILED;
  2598. }
  2599. } else {
  2600. peg$currPos = s0;
  2601. s0 = peg$FAILED;
  2602. }
  2603. } else {
  2604. peg$currPos = s0;
  2605. s0 = peg$FAILED;
  2606. }
  2607. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2608. return s0;
  2609. }
  2610. function peg$parseblock() {
  2611. var s0, s1, s2, s3, s4;
  2612. var key = peg$currPos * 63 + 46,
  2613. cached = peg$resultsCache[key];
  2614. if (cached) {
  2615. peg$currPos = cached.nextPos;
  2616. return cached.result;
  2617. }
  2618. s0 = peg$currPos;
  2619. if (input.charCodeAt(peg$currPos) === 91) {
  2620. s1 = peg$c98;
  2621. peg$currPos++;
  2622. } else {
  2623. s1 = peg$FAILED;
  2624. if (peg$silentFails === 0) { peg$fail(peg$c99); }
  2625. }
  2626. if (s1 !== peg$FAILED) {
  2627. s2 = peg$parsewsBlockParamList();
  2628. if (s2 === peg$FAILED) {
  2629. s2 = null;
  2630. }
  2631. if (s2 !== peg$FAILED) {
  2632. s3 = peg$parsewsSequenceWs();
  2633. if (s3 !== peg$FAILED) {
  2634. if (input.charCodeAt(peg$currPos) === 93) {
  2635. s4 = peg$c100;
  2636. peg$currPos++;
  2637. } else {
  2638. s4 = peg$FAILED;
  2639. if (peg$silentFails === 0) { peg$fail(peg$c101); }
  2640. }
  2641. if (s4 !== peg$FAILED) {
  2642. peg$savedPos = s0;
  2643. s1 = peg$c102(s2, s3);
  2644. s0 = s1;
  2645. } else {
  2646. peg$currPos = s0;
  2647. s0 = peg$FAILED;
  2648. }
  2649. } else {
  2650. peg$currPos = s0;
  2651. s0 = peg$FAILED;
  2652. }
  2653. } else {
  2654. peg$currPos = s0;
  2655. s0 = peg$FAILED;
  2656. }
  2657. } else {
  2658. peg$currPos = s0;
  2659. s0 = peg$FAILED;
  2660. }
  2661. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2662. return s0;
  2663. }
  2664. function peg$parseoperand() {
  2665. var s0;
  2666. var key = peg$currPos * 63 + 47,
  2667. cached = peg$resultsCache[key];
  2668. if (cached) {
  2669. peg$currPos = cached.nextPos;
  2670. return cached.result;
  2671. }
  2672. s0 = peg$parseliteral();
  2673. if (s0 === peg$FAILED) {
  2674. s0 = peg$parsevariable();
  2675. if (s0 === peg$FAILED) {
  2676. s0 = peg$parsesubexpression();
  2677. }
  2678. }
  2679. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2680. return s0;
  2681. }
  2682. function peg$parsewsUnaryMessage() {
  2683. var s0, s1, s2, s3, s4;
  2684. var key = peg$currPos * 63 + 48,
  2685. cached = peg$resultsCache[key];
  2686. if (cached) {
  2687. peg$currPos = cached.nextPos;
  2688. return cached.result;
  2689. }
  2690. s0 = peg$currPos;
  2691. s1 = peg$parsews();
  2692. if (s1 !== peg$FAILED) {
  2693. s2 = peg$parseidentifier();
  2694. if (s2 !== peg$FAILED) {
  2695. s3 = peg$currPos;
  2696. peg$silentFails++;
  2697. if (input.charCodeAt(peg$currPos) === 58) {
  2698. s4 = peg$c12;
  2699. peg$currPos++;
  2700. } else {
  2701. s4 = peg$FAILED;
  2702. if (peg$silentFails === 0) { peg$fail(peg$c13); }
  2703. }
  2704. peg$silentFails--;
  2705. if (s4 === peg$FAILED) {
  2706. s3 = void 0;
  2707. } else {
  2708. peg$currPos = s3;
  2709. s3 = peg$FAILED;
  2710. }
  2711. if (s3 !== peg$FAILED) {
  2712. peg$savedPos = s0;
  2713. s1 = peg$c103(s2);
  2714. s0 = s1;
  2715. } else {
  2716. peg$currPos = s0;
  2717. s0 = peg$FAILED;
  2718. }
  2719. } else {
  2720. peg$currPos = s0;
  2721. s0 = peg$FAILED;
  2722. }
  2723. } else {
  2724. peg$currPos = s0;
  2725. s0 = peg$FAILED;
  2726. }
  2727. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2728. return s0;
  2729. }
  2730. function peg$parseunarySend() {
  2731. var s0, s1, s2, s3;
  2732. var key = peg$currPos * 63 + 49,
  2733. cached = peg$resultsCache[key];
  2734. if (cached) {
  2735. peg$currPos = cached.nextPos;
  2736. return cached.result;
  2737. }
  2738. s0 = peg$currPos;
  2739. s1 = peg$parseoperand();
  2740. if (s1 !== peg$FAILED) {
  2741. s2 = [];
  2742. s3 = peg$parsewsUnaryMessage();
  2743. while (s3 !== peg$FAILED) {
  2744. s2.push(s3);
  2745. s3 = peg$parsewsUnaryMessage();
  2746. }
  2747. if (s2 !== peg$FAILED) {
  2748. peg$savedPos = s0;
  2749. s1 = peg$c104(s1, s2);
  2750. s0 = s1;
  2751. } else {
  2752. peg$currPos = s0;
  2753. s0 = peg$FAILED;
  2754. }
  2755. } else {
  2756. peg$currPos = s0;
  2757. s0 = peg$FAILED;
  2758. }
  2759. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2760. return s0;
  2761. }
  2762. function peg$parsewsBinaryMessage() {
  2763. var s0, s1, s2, s3, s4;
  2764. var key = peg$currPos * 63 + 50,
  2765. cached = peg$resultsCache[key];
  2766. if (cached) {
  2767. peg$currPos = cached.nextPos;
  2768. return cached.result;
  2769. }
  2770. s0 = peg$currPos;
  2771. s1 = peg$parsews();
  2772. if (s1 !== peg$FAILED) {
  2773. s2 = peg$parsebinarySelector();
  2774. if (s2 !== peg$FAILED) {
  2775. s3 = peg$parsews();
  2776. if (s3 !== peg$FAILED) {
  2777. s4 = peg$parseunarySend();
  2778. if (s4 !== peg$FAILED) {
  2779. peg$savedPos = s0;
  2780. s1 = peg$c105(s2, s4);
  2781. s0 = s1;
  2782. } else {
  2783. peg$currPos = s0;
  2784. s0 = peg$FAILED;
  2785. }
  2786. } else {
  2787. peg$currPos = s0;
  2788. s0 = peg$FAILED;
  2789. }
  2790. } else {
  2791. peg$currPos = s0;
  2792. s0 = peg$FAILED;
  2793. }
  2794. } else {
  2795. peg$currPos = s0;
  2796. s0 = peg$FAILED;
  2797. }
  2798. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2799. return s0;
  2800. }
  2801. function peg$parsebinarySend() {
  2802. var s0, s1, s2, s3;
  2803. var key = peg$currPos * 63 + 51,
  2804. cached = peg$resultsCache[key];
  2805. if (cached) {
  2806. peg$currPos = cached.nextPos;
  2807. return cached.result;
  2808. }
  2809. s0 = peg$currPos;
  2810. s1 = peg$parseunarySend();
  2811. if (s1 !== peg$FAILED) {
  2812. s2 = [];
  2813. s3 = peg$parsewsBinaryMessage();
  2814. while (s3 !== peg$FAILED) {
  2815. s2.push(s3);
  2816. s3 = peg$parsewsBinaryMessage();
  2817. }
  2818. if (s2 !== peg$FAILED) {
  2819. peg$savedPos = s0;
  2820. s1 = peg$c104(s1, s2);
  2821. s0 = s1;
  2822. } else {
  2823. peg$currPos = s0;
  2824. s0 = peg$FAILED;
  2825. }
  2826. } else {
  2827. peg$currPos = s0;
  2828. s0 = peg$FAILED;
  2829. }
  2830. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2831. return s0;
  2832. }
  2833. function peg$parsewsKeywordMessage() {
  2834. var s0, s1, s2, s3, s4, s5, s6;
  2835. var key = peg$currPos * 63 + 52,
  2836. cached = peg$resultsCache[key];
  2837. if (cached) {
  2838. peg$currPos = cached.nextPos;
  2839. return cached.result;
  2840. }
  2841. s0 = peg$currPos;
  2842. s1 = [];
  2843. s2 = peg$currPos;
  2844. s3 = peg$parsews();
  2845. if (s3 !== peg$FAILED) {
  2846. s4 = peg$parsekeyword();
  2847. if (s4 !== peg$FAILED) {
  2848. s5 = peg$parsews();
  2849. if (s5 !== peg$FAILED) {
  2850. s6 = peg$parsebinarySend();
  2851. if (s6 !== peg$FAILED) {
  2852. peg$savedPos = s2;
  2853. s3 = peg$c75(s4, s6);
  2854. s2 = s3;
  2855. } else {
  2856. peg$currPos = s2;
  2857. s2 = peg$FAILED;
  2858. }
  2859. } else {
  2860. peg$currPos = s2;
  2861. s2 = peg$FAILED;
  2862. }
  2863. } else {
  2864. peg$currPos = s2;
  2865. s2 = peg$FAILED;
  2866. }
  2867. } else {
  2868. peg$currPos = s2;
  2869. s2 = peg$FAILED;
  2870. }
  2871. if (s2 !== peg$FAILED) {
  2872. while (s2 !== peg$FAILED) {
  2873. s1.push(s2);
  2874. s2 = peg$currPos;
  2875. s3 = peg$parsews();
  2876. if (s3 !== peg$FAILED) {
  2877. s4 = peg$parsekeyword();
  2878. if (s4 !== peg$FAILED) {
  2879. s5 = peg$parsews();
  2880. if (s5 !== peg$FAILED) {
  2881. s6 = peg$parsebinarySend();
  2882. if (s6 !== peg$FAILED) {
  2883. peg$savedPos = s2;
  2884. s3 = peg$c75(s4, s6);
  2885. s2 = s3;
  2886. } else {
  2887. peg$currPos = s2;
  2888. s2 = peg$FAILED;
  2889. }
  2890. } else {
  2891. peg$currPos = s2;
  2892. s2 = peg$FAILED;
  2893. }
  2894. } else {
  2895. peg$currPos = s2;
  2896. s2 = peg$FAILED;
  2897. }
  2898. } else {
  2899. peg$currPos = s2;
  2900. s2 = peg$FAILED;
  2901. }
  2902. }
  2903. } else {
  2904. s1 = peg$FAILED;
  2905. }
  2906. if (s1 !== peg$FAILED) {
  2907. peg$savedPos = s0;
  2908. s1 = peg$c106(s1);
  2909. }
  2910. s0 = s1;
  2911. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2912. return s0;
  2913. }
  2914. function peg$parsekeywordSend() {
  2915. var s0, s1, s2;
  2916. var key = peg$currPos * 63 + 53,
  2917. cached = peg$resultsCache[key];
  2918. if (cached) {
  2919. peg$currPos = cached.nextPos;
  2920. return cached.result;
  2921. }
  2922. s0 = peg$currPos;
  2923. s1 = peg$parsebinarySend();
  2924. if (s1 !== peg$FAILED) {
  2925. s2 = peg$parsewsKeywordMessage();
  2926. if (s2 === peg$FAILED) {
  2927. s2 = null;
  2928. }
  2929. if (s2 !== peg$FAILED) {
  2930. peg$savedPos = s0;
  2931. s1 = peg$c107(s1, s2);
  2932. s0 = s1;
  2933. } else {
  2934. peg$currPos = s0;
  2935. s0 = peg$FAILED;
  2936. }
  2937. } else {
  2938. peg$currPos = s0;
  2939. s0 = peg$FAILED;
  2940. }
  2941. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2942. return s0;
  2943. }
  2944. function peg$parsewsMessage() {
  2945. var s0;
  2946. var key = peg$currPos * 63 + 54,
  2947. cached = peg$resultsCache[key];
  2948. if (cached) {
  2949. peg$currPos = cached.nextPos;
  2950. return cached.result;
  2951. }
  2952. s0 = peg$parsewsBinaryMessage();
  2953. if (s0 === peg$FAILED) {
  2954. s0 = peg$parsewsUnaryMessage();
  2955. if (s0 === peg$FAILED) {
  2956. s0 = peg$parsewsKeywordMessage();
  2957. }
  2958. }
  2959. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  2960. return s0;
  2961. }
  2962. function peg$parsecascade() {
  2963. var s0, s1, s2, s3, s4, s5, s6, s7;
  2964. var key = peg$currPos * 63 + 55,
  2965. cached = peg$resultsCache[key];
  2966. if (cached) {
  2967. peg$currPos = cached.nextPos;
  2968. return cached.result;
  2969. }
  2970. s0 = peg$currPos;
  2971. s1 = peg$parsekeywordSend();
  2972. if (s1 !== peg$FAILED) {
  2973. peg$savedPos = peg$currPos;
  2974. s2 = peg$c108(s1);
  2975. if (s2) {
  2976. s2 = void 0;
  2977. } else {
  2978. s2 = peg$FAILED;
  2979. }
  2980. if (s2 !== peg$FAILED) {
  2981. s3 = [];
  2982. s4 = peg$currPos;
  2983. s5 = peg$parsews();
  2984. if (s5 !== peg$FAILED) {
  2985. if (input.charCodeAt(peg$currPos) === 59) {
  2986. s6 = peg$c109;
  2987. peg$currPos++;
  2988. } else {
  2989. s6 = peg$FAILED;
  2990. if (peg$silentFails === 0) { peg$fail(peg$c110); }
  2991. }
  2992. if (s6 !== peg$FAILED) {
  2993. s7 = peg$parsewsMessage();
  2994. if (s7 !== peg$FAILED) {
  2995. peg$savedPos = s4;
  2996. s5 = peg$c111(s1, s7);
  2997. s4 = s5;
  2998. } else {
  2999. peg$currPos = s4;
  3000. s4 = peg$FAILED;
  3001. }
  3002. } else {
  3003. peg$currPos = s4;
  3004. s4 = peg$FAILED;
  3005. }
  3006. } else {
  3007. peg$currPos = s4;
  3008. s4 = peg$FAILED;
  3009. }
  3010. if (s4 !== peg$FAILED) {
  3011. while (s4 !== peg$FAILED) {
  3012. s3.push(s4);
  3013. s4 = peg$currPos;
  3014. s5 = peg$parsews();
  3015. if (s5 !== peg$FAILED) {
  3016. if (input.charCodeAt(peg$currPos) === 59) {
  3017. s6 = peg$c109;
  3018. peg$currPos++;
  3019. } else {
  3020. s6 = peg$FAILED;
  3021. if (peg$silentFails === 0) { peg$fail(peg$c110); }
  3022. }
  3023. if (s6 !== peg$FAILED) {
  3024. s7 = peg$parsewsMessage();
  3025. if (s7 !== peg$FAILED) {
  3026. peg$savedPos = s4;
  3027. s5 = peg$c111(s1, s7);
  3028. s4 = s5;
  3029. } else {
  3030. peg$currPos = s4;
  3031. s4 = peg$FAILED;
  3032. }
  3033. } else {
  3034. peg$currPos = s4;
  3035. s4 = peg$FAILED;
  3036. }
  3037. } else {
  3038. peg$currPos = s4;
  3039. s4 = peg$FAILED;
  3040. }
  3041. }
  3042. } else {
  3043. s3 = peg$FAILED;
  3044. }
  3045. if (s3 !== peg$FAILED) {
  3046. peg$savedPos = s0;
  3047. s1 = peg$c112(s1, s3);
  3048. s0 = s1;
  3049. } else {
  3050. peg$currPos = s0;
  3051. s0 = peg$FAILED;
  3052. }
  3053. } else {
  3054. peg$currPos = s0;
  3055. s0 = peg$FAILED;
  3056. }
  3057. } else {
  3058. peg$currPos = s0;
  3059. s0 = peg$FAILED;
  3060. }
  3061. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3062. return s0;
  3063. }
  3064. function peg$parsejsStatement() {
  3065. var s0;
  3066. var key = peg$currPos * 63 + 56,
  3067. cached = peg$resultsCache[key];
  3068. if (cached) {
  3069. peg$currPos = cached.nextPos;
  3070. return cached.result;
  3071. }
  3072. s0 = peg$parsepragmaJsStatement();
  3073. if (s0 === peg$FAILED) {
  3074. s0 = peg$parselegacyJsStatement();
  3075. }
  3076. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3077. return s0;
  3078. }
  3079. function peg$parselegacyJsStatement() {
  3080. var s0, s1, s2, s3, s4;
  3081. var key = peg$currPos * 63 + 57,
  3082. cached = peg$resultsCache[key];
  3083. if (cached) {
  3084. peg$currPos = cached.nextPos;
  3085. return cached.result;
  3086. }
  3087. s0 = peg$currPos;
  3088. if (input.charCodeAt(peg$currPos) === 60) {
  3089. s1 = peg$c113;
  3090. peg$currPos++;
  3091. } else {
  3092. s1 = peg$FAILED;
  3093. if (peg$silentFails === 0) { peg$fail(peg$c114); }
  3094. }
  3095. if (s1 !== peg$FAILED) {
  3096. s2 = [];
  3097. s3 = peg$currPos;
  3098. if (input.substr(peg$currPos, 2) === peg$c115) {
  3099. s4 = peg$c115;
  3100. peg$currPos += 2;
  3101. } else {
  3102. s4 = peg$FAILED;
  3103. if (peg$silentFails === 0) { peg$fail(peg$c116); }
  3104. }
  3105. if (s4 !== peg$FAILED) {
  3106. peg$savedPos = s3;
  3107. s4 = peg$c117();
  3108. }
  3109. s3 = s4;
  3110. if (s3 === peg$FAILED) {
  3111. if (peg$c118.test(input.charAt(peg$currPos))) {
  3112. s3 = input.charAt(peg$currPos);
  3113. peg$currPos++;
  3114. } else {
  3115. s3 = peg$FAILED;
  3116. if (peg$silentFails === 0) { peg$fail(peg$c119); }
  3117. }
  3118. }
  3119. while (s3 !== peg$FAILED) {
  3120. s2.push(s3);
  3121. s3 = peg$currPos;
  3122. if (input.substr(peg$currPos, 2) === peg$c115) {
  3123. s4 = peg$c115;
  3124. peg$currPos += 2;
  3125. } else {
  3126. s4 = peg$FAILED;
  3127. if (peg$silentFails === 0) { peg$fail(peg$c116); }
  3128. }
  3129. if (s4 !== peg$FAILED) {
  3130. peg$savedPos = s3;
  3131. s4 = peg$c117();
  3132. }
  3133. s3 = s4;
  3134. if (s3 === peg$FAILED) {
  3135. if (peg$c118.test(input.charAt(peg$currPos))) {
  3136. s3 = input.charAt(peg$currPos);
  3137. peg$currPos++;
  3138. } else {
  3139. s3 = peg$FAILED;
  3140. if (peg$silentFails === 0) { peg$fail(peg$c119); }
  3141. }
  3142. }
  3143. }
  3144. if (s2 !== peg$FAILED) {
  3145. if (input.charCodeAt(peg$currPos) === 62) {
  3146. s3 = peg$c120;
  3147. peg$currPos++;
  3148. } else {
  3149. s3 = peg$FAILED;
  3150. if (peg$silentFails === 0) { peg$fail(peg$c121); }
  3151. }
  3152. if (s3 !== peg$FAILED) {
  3153. peg$savedPos = peg$currPos;
  3154. s4 = peg$c122(s2);
  3155. if (s4) {
  3156. s4 = void 0;
  3157. } else {
  3158. s4 = peg$FAILED;
  3159. }
  3160. if (s4 !== peg$FAILED) {
  3161. peg$savedPos = s0;
  3162. s1 = peg$c123(s2);
  3163. s0 = s1;
  3164. } else {
  3165. peg$currPos = s0;
  3166. s0 = peg$FAILED;
  3167. }
  3168. } else {
  3169. peg$currPos = s0;
  3170. s0 = peg$FAILED;
  3171. }
  3172. } else {
  3173. peg$currPos = s0;
  3174. s0 = peg$FAILED;
  3175. }
  3176. } else {
  3177. peg$currPos = s0;
  3178. s0 = peg$FAILED;
  3179. }
  3180. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3181. return s0;
  3182. }
  3183. function peg$parsepragmaJsStatement() {
  3184. var s0, s1, s2, s3, s4, s5, s6, s7;
  3185. var key = peg$currPos * 63 + 58,
  3186. cached = peg$resultsCache[key];
  3187. if (cached) {
  3188. peg$currPos = cached.nextPos;
  3189. return cached.result;
  3190. }
  3191. s0 = peg$currPos;
  3192. if (input.charCodeAt(peg$currPos) === 60) {
  3193. s1 = peg$c113;
  3194. peg$currPos++;
  3195. } else {
  3196. s1 = peg$FAILED;
  3197. if (peg$silentFails === 0) { peg$fail(peg$c114); }
  3198. }
  3199. if (s1 !== peg$FAILED) {
  3200. s2 = peg$parsews();
  3201. if (s2 !== peg$FAILED) {
  3202. if (input.substr(peg$currPos, 9) === peg$c124) {
  3203. s3 = peg$c124;
  3204. peg$currPos += 9;
  3205. } else {
  3206. s3 = peg$FAILED;
  3207. if (peg$silentFails === 0) { peg$fail(peg$c125); }
  3208. }
  3209. if (s3 !== peg$FAILED) {
  3210. s4 = peg$parsews();
  3211. if (s4 !== peg$FAILED) {
  3212. s5 = peg$parserawString();
  3213. if (s5 !== peg$FAILED) {
  3214. s6 = peg$parsews();
  3215. if (s6 !== peg$FAILED) {
  3216. if (input.charCodeAt(peg$currPos) === 62) {
  3217. s7 = peg$c120;
  3218. peg$currPos++;
  3219. } else {
  3220. s7 = peg$FAILED;
  3221. if (peg$silentFails === 0) { peg$fail(peg$c121); }
  3222. }
  3223. if (s7 !== peg$FAILED) {
  3224. peg$savedPos = s0;
  3225. s1 = peg$c126(s5);
  3226. s0 = s1;
  3227. } else {
  3228. peg$currPos = s0;
  3229. s0 = peg$FAILED;
  3230. }
  3231. } else {
  3232. peg$currPos = s0;
  3233. s0 = peg$FAILED;
  3234. }
  3235. } else {
  3236. peg$currPos = s0;
  3237. s0 = peg$FAILED;
  3238. }
  3239. } else {
  3240. peg$currPos = s0;
  3241. s0 = peg$FAILED;
  3242. }
  3243. } else {
  3244. peg$currPos = s0;
  3245. s0 = peg$FAILED;
  3246. }
  3247. } else {
  3248. peg$currPos = s0;
  3249. s0 = peg$FAILED;
  3250. }
  3251. } else {
  3252. peg$currPos = s0;
  3253. s0 = peg$FAILED;
  3254. }
  3255. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3256. return s0;
  3257. }
  3258. function peg$parsemethod() {
  3259. var s0, s1, s2;
  3260. var key = peg$currPos * 63 + 59,
  3261. cached = peg$resultsCache[key];
  3262. if (cached) {
  3263. peg$currPos = cached.nextPos;
  3264. return cached.result;
  3265. }
  3266. s0 = peg$currPos;
  3267. s1 = peg$parsewsKeywordPattern();
  3268. if (s1 === peg$FAILED) {
  3269. s1 = peg$parsewsBinaryPattern();
  3270. if (s1 === peg$FAILED) {
  3271. s1 = peg$parsewsUnaryPattern();
  3272. }
  3273. }
  3274. if (s1 !== peg$FAILED) {
  3275. s2 = peg$parsewsSequenceWs();
  3276. if (s2 !== peg$FAILED) {
  3277. peg$savedPos = s0;
  3278. s1 = peg$c127(s1, s2);
  3279. s0 = s1;
  3280. } else {
  3281. peg$currPos = s0;
  3282. s0 = peg$FAILED;
  3283. }
  3284. } else {
  3285. peg$currPos = s0;
  3286. s0 = peg$FAILED;
  3287. }
  3288. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3289. return s0;
  3290. }
  3291. function peg$parseassociationSend() {
  3292. var s0, s1, s2;
  3293. var key = peg$currPos * 63 + 60,
  3294. cached = peg$resultsCache[key];
  3295. if (cached) {
  3296. peg$currPos = cached.nextPos;
  3297. return cached.result;
  3298. }
  3299. s0 = peg$currPos;
  3300. s1 = peg$parsebinarySend();
  3301. if (s1 !== peg$FAILED) {
  3302. peg$savedPos = peg$currPos;
  3303. s2 = peg$c128(s1);
  3304. if (s2) {
  3305. s2 = void 0;
  3306. } else {
  3307. s2 = peg$FAILED;
  3308. }
  3309. if (s2 !== peg$FAILED) {
  3310. peg$savedPos = s0;
  3311. s1 = peg$c129(s1);
  3312. s0 = s1;
  3313. } else {
  3314. peg$currPos = s0;
  3315. s0 = peg$FAILED;
  3316. }
  3317. } else {
  3318. peg$currPos = s0;
  3319. s0 = peg$FAILED;
  3320. }
  3321. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3322. return s0;
  3323. }
  3324. function peg$parsewsAssociationsRest() {
  3325. var s0, s1, s2;
  3326. var key = peg$currPos * 63 + 61,
  3327. cached = peg$resultsCache[key];
  3328. if (cached) {
  3329. peg$currPos = cached.nextPos;
  3330. return cached.result;
  3331. }
  3332. s0 = peg$currPos;
  3333. s1 = peg$parsesomeDotsWs();
  3334. if (s1 !== peg$FAILED) {
  3335. s2 = peg$parseassociationSend();
  3336. if (s2 !== peg$FAILED) {
  3337. peg$savedPos = s0;
  3338. s1 = peg$c79(s2);
  3339. s0 = s1;
  3340. } else {
  3341. peg$currPos = s0;
  3342. s0 = peg$FAILED;
  3343. }
  3344. } else {
  3345. peg$currPos = s0;
  3346. s0 = peg$FAILED;
  3347. }
  3348. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3349. return s0;
  3350. }
  3351. function peg$parsewsAssociations() {
  3352. var s0, s1, s2, s3, s4;
  3353. var key = peg$currPos * 63 + 62,
  3354. cached = peg$resultsCache[key];
  3355. if (cached) {
  3356. peg$currPos = cached.nextPos;
  3357. return cached.result;
  3358. }
  3359. s0 = peg$currPos;
  3360. s1 = peg$parsemaybeDotsWs();
  3361. if (s1 !== peg$FAILED) {
  3362. s2 = peg$parseassociationSend();
  3363. if (s2 !== peg$FAILED) {
  3364. s3 = [];
  3365. s4 = peg$parsewsAssociationsRest();
  3366. while (s4 !== peg$FAILED) {
  3367. s3.push(s4);
  3368. s4 = peg$parsewsAssociationsRest();
  3369. }
  3370. if (s3 !== peg$FAILED) {
  3371. peg$savedPos = s0;
  3372. s1 = peg$c130(s2, s3);
  3373. s0 = s1;
  3374. } else {
  3375. peg$currPos = s0;
  3376. s0 = peg$FAILED;
  3377. }
  3378. } else {
  3379. peg$currPos = s0;
  3380. s0 = peg$FAILED;
  3381. }
  3382. } else {
  3383. peg$currPos = s0;
  3384. s0 = peg$FAILED;
  3385. }
  3386. peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
  3387. return s0;
  3388. }
  3389. peg$result = peg$startRuleFunction();
  3390. if (peg$result !== peg$FAILED && peg$currPos === input.length) {
  3391. return peg$result;
  3392. } else {
  3393. if (peg$result !== peg$FAILED && peg$currPos < input.length) {
  3394. peg$fail({ type: "end", description: "end of input" });
  3395. }
  3396. throw peg$buildException(
  3397. null,
  3398. peg$maxFailExpected,
  3399. peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
  3400. peg$maxFailPos < input.length
  3401. ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
  3402. : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
  3403. );
  3404. }
  3405. }
  3406. return {
  3407. SyntaxError: peg$SyntaxError,
  3408. parse: peg$parse
  3409. };
  3410. })();
  3411. });