parser.js 99 KB

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