parser.js 107 KB

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