2
0

parser.js 102 KB

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