parser.js 94 KB

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