parser.js 101 KB

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