2
0

parser.js 102 KB

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