parser.js 104 KB

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