parser.js 101 KB

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