parser.js 99 KB

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