parser.js 102 KB

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