parser.js 101 KB

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