parser.js 102 KB

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