2
0

parser.js 99 KB

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