1
0

parser.js 108 KB

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