2
0

parser.js 104 KB

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