parser.js 99 KB

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