2
0

parser.js 103 KB

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