parser.js 105 KB

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