parser.js 101 KB

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