parser.js 101 KB

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