parser.js 99 KB

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