parser.js 93 KB

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