parser.js 99 KB

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