parser.js 99 KB

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