parser.js 104 KB

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