parser.js 104 KB

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