parser.js 102 KB

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