parser.js 100 KB

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