parser.js 101 KB

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