Compiler-Interpreter.js 123 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862
  1. define("amber_core/Compiler-Interpreter", ["amber/boot", "amber_core/Kernel-Methods", "amber_core/Compiler-Semantic", "amber_core/Kernel-Objects", "amber_core/Compiler-Core", "amber_core/Kernel-Exceptions", "amber_core/Compiler-AST"], function($boot){
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Compiler-Interpreter');
  4. $core.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber_core"};
  5. $core.addClass('AIBlockClosure', $globals.BlockClosure, ['node', 'outerContext'], 'Compiler-Interpreter');
  6. //>>excludeStart("ide", pragmas.excludeIdeData);
  7. $globals.AIBlockClosure.comment="I am a special `BlockClosure` subclass used by an interpreter to interpret a block node.\x0a\x0aWhile I am polymorphic with `BlockClosure`, some methods such as `#new` will raise interpretation errors. Unlike a `BlockClosure`, my instance are not JavaScript functions.\x0a\x0aEvaluating an instance will result in interpreting the `node` instance variable (instance of `BlockNode`).";
  8. //>>excludeEnd("ide");
  9. $core.addMethod(
  10. $core.method({
  11. selector: "applyTo:arguments:",
  12. protocol: 'evaluating',
  13. fn: function (anObject,aCollection){
  14. var self=this;
  15. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  16. return $core.withContext(function($ctx1) {
  17. //>>excludeEnd("ctx");
  18. self._interpreterError();
  19. return self;
  20. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  21. }, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},$globals.AIBlockClosure)});
  22. //>>excludeEnd("ctx");
  23. },
  24. //>>excludeStart("ide", pragmas.excludeIdeData);
  25. args: ["anObject", "aCollection"],
  26. source: "applyTo: anObject arguments: aCollection\x0a\x09self interpreterError",
  27. referencedClasses: [],
  28. //>>excludeEnd("ide");
  29. messageSends: ["interpreterError"]
  30. }),
  31. $globals.AIBlockClosure);
  32. $core.addMethod(
  33. $core.method({
  34. selector: "compiledSource",
  35. protocol: 'accessing',
  36. fn: function (){
  37. var self=this;
  38. return "[ AST Block closure ]";
  39. },
  40. //>>excludeStart("ide", pragmas.excludeIdeData);
  41. args: [],
  42. source: "compiledSource\x0a\x09\x22Unlike blocks, the receiver doesn't represent a JS function\x22\x0a\x09\x0a\x09^ '[ AST Block closure ]'",
  43. referencedClasses: [],
  44. //>>excludeEnd("ide");
  45. messageSends: []
  46. }),
  47. $globals.AIBlockClosure);
  48. $core.addMethod(
  49. $core.method({
  50. selector: "currySelf",
  51. protocol: 'converting',
  52. fn: function (){
  53. var self=this;
  54. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  55. return $core.withContext(function($ctx1) {
  56. //>>excludeEnd("ctx");
  57. self._interpreterError();
  58. return self;
  59. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  60. }, function($ctx1) {$ctx1.fill(self,"currySelf",{},$globals.AIBlockClosure)});
  61. //>>excludeEnd("ctx");
  62. },
  63. //>>excludeStart("ide", pragmas.excludeIdeData);
  64. args: [],
  65. source: "currySelf\x0a\x09self interpreterError",
  66. referencedClasses: [],
  67. //>>excludeEnd("ide");
  68. messageSends: ["interpreterError"]
  69. }),
  70. $globals.AIBlockClosure);
  71. $core.addMethod(
  72. $core.method({
  73. selector: "initializeWithContext:node:",
  74. protocol: 'initialization',
  75. fn: function (aContext,aNode){
  76. var self=this;
  77. self["@node"]=aNode;
  78. self["@outerContext"]=aContext;
  79. return self;
  80. },
  81. //>>excludeStart("ide", pragmas.excludeIdeData);
  82. args: ["aContext", "aNode"],
  83. source: "initializeWithContext: aContext node: aNode\x0a\x09node := aNode.\x0a\x09outerContext := aContext",
  84. referencedClasses: [],
  85. //>>excludeEnd("ide");
  86. messageSends: []
  87. }),
  88. $globals.AIBlockClosure);
  89. $core.addMethod(
  90. $core.method({
  91. selector: "interpreterError",
  92. protocol: 'error handling',
  93. fn: function (){
  94. var self=this;
  95. function $ASTInterpreterError(){return $globals.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
  96. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  97. return $core.withContext(function($ctx1) {
  98. //>>excludeEnd("ctx");
  99. $recv($ASTInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
  100. return self;
  101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  102. }, function($ctx1) {$ctx1.fill(self,"interpreterError",{},$globals.AIBlockClosure)});
  103. //>>excludeEnd("ctx");
  104. },
  105. //>>excludeStart("ide", pragmas.excludeIdeData);
  106. args: [],
  107. source: "interpreterError\x0a\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
  108. referencedClasses: ["ASTInterpreterError"],
  109. //>>excludeEnd("ide");
  110. messageSends: ["signal:"]
  111. }),
  112. $globals.AIBlockClosure);
  113. $core.addMethod(
  114. $core.method({
  115. selector: "numArgs",
  116. protocol: 'accessing',
  117. fn: function (){
  118. var self=this;
  119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  120. return $core.withContext(function($ctx1) {
  121. //>>excludeEnd("ctx");
  122. var $1;
  123. $1=$recv($recv(self["@node"])._temps())._size();
  124. return $1;
  125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  126. }, function($ctx1) {$ctx1.fill(self,"numArgs",{},$globals.AIBlockClosure)});
  127. //>>excludeEnd("ctx");
  128. },
  129. //>>excludeStart("ide", pragmas.excludeIdeData);
  130. args: [],
  131. source: "numArgs\x0a\x09^ node temps size",
  132. referencedClasses: [],
  133. //>>excludeEnd("ide");
  134. messageSends: ["size", "temps"]
  135. }),
  136. $globals.AIBlockClosure);
  137. $core.addMethod(
  138. $core.method({
  139. selector: "value",
  140. protocol: 'evaluating',
  141. fn: function (){
  142. var self=this;
  143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  144. return $core.withContext(function($ctx1) {
  145. //>>excludeEnd("ctx");
  146. var $1;
  147. $1=self._valueWithPossibleArguments_([]);
  148. return $1;
  149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  150. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.AIBlockClosure)});
  151. //>>excludeEnd("ctx");
  152. },
  153. //>>excludeStart("ide", pragmas.excludeIdeData);
  154. args: [],
  155. source: "value\x0a\x09^ self valueWithPossibleArguments: #()",
  156. referencedClasses: [],
  157. //>>excludeEnd("ide");
  158. messageSends: ["valueWithPossibleArguments:"]
  159. }),
  160. $globals.AIBlockClosure);
  161. $core.addMethod(
  162. $core.method({
  163. selector: "value:",
  164. protocol: 'evaluating',
  165. fn: function (anArgument){
  166. var self=this;
  167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  168. return $core.withContext(function($ctx1) {
  169. //>>excludeEnd("ctx");
  170. var $1;
  171. $1=self._valueWithPossibleArguments_([anArgument]);
  172. return $1;
  173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  174. }, function($ctx1) {$ctx1.fill(self,"value:",{anArgument:anArgument},$globals.AIBlockClosure)});
  175. //>>excludeEnd("ctx");
  176. },
  177. //>>excludeStart("ide", pragmas.excludeIdeData);
  178. args: ["anArgument"],
  179. source: "value: anArgument\x0a\x09^ self valueWithPossibleArguments: {anArgument}",
  180. referencedClasses: [],
  181. //>>excludeEnd("ide");
  182. messageSends: ["valueWithPossibleArguments:"]
  183. }),
  184. $globals.AIBlockClosure);
  185. $core.addMethod(
  186. $core.method({
  187. selector: "value:value:",
  188. protocol: 'evaluating',
  189. fn: function (firstArgument,secondArgument){
  190. var self=this;
  191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  192. return $core.withContext(function($ctx1) {
  193. //>>excludeEnd("ctx");
  194. var $1;
  195. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument]);
  196. return $1;
  197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  198. }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},$globals.AIBlockClosure)});
  199. //>>excludeEnd("ctx");
  200. },
  201. //>>excludeStart("ide", pragmas.excludeIdeData);
  202. args: ["firstArgument", "secondArgument"],
  203. source: "value: firstArgument value: secondArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument}",
  204. referencedClasses: [],
  205. //>>excludeEnd("ide");
  206. messageSends: ["valueWithPossibleArguments:"]
  207. }),
  208. $globals.AIBlockClosure);
  209. $core.addMethod(
  210. $core.method({
  211. selector: "value:value:value:",
  212. protocol: 'evaluating',
  213. fn: function (firstArgument,secondArgument,thirdArgument){
  214. var self=this;
  215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  216. return $core.withContext(function($ctx1) {
  217. //>>excludeEnd("ctx");
  218. var $1;
  219. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument,thirdArgument]);
  220. return $1;
  221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  222. }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},$globals.AIBlockClosure)});
  223. //>>excludeEnd("ctx");
  224. },
  225. //>>excludeStart("ide", pragmas.excludeIdeData);
  226. args: ["firstArgument", "secondArgument", "thirdArgument"],
  227. source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument . thirdArgument}",
  228. referencedClasses: [],
  229. //>>excludeEnd("ide");
  230. messageSends: ["valueWithPossibleArguments:"]
  231. }),
  232. $globals.AIBlockClosure);
  233. $core.addMethod(
  234. $core.method({
  235. selector: "valueWithPossibleArguments:",
  236. protocol: 'evaluating',
  237. fn: function (aCollection){
  238. var self=this;
  239. var context,sequenceNode;
  240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  241. return $core.withContext(function($ctx1) {
  242. //>>excludeEnd("ctx");
  243. var $1,$2,$3,$4,$5,$6;
  244. context=$recv(self["@outerContext"])._newInnerContext();
  245. $1=$recv($recv($recv(self["@node"])._nodes())._first())._copy();
  246. $recv($1)._parent_(nil);
  247. $2=$recv($1)._yourself();
  248. sequenceNode=$2;
  249. $recv($recv(sequenceNode)._temps())._do_((function(each){
  250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  251. return $core.withContext(function($ctx2) {
  252. //>>excludeEnd("ctx");
  253. return $recv(context)._defineLocal_(each);
  254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  255. $ctx2.sendIdx["defineLocal:"]=1;
  256. //>>excludeEnd("ctx");
  257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  258. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  259. //>>excludeEnd("ctx");
  260. }));
  261. $recv($recv(self["@node"])._parameters())._withIndexDo_((function(each,index){
  262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  263. return $core.withContext(function($ctx2) {
  264. //>>excludeEnd("ctx");
  265. $recv(context)._defineLocal_(each);
  266. return $recv(context)._localAt_put_(each,$recv(aCollection)._at_ifAbsent_(index,(function(){
  267. return nil;
  268. })));
  269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  270. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,2)});
  271. //>>excludeEnd("ctx");
  272. }));
  273. $3=$recv(context)._interpreter();
  274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  275. $ctx1.sendIdx["interpreter"]=1;
  276. //>>excludeEnd("ctx");
  277. $recv($3)._node_($recv(sequenceNode)._nextChild());
  278. $4=$recv($3)._proceed();
  279. $5=$recv(self["@outerContext"])._interpreter();
  280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  281. $ctx1.sendIdx["interpreter"]=2;
  282. //>>excludeEnd("ctx");
  283. $recv($5)._setNonLocalReturnFromContext_(context);
  284. $6=$recv($recv(context)._interpreter())._pop();
  285. return $6;
  286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  287. }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context,sequenceNode:sequenceNode},$globals.AIBlockClosure)});
  288. //>>excludeEnd("ctx");
  289. },
  290. //>>excludeStart("ide", pragmas.excludeIdeData);
  291. args: ["aCollection"],
  292. source: "valueWithPossibleArguments: aCollection\x0a\x09| context sequenceNode |\x0a\x09context := outerContext newInnerContext.\x0a\x0a\x09\x22Interpret a copy of the sequence node to avoid creating a new AIBlockClosure\x22\x0a\x09sequenceNode := node nodes first copy\x0a\x09\x09parent: nil;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09\x22Define locals in the context\x22\x0a\x09sequenceNode temps do: [ :each |\x0a\x09\x09context defineLocal: each ].\x0a\x09\x09\x0a\x09\x22Populate the arguments into the context locals\x22\x09\x0a\x09node parameters withIndexDo: [ :each :index |\x0a\x09\x09context defineLocal: each.\x0a\x09\x09context localAt: each put: (aCollection at: index ifAbsent: [ nil ]) ].\x0a\x0a\x09\x22Interpret the first node of the BlockSequenceNode\x22\x0a\x09context interpreter\x0a\x09\x09node: sequenceNode nextChild;\x0a\x09\x09proceed.\x0a\x09\x09\x0a\x09outerContext interpreter\x0a\x09\x09setNonLocalReturnFromContext: context.\x0a\x09\x09\x0a\x09^ context interpreter pop",
  293. referencedClasses: [],
  294. //>>excludeEnd("ide");
  295. messageSends: ["newInnerContext", "parent:", "copy", "first", "nodes", "yourself", "do:", "temps", "defineLocal:", "withIndexDo:", "parameters", "localAt:put:", "at:ifAbsent:", "node:", "interpreter", "nextChild", "proceed", "setNonLocalReturnFromContext:", "pop"]
  296. }),
  297. $globals.AIBlockClosure);
  298. $core.addMethod(
  299. $core.method({
  300. selector: "forContext:node:",
  301. protocol: 'instance creation',
  302. fn: function (aContext,aNode){
  303. var self=this;
  304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  305. return $core.withContext(function($ctx1) {
  306. //>>excludeEnd("ctx");
  307. var $2,$3,$1;
  308. $2=self._new();
  309. $recv($2)._initializeWithContext_node_(aContext,aNode);
  310. $3=$recv($2)._yourself();
  311. $1=$3;
  312. return $1;
  313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  314. }, function($ctx1) {$ctx1.fill(self,"forContext:node:",{aContext:aContext,aNode:aNode},$globals.AIBlockClosure.klass)});
  315. //>>excludeEnd("ctx");
  316. },
  317. //>>excludeStart("ide", pragmas.excludeIdeData);
  318. args: ["aContext", "aNode"],
  319. source: "forContext: aContext node: aNode\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext node: aNode;\x0a\x09\x09yourself",
  320. referencedClasses: [],
  321. //>>excludeEnd("ide");
  322. messageSends: ["initializeWithContext:node:", "new", "yourself"]
  323. }),
  324. $globals.AIBlockClosure.klass);
  325. $core.addClass('AIContext', $globals.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'sendIndexes', 'evaluatedSelector', 'ast', 'interpreter', 'supercall'], 'Compiler-Interpreter');
  326. //>>excludeStart("ide", pragmas.excludeIdeData);
  327. $globals.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)";
  328. //>>excludeEnd("ide");
  329. $core.addMethod(
  330. $core.method({
  331. selector: "arguments",
  332. protocol: 'interpreting',
  333. fn: function (){
  334. var self=this;
  335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  336. return $core.withContext(function($ctx1) {
  337. //>>excludeEnd("ctx");
  338. var $1;
  339. $1=$recv($recv(self._ast())._arguments())._collect_((function(each){
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. return $core.withContext(function($ctx2) {
  342. //>>excludeEnd("ctx");
  343. return self._localAt_ifAbsent_(each,(function(){
  344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  345. return $core.withContext(function($ctx3) {
  346. //>>excludeEnd("ctx");
  347. return self._error_("Argument not in context");
  348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  349. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  350. //>>excludeEnd("ctx");
  351. }));
  352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  353. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  354. //>>excludeEnd("ctx");
  355. }));
  356. return $1;
  357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  358. }, function($ctx1) {$ctx1.fill(self,"arguments",{},$globals.AIContext)});
  359. //>>excludeEnd("ctx");
  360. },
  361. //>>excludeStart("ide", pragmas.excludeIdeData);
  362. args: [],
  363. source: "arguments\x0a\x09^ self ast arguments collect: [ :each |\x0a\x09\x09self localAt: each ifAbsent: [ self error: 'Argument not in context' ] ]",
  364. referencedClasses: [],
  365. //>>excludeEnd("ide");
  366. messageSends: ["collect:", "arguments", "ast", "localAt:ifAbsent:", "error:"]
  367. }),
  368. $globals.AIContext);
  369. $core.addMethod(
  370. $core.method({
  371. selector: "ast",
  372. protocol: 'interpreting',
  373. fn: function (){
  374. var self=this;
  375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  376. return $core.withContext(function($ctx1) {
  377. //>>excludeEnd("ctx");
  378. var $1,$3,$2,$4,$5,$receiver;
  379. $1=self._isBlockContext();
  380. if($core.assert($1)){
  381. $3=self._outerContext();
  382. if(($receiver = $3) == null || $receiver.isNil){
  383. $2=$3;
  384. } else {
  385. var context;
  386. context=$receiver;
  387. $2=$recv(context)._ast();
  388. };
  389. return $2;
  390. };
  391. $4=self["@ast"];
  392. if(($receiver = $4) == null || $receiver.isNil){
  393. self._initializeAST();
  394. } else {
  395. $4;
  396. };
  397. $5=self["@ast"];
  398. return $5;
  399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  400. }, function($ctx1) {$ctx1.fill(self,"ast",{},$globals.AIContext)});
  401. //>>excludeEnd("ctx");
  402. },
  403. //>>excludeStart("ide", pragmas.excludeIdeData);
  404. args: [],
  405. source: "ast\x0a\x09self isBlockContext ifTrue: [ \x0a\x09\x09^ self outerContext ifNotNil: [ :context | context ast ] ].\x0a\x0a\x09ast ifNil: [ self initializeAST ].\x0a\x09^ ast",
  406. referencedClasses: [],
  407. //>>excludeEnd("ide");
  408. messageSends: ["ifTrue:", "isBlockContext", "ifNotNil:", "outerContext", "ast", "ifNil:", "initializeAST"]
  409. }),
  410. $globals.AIContext);
  411. $core.addMethod(
  412. $core.method({
  413. selector: "basicLocalAt:",
  414. protocol: 'private',
  415. fn: function (aString){
  416. var self=this;
  417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  418. return $core.withContext(function($ctx1) {
  419. //>>excludeEnd("ctx");
  420. var $1;
  421. $1=$recv(self._locals())._at_(aString);
  422. return $1;
  423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  424. }, function($ctx1) {$ctx1.fill(self,"basicLocalAt:",{aString:aString},$globals.AIContext)});
  425. //>>excludeEnd("ctx");
  426. },
  427. //>>excludeStart("ide", pragmas.excludeIdeData);
  428. args: ["aString"],
  429. source: "basicLocalAt: aString\x0a\x09^ self locals at: aString",
  430. referencedClasses: [],
  431. //>>excludeEnd("ide");
  432. messageSends: ["at:", "locals"]
  433. }),
  434. $globals.AIContext);
  435. $core.addMethod(
  436. $core.method({
  437. selector: "basicLocalAt:put:",
  438. protocol: 'private',
  439. fn: function (aString,anObject){
  440. var self=this;
  441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  442. return $core.withContext(function($ctx1) {
  443. //>>excludeEnd("ctx");
  444. $recv(self._locals())._at_put_(aString,anObject);
  445. return self;
  446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  447. }, function($ctx1) {$ctx1.fill(self,"basicLocalAt:put:",{aString:aString,anObject:anObject},$globals.AIContext)});
  448. //>>excludeEnd("ctx");
  449. },
  450. //>>excludeStart("ide", pragmas.excludeIdeData);
  451. args: ["aString", "anObject"],
  452. source: "basicLocalAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  453. referencedClasses: [],
  454. //>>excludeEnd("ide");
  455. messageSends: ["at:put:", "locals"]
  456. }),
  457. $globals.AIContext);
  458. $core.addMethod(
  459. $core.method({
  460. selector: "basicReceiver",
  461. protocol: 'interpreting',
  462. fn: function (){
  463. var self=this;
  464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  465. return $core.withContext(function($ctx1) {
  466. //>>excludeEnd("ctx");
  467. var $1;
  468. $1=self._localAt_("self");
  469. return $1;
  470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  471. }, function($ctx1) {$ctx1.fill(self,"basicReceiver",{},$globals.AIContext)});
  472. //>>excludeEnd("ctx");
  473. },
  474. //>>excludeStart("ide", pragmas.excludeIdeData);
  475. args: [],
  476. source: "basicReceiver\x0a\x09^ self localAt: 'self'",
  477. referencedClasses: [],
  478. //>>excludeEnd("ide");
  479. messageSends: ["localAt:"]
  480. }),
  481. $globals.AIContext);
  482. $core.addMethod(
  483. $core.method({
  484. selector: "defineLocal:",
  485. protocol: 'accessing',
  486. fn: function (aString){
  487. var self=this;
  488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  489. return $core.withContext(function($ctx1) {
  490. //>>excludeEnd("ctx");
  491. $recv(self._locals())._at_put_(aString,nil);
  492. return self;
  493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  494. }, function($ctx1) {$ctx1.fill(self,"defineLocal:",{aString:aString},$globals.AIContext)});
  495. //>>excludeEnd("ctx");
  496. },
  497. //>>excludeStart("ide", pragmas.excludeIdeData);
  498. args: ["aString"],
  499. source: "defineLocal: aString\x0a\x09self locals at: aString put: nil",
  500. referencedClasses: [],
  501. //>>excludeEnd("ide");
  502. messageSends: ["at:put:", "locals"]
  503. }),
  504. $globals.AIContext);
  505. $core.addMethod(
  506. $core.method({
  507. selector: "evaluate:on:",
  508. protocol: 'evaluating',
  509. fn: function (aString,anEvaluator){
  510. var self=this;
  511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  512. return $core.withContext(function($ctx1) {
  513. //>>excludeEnd("ctx");
  514. var $1;
  515. $1=$recv(anEvaluator)._evaluate_context_(aString,self);
  516. return $1;
  517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  518. }, function($ctx1) {$ctx1.fill(self,"evaluate:on:",{aString:aString,anEvaluator:anEvaluator},$globals.AIContext)});
  519. //>>excludeEnd("ctx");
  520. },
  521. //>>excludeStart("ide", pragmas.excludeIdeData);
  522. args: ["aString", "anEvaluator"],
  523. source: "evaluate: aString on: anEvaluator\x0a\x09^ anEvaluator evaluate: aString context: self",
  524. referencedClasses: [],
  525. //>>excludeEnd("ide");
  526. messageSends: ["evaluate:context:"]
  527. }),
  528. $globals.AIContext);
  529. $core.addMethod(
  530. $core.method({
  531. selector: "evaluateNode:",
  532. protocol: 'evaluating',
  533. fn: function (aNode){
  534. var self=this;
  535. function $ASTInterpreter(){return $globals.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  537. return $core.withContext(function($ctx1) {
  538. //>>excludeEnd("ctx");
  539. var $2,$3,$1;
  540. $2=$recv($ASTInterpreter())._new();
  541. $recv($2)._context_(self);
  542. $recv($2)._node_($recv(aNode)._nextChild());
  543. $recv($2)._proceed();
  544. $3=$recv($2)._result();
  545. $1=$3;
  546. return $1;
  547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  548. }, function($ctx1) {$ctx1.fill(self,"evaluateNode:",{aNode:aNode},$globals.AIContext)});
  549. //>>excludeEnd("ctx");
  550. },
  551. //>>excludeStart("ide", pragmas.excludeIdeData);
  552. args: ["aNode"],
  553. source: "evaluateNode: aNode\x0a\x09^ ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09node: aNode nextChild;\x0a\x09\x09proceed;\x0a\x09\x09result",
  554. referencedClasses: ["ASTInterpreter"],
  555. //>>excludeEnd("ide");
  556. messageSends: ["context:", "new", "node:", "nextChild", "proceed", "result"]
  557. }),
  558. $globals.AIContext);
  559. $core.addMethod(
  560. $core.method({
  561. selector: "evaluatedSelector",
  562. protocol: 'accessing',
  563. fn: function (){
  564. var self=this;
  565. var $1;
  566. $1=self["@evaluatedSelector"];
  567. return $1;
  568. },
  569. //>>excludeStart("ide", pragmas.excludeIdeData);
  570. args: [],
  571. source: "evaluatedSelector\x0a\x09^ evaluatedSelector",
  572. referencedClasses: [],
  573. //>>excludeEnd("ide");
  574. messageSends: []
  575. }),
  576. $globals.AIContext);
  577. $core.addMethod(
  578. $core.method({
  579. selector: "evaluatedSelector:",
  580. protocol: 'accessing',
  581. fn: function (aString){
  582. var self=this;
  583. self["@evaluatedSelector"]=aString;
  584. return self;
  585. },
  586. //>>excludeStart("ide", pragmas.excludeIdeData);
  587. args: ["aString"],
  588. source: "evaluatedSelector: aString\x0a\x09evaluatedSelector := aString",
  589. referencedClasses: [],
  590. //>>excludeEnd("ide");
  591. messageSends: []
  592. }),
  593. $globals.AIContext);
  594. $core.addMethod(
  595. $core.method({
  596. selector: "index",
  597. protocol: 'accessing',
  598. fn: function (){
  599. var self=this;
  600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  601. return $core.withContext(function($ctx1) {
  602. //>>excludeEnd("ctx");
  603. var $2,$1,$receiver;
  604. $2=self["@index"];
  605. if(($receiver = $2) == null || $receiver.isNil){
  606. $1=(0);
  607. } else {
  608. $1=$2;
  609. };
  610. return $1;
  611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  612. }, function($ctx1) {$ctx1.fill(self,"index",{},$globals.AIContext)});
  613. //>>excludeEnd("ctx");
  614. },
  615. //>>excludeStart("ide", pragmas.excludeIdeData);
  616. args: [],
  617. source: "index\x0a\x09^ index ifNil: [ 0 ]",
  618. referencedClasses: [],
  619. //>>excludeEnd("ide");
  620. messageSends: ["ifNil:"]
  621. }),
  622. $globals.AIContext);
  623. $core.addMethod(
  624. $core.method({
  625. selector: "index:",
  626. protocol: 'accessing',
  627. fn: function (anInteger){
  628. var self=this;
  629. self["@index"]=anInteger;
  630. return self;
  631. },
  632. //>>excludeStart("ide", pragmas.excludeIdeData);
  633. args: ["anInteger"],
  634. source: "index: anInteger\x0a\x09index := anInteger",
  635. referencedClasses: [],
  636. //>>excludeEnd("ide");
  637. messageSends: []
  638. }),
  639. $globals.AIContext);
  640. $core.addMethod(
  641. $core.method({
  642. selector: "initializeAST",
  643. protocol: 'initialization',
  644. fn: function (){
  645. var self=this;
  646. function $SemanticAnalyzer(){return $globals.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  648. return $core.withContext(function($ctx1) {
  649. //>>excludeEnd("ctx");
  650. var $1;
  651. $1=self._method();
  652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  653. $ctx1.sendIdx["method"]=1;
  654. //>>excludeEnd("ctx");
  655. self["@ast"]=$recv($1)._ast();
  656. $recv($recv($SemanticAnalyzer())._on_($recv(self._method())._methodClass()))._visit_(self["@ast"]);
  657. return self;
  658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  659. }, function($ctx1) {$ctx1.fill(self,"initializeAST",{},$globals.AIContext)});
  660. //>>excludeEnd("ctx");
  661. },
  662. //>>excludeStart("ide", pragmas.excludeIdeData);
  663. args: [],
  664. source: "initializeAST\x0a\x09ast := self method ast.\x0a\x09(SemanticAnalyzer on: self method methodClass)\x0a\x09\x09visit: ast",
  665. referencedClasses: ["SemanticAnalyzer"],
  666. //>>excludeEnd("ide");
  667. messageSends: ["ast", "method", "visit:", "on:", "methodClass"]
  668. }),
  669. $globals.AIContext);
  670. $core.addMethod(
  671. $core.method({
  672. selector: "initializeFromMethodContext:",
  673. protocol: 'initialization',
  674. fn: function (aMethodContext){
  675. var self=this;
  676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  677. return $core.withContext(function($ctx1) {
  678. //>>excludeEnd("ctx");
  679. var $1,$2,$3,$4,$receiver;
  680. self._evaluatedSelector_($recv(aMethodContext)._evaluatedSelector());
  681. self._index_($recv(aMethodContext)._index());
  682. self._sendIndexes_($recv(aMethodContext)._sendIndexes());
  683. self._receiver_($recv(aMethodContext)._receiver());
  684. self._supercall_($recv(aMethodContext)._supercall());
  685. $1=self._selector_($recv(aMethodContext)._selector());
  686. $2=$recv(aMethodContext)._outerContext();
  687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  688. $ctx1.sendIdx["outerContext"]=1;
  689. //>>excludeEnd("ctx");
  690. if(($receiver = $2) == null || $receiver.isNil){
  691. $2;
  692. } else {
  693. var outer;
  694. outer=$receiver;
  695. $3=$recv(outer)._methodContext();
  696. if(($receiver = $3) == null || $receiver.isNil){
  697. $3;
  698. } else {
  699. self._outerContext_($recv(self._class())._fromMethodContext_($recv(aMethodContext)._outerContext()));
  700. };
  701. $4=$recv(aMethodContext)._locals();
  702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  703. $ctx1.sendIdx["locals"]=1;
  704. //>>excludeEnd("ctx");
  705. $recv($4)._keysAndValuesDo_((function(key,value){
  706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  707. return $core.withContext(function($ctx2) {
  708. //>>excludeEnd("ctx");
  709. return $recv(self._locals())._at_put_(key,value);
  710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  711. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)});
  712. //>>excludeEnd("ctx");
  713. }));
  714. };
  715. return self;
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. }, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},$globals.AIContext)});
  718. //>>excludeEnd("ctx");
  719. },
  720. //>>excludeStart("ide", pragmas.excludeIdeData);
  721. args: ["aMethodContext"],
  722. source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09evaluatedSelector: aMethodContext evaluatedSelector;\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09sendIndexes: aMethodContext sendIndexes;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09supercall: aMethodContext supercall;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\x0a\x09aMethodContext outerContext ifNotNil: [ :outer |\x0a\x09\x09\x22If the method context is nil, the block was defined in JS, so ignore it\x22\x0a\x09\x09outer methodContext ifNotNil: [\x0a\x09\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09\x09\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09self locals at: key put: value ] ]",
  723. referencedClasses: [],
  724. //>>excludeEnd("ide");
  725. messageSends: ["evaluatedSelector:", "evaluatedSelector", "index:", "index", "sendIndexes:", "sendIndexes", "receiver:", "receiver", "supercall:", "supercall", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"]
  726. }),
  727. $globals.AIContext);
  728. $core.addMethod(
  729. $core.method({
  730. selector: "initializeInterpreter",
  731. protocol: 'initialization',
  732. fn: function (){
  733. var self=this;
  734. function $ASTInterpreter(){return $globals.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  736. return $core.withContext(function($ctx1) {
  737. //>>excludeEnd("ctx");
  738. var $1,$2,$3,$receiver;
  739. $1=$recv($ASTInterpreter())._new();
  740. $recv($1)._context_(self);
  741. $2=$recv($1)._yourself();
  742. self["@interpreter"]=$2;
  743. $3=self._innerContext();
  744. if(($receiver = $3) == null || $receiver.isNil){
  745. $3;
  746. } else {
  747. self._setupInterpreter_(self["@interpreter"]);
  748. };
  749. return self;
  750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  751. }, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},$globals.AIContext)});
  752. //>>excludeEnd("ctx");
  753. },
  754. //>>excludeStart("ide", pragmas.excludeIdeData);
  755. args: [],
  756. source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09yourself.\x0a\x09\x0a\x09self innerContext ifNotNil: [\x0a\x09\x09self setupInterpreter: interpreter ]",
  757. referencedClasses: ["ASTInterpreter"],
  758. //>>excludeEnd("ide");
  759. messageSends: ["context:", "new", "yourself", "ifNotNil:", "innerContext", "setupInterpreter:"]
  760. }),
  761. $globals.AIContext);
  762. $core.addMethod(
  763. $core.method({
  764. selector: "initializeLocals",
  765. protocol: 'initialization',
  766. fn: function (){
  767. var self=this;
  768. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  770. return $core.withContext(function($ctx1) {
  771. //>>excludeEnd("ctx");
  772. self["@locals"]=$recv($Dictionary())._new();
  773. $recv(self["@locals"])._at_put_("thisContext",self);
  774. return self;
  775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  776. }, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},$globals.AIContext)});
  777. //>>excludeEnd("ctx");
  778. },
  779. //>>excludeStart("ide", pragmas.excludeIdeData);
  780. args: [],
  781. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  782. referencedClasses: ["Dictionary"],
  783. //>>excludeEnd("ide");
  784. messageSends: ["new", "at:put:"]
  785. }),
  786. $globals.AIContext);
  787. $core.addMethod(
  788. $core.method({
  789. selector: "innerContext",
  790. protocol: 'accessing',
  791. fn: function (){
  792. var self=this;
  793. var $1;
  794. $1=self["@innerContext"];
  795. return $1;
  796. },
  797. //>>excludeStart("ide", pragmas.excludeIdeData);
  798. args: [],
  799. source: "innerContext\x0a\x09^ innerContext",
  800. referencedClasses: [],
  801. //>>excludeEnd("ide");
  802. messageSends: []
  803. }),
  804. $globals.AIContext);
  805. $core.addMethod(
  806. $core.method({
  807. selector: "innerContext:",
  808. protocol: 'accessing',
  809. fn: function (anAIContext){
  810. var self=this;
  811. self["@innerContext"]=anAIContext;
  812. return self;
  813. },
  814. //>>excludeStart("ide", pragmas.excludeIdeData);
  815. args: ["anAIContext"],
  816. source: "innerContext: anAIContext\x0a\x09innerContext := anAIContext",
  817. referencedClasses: [],
  818. //>>excludeEnd("ide");
  819. messageSends: []
  820. }),
  821. $globals.AIContext);
  822. $core.addMethod(
  823. $core.method({
  824. selector: "interpreter",
  825. protocol: 'interpreting',
  826. fn: function (){
  827. var self=this;
  828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  829. return $core.withContext(function($ctx1) {
  830. //>>excludeEnd("ctx");
  831. var $1,$2,$receiver;
  832. $1=self["@interpreter"];
  833. if(($receiver = $1) == null || $receiver.isNil){
  834. self._initializeInterpreter();
  835. } else {
  836. $1;
  837. };
  838. $2=self["@interpreter"];
  839. return $2;
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},$globals.AIContext)});
  842. //>>excludeEnd("ctx");
  843. },
  844. //>>excludeStart("ide", pragmas.excludeIdeData);
  845. args: [],
  846. source: "interpreter\x0a\x09interpreter ifNil: [ self initializeInterpreter ].\x0a\x09^ interpreter",
  847. referencedClasses: [],
  848. //>>excludeEnd("ide");
  849. messageSends: ["ifNil:", "initializeInterpreter"]
  850. }),
  851. $globals.AIContext);
  852. $core.addMethod(
  853. $core.method({
  854. selector: "interpreter:",
  855. protocol: 'interpreting',
  856. fn: function (anInterpreter){
  857. var self=this;
  858. self["@interpreter"]=anInterpreter;
  859. return self;
  860. },
  861. //>>excludeStart("ide", pragmas.excludeIdeData);
  862. args: ["anInterpreter"],
  863. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  864. referencedClasses: [],
  865. //>>excludeEnd("ide");
  866. messageSends: []
  867. }),
  868. $globals.AIContext);
  869. $core.addMethod(
  870. $core.method({
  871. selector: "isTopContext",
  872. protocol: 'testing',
  873. fn: function (){
  874. var self=this;
  875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  876. return $core.withContext(function($ctx1) {
  877. //>>excludeEnd("ctx");
  878. var $1;
  879. $1=$recv(self._innerContext())._isNil();
  880. return $1;
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. }, function($ctx1) {$ctx1.fill(self,"isTopContext",{},$globals.AIContext)});
  883. //>>excludeEnd("ctx");
  884. },
  885. //>>excludeStart("ide", pragmas.excludeIdeData);
  886. args: [],
  887. source: "isTopContext\x0a\x09^ self innerContext isNil",
  888. referencedClasses: [],
  889. //>>excludeEnd("ide");
  890. messageSends: ["isNil", "innerContext"]
  891. }),
  892. $globals.AIContext);
  893. $core.addMethod(
  894. $core.method({
  895. selector: "localAt:",
  896. protocol: 'accessing',
  897. fn: function (aString){
  898. var self=this;
  899. var context;
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. return $core.withContext(function($ctx1) {
  902. //>>excludeEnd("ctx");
  903. var $1;
  904. context=self._lookupContextForLocal_(aString);
  905. $1=$recv(context)._basicLocalAt_(aString);
  906. return $1;
  907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  908. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString,context:context},$globals.AIContext)});
  909. //>>excludeEnd("ctx");
  910. },
  911. //>>excludeStart("ide", pragmas.excludeIdeData);
  912. args: ["aString"],
  913. source: "localAt: aString\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09| context |\x0a\x09\x0a\x09context := self lookupContextForLocal: aString.\x0a\x09^ context basicLocalAt: aString",
  914. referencedClasses: [],
  915. //>>excludeEnd("ide");
  916. messageSends: ["lookupContextForLocal:", "basicLocalAt:"]
  917. }),
  918. $globals.AIContext);
  919. $core.addMethod(
  920. $core.method({
  921. selector: "localAt:ifAbsent:",
  922. protocol: 'accessing',
  923. fn: function (aString,aBlock){
  924. var self=this;
  925. var context;
  926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  927. return $core.withContext(function($ctx1) {
  928. //>>excludeEnd("ctx");
  929. var $1,$2;
  930. var $early={};
  931. try {
  932. context=self._lookupContextForLocal_ifNone_(aString,(function(){
  933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  934. return $core.withContext(function($ctx2) {
  935. //>>excludeEnd("ctx");
  936. $1=$recv(aBlock)._value();
  937. throw $early=[$1];
  938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  939. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  940. //>>excludeEnd("ctx");
  941. }));
  942. $2=$recv(context)._basicLocalAt_(aString);
  943. return $2;
  944. }
  945. catch(e) {if(e===$early)return e[0]; throw e}
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. }, function($ctx1) {$ctx1.fill(self,"localAt:ifAbsent:",{aString:aString,aBlock:aBlock,context:context},$globals.AIContext)});
  948. //>>excludeEnd("ctx");
  949. },
  950. //>>excludeStart("ide", pragmas.excludeIdeData);
  951. args: ["aString", "aBlock"],
  952. source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09| context |\x0a\x09\x0a\x09context := self \x09\x0a\x09\x09lookupContextForLocal: aString \x0a\x09\x09ifNone: [ ^ aBlock value ].\x0a\x09\x0a\x09^ context basicLocalAt: aString",
  953. referencedClasses: [],
  954. //>>excludeEnd("ide");
  955. messageSends: ["lookupContextForLocal:ifNone:", "value", "basicLocalAt:"]
  956. }),
  957. $globals.AIContext);
  958. $core.addMethod(
  959. $core.method({
  960. selector: "localAt:put:",
  961. protocol: 'accessing',
  962. fn: function (aString,anObject){
  963. var self=this;
  964. var context;
  965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  966. return $core.withContext(function($ctx1) {
  967. //>>excludeEnd("ctx");
  968. context=self._lookupContextForLocal_(aString);
  969. $recv(context)._basicLocalAt_put_(aString,anObject);
  970. return self;
  971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  972. }, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject,context:context},$globals.AIContext)});
  973. //>>excludeEnd("ctx");
  974. },
  975. //>>excludeStart("ide", pragmas.excludeIdeData);
  976. args: ["aString", "anObject"],
  977. source: "localAt: aString put: anObject\x0a\x09| context |\x0a\x09\x0a\x09context := self lookupContextForLocal: aString.\x0a\x09context basicLocalAt: aString put: anObject",
  978. referencedClasses: [],
  979. //>>excludeEnd("ide");
  980. messageSends: ["lookupContextForLocal:", "basicLocalAt:put:"]
  981. }),
  982. $globals.AIContext);
  983. $core.addMethod(
  984. $core.method({
  985. selector: "locals",
  986. protocol: 'accessing',
  987. fn: function (){
  988. var self=this;
  989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  990. return $core.withContext(function($ctx1) {
  991. //>>excludeEnd("ctx");
  992. var $1,$2,$receiver;
  993. $1=self["@locals"];
  994. if(($receiver = $1) == null || $receiver.isNil){
  995. self._initializeLocals();
  996. } else {
  997. $1;
  998. };
  999. $2=self["@locals"];
  1000. return $2;
  1001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1002. }, function($ctx1) {$ctx1.fill(self,"locals",{},$globals.AIContext)});
  1003. //>>excludeEnd("ctx");
  1004. },
  1005. //>>excludeStart("ide", pragmas.excludeIdeData);
  1006. args: [],
  1007. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  1008. referencedClasses: [],
  1009. //>>excludeEnd("ide");
  1010. messageSends: ["ifNil:", "initializeLocals"]
  1011. }),
  1012. $globals.AIContext);
  1013. $core.addMethod(
  1014. $core.method({
  1015. selector: "lookupContextForLocal:",
  1016. protocol: 'private',
  1017. fn: function (aString){
  1018. var self=this;
  1019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1020. return $core.withContext(function($ctx1) {
  1021. //>>excludeEnd("ctx");
  1022. var $1;
  1023. $1=self._lookupContextForLocal_ifNone_(aString,(function(){
  1024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1025. return $core.withContext(function($ctx2) {
  1026. //>>excludeEnd("ctx");
  1027. return self._variableNotFound();
  1028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1029. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1030. //>>excludeEnd("ctx");
  1031. }));
  1032. return $1;
  1033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1034. }, function($ctx1) {$ctx1.fill(self,"lookupContextForLocal:",{aString:aString},$globals.AIContext)});
  1035. //>>excludeEnd("ctx");
  1036. },
  1037. //>>excludeStart("ide", pragmas.excludeIdeData);
  1038. args: ["aString"],
  1039. source: "lookupContextForLocal: aString\x0a\x09\x22Lookup the context defining the local named `aString` \x0a\x09up to the method context\x22\x0a\x0a\x09^ self \x0a\x09\x09lookupContextForLocal: aString \x0a\x09\x09ifNone: [ self variableNotFound ]",
  1040. referencedClasses: [],
  1041. //>>excludeEnd("ide");
  1042. messageSends: ["lookupContextForLocal:ifNone:", "variableNotFound"]
  1043. }),
  1044. $globals.AIContext);
  1045. $core.addMethod(
  1046. $core.method({
  1047. selector: "lookupContextForLocal:ifNone:",
  1048. protocol: 'private',
  1049. fn: function (aString,aBlock){
  1050. var self=this;
  1051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1052. return $core.withContext(function($ctx1) {
  1053. //>>excludeEnd("ctx");
  1054. var $2,$1;
  1055. $1=$recv(self._locals())._at_ifPresent_ifAbsent_(aString,(function(){
  1056. return self;
  1057. }),(function(){
  1058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1059. return $core.withContext(function($ctx2) {
  1060. //>>excludeEnd("ctx");
  1061. $2=self._outerContext();
  1062. return $recv($2)._ifNil_ifNotNil_(aBlock,(function(context){
  1063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1064. return $core.withContext(function($ctx3) {
  1065. //>>excludeEnd("ctx");
  1066. return $recv(context)._lookupContextForLocal_(aString);
  1067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1068. }, function($ctx3) {$ctx3.fillBlock({context:context},$ctx2,3)});
  1069. //>>excludeEnd("ctx");
  1070. }));
  1071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1072. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1073. //>>excludeEnd("ctx");
  1074. }));
  1075. return $1;
  1076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1077. }, function($ctx1) {$ctx1.fill(self,"lookupContextForLocal:ifNone:",{aString:aString,aBlock:aBlock},$globals.AIContext)});
  1078. //>>excludeEnd("ctx");
  1079. },
  1080. //>>excludeStart("ide", pragmas.excludeIdeData);
  1081. args: ["aString", "aBlock"],
  1082. source: "lookupContextForLocal: aString ifNone: aBlock\x0a\x09\x22Lookup the context defining the local named `aString` \x0a\x09up to the method context\x22\x0a\x0a\x09^ self locals \x0a\x09\x09at: aString\x0a\x09\x09ifPresent: [ self ]\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09self outerContext \x0a\x09\x09\x09\x09ifNil: aBlock\x0a\x09\x09\x09\x09ifNotNil: [ :context | \x0a\x09\x09\x09\x09\x09context lookupContextForLocal: aString ] ]",
  1083. referencedClasses: [],
  1084. //>>excludeEnd("ide");
  1085. messageSends: ["at:ifPresent:ifAbsent:", "locals", "ifNil:ifNotNil:", "outerContext", "lookupContextForLocal:"]
  1086. }),
  1087. $globals.AIContext);
  1088. $core.addMethod(
  1089. $core.method({
  1090. selector: "newInnerContext",
  1091. protocol: 'factory',
  1092. fn: function (){
  1093. var self=this;
  1094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1095. return $core.withContext(function($ctx1) {
  1096. //>>excludeEnd("ctx");
  1097. var $2,$3,$1;
  1098. $2=$recv(self._class())._new();
  1099. $recv($2)._outerContext_(self);
  1100. $3=$recv($2)._yourself();
  1101. $1=$3;
  1102. return $1;
  1103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1104. }, function($ctx1) {$ctx1.fill(self,"newInnerContext",{},$globals.AIContext)});
  1105. //>>excludeEnd("ctx");
  1106. },
  1107. //>>excludeStart("ide", pragmas.excludeIdeData);
  1108. args: [],
  1109. source: "newInnerContext\x0a\x09^ self class new\x0a\x09\x09outerContext: self;\x0a\x09\x09yourself",
  1110. referencedClasses: [],
  1111. //>>excludeEnd("ide");
  1112. messageSends: ["outerContext:", "new", "class", "yourself"]
  1113. }),
  1114. $globals.AIContext);
  1115. $core.addMethod(
  1116. $core.method({
  1117. selector: "outerContext",
  1118. protocol: 'accessing',
  1119. fn: function (){
  1120. var self=this;
  1121. var $1;
  1122. $1=self["@outerContext"];
  1123. return $1;
  1124. },
  1125. //>>excludeStart("ide", pragmas.excludeIdeData);
  1126. args: [],
  1127. source: "outerContext\x0a\x09^ outerContext",
  1128. referencedClasses: [],
  1129. //>>excludeEnd("ide");
  1130. messageSends: []
  1131. }),
  1132. $globals.AIContext);
  1133. $core.addMethod(
  1134. $core.method({
  1135. selector: "outerContext:",
  1136. protocol: 'accessing',
  1137. fn: function (anAIContext){
  1138. var self=this;
  1139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1140. return $core.withContext(function($ctx1) {
  1141. //>>excludeEnd("ctx");
  1142. var $1,$receiver;
  1143. self["@outerContext"]=anAIContext;
  1144. $1=self["@outerContext"];
  1145. if(($receiver = $1) == null || $receiver.isNil){
  1146. $1;
  1147. } else {
  1148. var context;
  1149. context=$receiver;
  1150. $recv(context)._innerContext_(self);
  1151. };
  1152. return self;
  1153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1154. }, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},$globals.AIContext)});
  1155. //>>excludeEnd("ctx");
  1156. },
  1157. //>>excludeStart("ide", pragmas.excludeIdeData);
  1158. args: ["anAIContext"],
  1159. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext.\x0a\x09outerContext ifNotNil: [ :context | \x0a\x09\x09context innerContext: self ]",
  1160. referencedClasses: [],
  1161. //>>excludeEnd("ide");
  1162. messageSends: ["ifNotNil:", "innerContext:"]
  1163. }),
  1164. $globals.AIContext);
  1165. $core.addMethod(
  1166. $core.method({
  1167. selector: "receiver:",
  1168. protocol: 'interpreting',
  1169. fn: function (anObject){
  1170. var self=this;
  1171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1172. return $core.withContext(function($ctx1) {
  1173. //>>excludeEnd("ctx");
  1174. $recv(self._locals())._at_put_("self",anObject);
  1175. return self;
  1176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1177. }, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},$globals.AIContext)});
  1178. //>>excludeEnd("ctx");
  1179. },
  1180. //>>excludeStart("ide", pragmas.excludeIdeData);
  1181. args: ["anObject"],
  1182. source: "receiver: anObject\x0a\x09self locals at: 'self' put: anObject",
  1183. referencedClasses: [],
  1184. //>>excludeEnd("ide");
  1185. messageSends: ["at:put:", "locals"]
  1186. }),
  1187. $globals.AIContext);
  1188. $core.addMethod(
  1189. $core.method({
  1190. selector: "selector",
  1191. protocol: 'accessing',
  1192. fn: function (){
  1193. var self=this;
  1194. var $1;
  1195. $1=self["@selector"];
  1196. return $1;
  1197. },
  1198. //>>excludeStart("ide", pragmas.excludeIdeData);
  1199. args: [],
  1200. source: "selector\x0a\x09^ selector",
  1201. referencedClasses: [],
  1202. //>>excludeEnd("ide");
  1203. messageSends: []
  1204. }),
  1205. $globals.AIContext);
  1206. $core.addMethod(
  1207. $core.method({
  1208. selector: "selector:",
  1209. protocol: 'accessing',
  1210. fn: function (aString){
  1211. var self=this;
  1212. self["@selector"]=aString;
  1213. return self;
  1214. },
  1215. //>>excludeStart("ide", pragmas.excludeIdeData);
  1216. args: ["aString"],
  1217. source: "selector: aString\x0a\x09selector := aString",
  1218. referencedClasses: [],
  1219. //>>excludeEnd("ide");
  1220. messageSends: []
  1221. }),
  1222. $globals.AIContext);
  1223. $core.addMethod(
  1224. $core.method({
  1225. selector: "sendIndexAt:",
  1226. protocol: 'accessing',
  1227. fn: function (aString){
  1228. var self=this;
  1229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1230. return $core.withContext(function($ctx1) {
  1231. //>>excludeEnd("ctx");
  1232. var $1;
  1233. $1=$recv(self._sendIndexes())._at_ifAbsent_(aString,(function(){
  1234. return (0);
  1235. }));
  1236. return $1;
  1237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1238. }, function($ctx1) {$ctx1.fill(self,"sendIndexAt:",{aString:aString},$globals.AIContext)});
  1239. //>>excludeEnd("ctx");
  1240. },
  1241. //>>excludeStart("ide", pragmas.excludeIdeData);
  1242. args: ["aString"],
  1243. source: "sendIndexAt: aString\x0a\x09^ self sendIndexes at: aString ifAbsent: [ 0 ]",
  1244. referencedClasses: [],
  1245. //>>excludeEnd("ide");
  1246. messageSends: ["at:ifAbsent:", "sendIndexes"]
  1247. }),
  1248. $globals.AIContext);
  1249. $core.addMethod(
  1250. $core.method({
  1251. selector: "sendIndexes",
  1252. protocol: 'accessing',
  1253. fn: function (){
  1254. var self=this;
  1255. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1257. return $core.withContext(function($ctx1) {
  1258. //>>excludeEnd("ctx");
  1259. var $2,$1,$receiver;
  1260. $2=self["@sendIndexes"];
  1261. if(($receiver = $2) == null || $receiver.isNil){
  1262. $1=$recv($Dictionary())._new();
  1263. } else {
  1264. $1=$2;
  1265. };
  1266. return $1;
  1267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1268. }, function($ctx1) {$ctx1.fill(self,"sendIndexes",{},$globals.AIContext)});
  1269. //>>excludeEnd("ctx");
  1270. },
  1271. //>>excludeStart("ide", pragmas.excludeIdeData);
  1272. args: [],
  1273. source: "sendIndexes\x0a\x09^ sendIndexes ifNil: [ Dictionary new ]",
  1274. referencedClasses: ["Dictionary"],
  1275. //>>excludeEnd("ide");
  1276. messageSends: ["ifNil:", "new"]
  1277. }),
  1278. $globals.AIContext);
  1279. $core.addMethod(
  1280. $core.method({
  1281. selector: "sendIndexes:",
  1282. protocol: 'accessing',
  1283. fn: function (aDictionary){
  1284. var self=this;
  1285. self["@sendIndexes"]=aDictionary;
  1286. return self;
  1287. },
  1288. //>>excludeStart("ide", pragmas.excludeIdeData);
  1289. args: ["aDictionary"],
  1290. source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
  1291. referencedClasses: [],
  1292. //>>excludeEnd("ide");
  1293. messageSends: []
  1294. }),
  1295. $globals.AIContext);
  1296. $core.addMethod(
  1297. $core.method({
  1298. selector: "setupInterpreter:",
  1299. protocol: 'interpreting',
  1300. fn: function (anInterpreter){
  1301. var self=this;
  1302. var currentNode;
  1303. function $ASTPCNodeVisitor(){return $globals.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  1304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1305. return $core.withContext(function($ctx1) {
  1306. //>>excludeEnd("ctx");
  1307. var $1,$2,$3,$4,$5,$8,$7,$6,$receiver;
  1308. $1=$recv($ASTPCNodeVisitor())._new();
  1309. $recv($1)._selector_(self._evaluatedSelector());
  1310. $recv($1)._context_(self);
  1311. $2=$1;
  1312. $3=self._ast();
  1313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1314. $ctx1.sendIdx["ast"]=1;
  1315. //>>excludeEnd("ctx");
  1316. $recv($2)._visit_($3);
  1317. $4=$recv($1)._currentNode();
  1318. currentNode=$4;
  1319. $5=$recv(self._ast())._sequenceNode();
  1320. if(($receiver = $5) == null || $receiver.isNil){
  1321. $5;
  1322. } else {
  1323. var sequence;
  1324. sequence=$receiver;
  1325. $recv($recv(sequence)._temps())._do_((function(each){
  1326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1327. return $core.withContext(function($ctx2) {
  1328. //>>excludeEnd("ctx");
  1329. return self._defineLocal_(each);
  1330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1331. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1332. //>>excludeEnd("ctx");
  1333. }));
  1334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1335. $ctx1.sendIdx["do:"]=1;
  1336. //>>excludeEnd("ctx");
  1337. };
  1338. $recv(anInterpreter)._node_(currentNode);
  1339. $8=self._innerContext();
  1340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1341. $ctx1.sendIdx["innerContext"]=1;
  1342. //>>excludeEnd("ctx");
  1343. $7=$recv($8)._arguments();
  1344. $6=$recv($7)._reversed();
  1345. $recv($6)._do_((function(each){
  1346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1347. return $core.withContext(function($ctx2) {
  1348. //>>excludeEnd("ctx");
  1349. return $recv(anInterpreter)._push_(each);
  1350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1351. $ctx2.sendIdx["push:"]=1;
  1352. //>>excludeEnd("ctx");
  1353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1354. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  1355. //>>excludeEnd("ctx");
  1356. }));
  1357. $recv(anInterpreter)._push_($recv(self._innerContext())._receiver());
  1358. return self;
  1359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1360. }, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter,currentNode:currentNode},$globals.AIContext)});
  1361. //>>excludeEnd("ctx");
  1362. },
  1363. //>>excludeStart("ide", pragmas.excludeIdeData);
  1364. args: ["anInterpreter"],
  1365. source: "setupInterpreter: anInterpreter\x0a\x09| currentNode |\x0a\x09\x0a\x09\x22Retrieve the current node\x22\x0a\x09currentNode := ASTPCNodeVisitor new\x0a\x09\x09\x09selector: self evaluatedSelector;\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode.\x0a\x09\x0a\x09\x22Define locals for the context\x22\x0a\x09self ast sequenceNode ifNotNil: [ :sequence |\x0a\x09\x09sequence temps do: [ :each |\x0a\x09\x09\x09self defineLocal: each ] ].\x0a\x09\x0a\x09anInterpreter node: currentNode.\x0a\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
  1366. referencedClasses: ["ASTPCNodeVisitor"],
  1367. //>>excludeEnd("ide");
  1368. messageSends: ["selector:", "new", "evaluatedSelector", "context:", "visit:", "ast", "currentNode", "ifNotNil:", "sequenceNode", "do:", "temps", "defineLocal:", "node:", "reversed", "arguments", "innerContext", "push:", "receiver"]
  1369. }),
  1370. $globals.AIContext);
  1371. $core.addMethod(
  1372. $core.method({
  1373. selector: "supercall",
  1374. protocol: 'interpreting',
  1375. fn: function (){
  1376. var self=this;
  1377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1378. return $core.withContext(function($ctx1) {
  1379. //>>excludeEnd("ctx");
  1380. var $2,$1,$receiver;
  1381. $2=self["@supercall"];
  1382. if(($receiver = $2) == null || $receiver.isNil){
  1383. $1=false;
  1384. } else {
  1385. $1=$2;
  1386. };
  1387. return $1;
  1388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1389. }, function($ctx1) {$ctx1.fill(self,"supercall",{},$globals.AIContext)});
  1390. //>>excludeEnd("ctx");
  1391. },
  1392. //>>excludeStart("ide", pragmas.excludeIdeData);
  1393. args: [],
  1394. source: "supercall\x0a\x09^ supercall ifNil: [ false ]",
  1395. referencedClasses: [],
  1396. //>>excludeEnd("ide");
  1397. messageSends: ["ifNil:"]
  1398. }),
  1399. $globals.AIContext);
  1400. $core.addMethod(
  1401. $core.method({
  1402. selector: "supercall:",
  1403. protocol: 'interpreting',
  1404. fn: function (aBoolean){
  1405. var self=this;
  1406. self["@supercall"]=aBoolean;
  1407. return self;
  1408. },
  1409. //>>excludeStart("ide", pragmas.excludeIdeData);
  1410. args: ["aBoolean"],
  1411. source: "supercall: aBoolean\x0a\x09supercall := aBoolean",
  1412. referencedClasses: [],
  1413. //>>excludeEnd("ide");
  1414. messageSends: []
  1415. }),
  1416. $globals.AIContext);
  1417. $core.addMethod(
  1418. $core.method({
  1419. selector: "variableNotFound",
  1420. protocol: 'error handling',
  1421. fn: function (){
  1422. var self=this;
  1423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1424. return $core.withContext(function($ctx1) {
  1425. //>>excludeEnd("ctx");
  1426. self._error_("Variable missing");
  1427. return self;
  1428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1429. }, function($ctx1) {$ctx1.fill(self,"variableNotFound",{},$globals.AIContext)});
  1430. //>>excludeEnd("ctx");
  1431. },
  1432. //>>excludeStart("ide", pragmas.excludeIdeData);
  1433. args: [],
  1434. source: "variableNotFound\x0a\x09\x22Error thrown whenever a variable lookup fails\x22\x0a\x09\x0a\x09self error: 'Variable missing'",
  1435. referencedClasses: [],
  1436. //>>excludeEnd("ide");
  1437. messageSends: ["error:"]
  1438. }),
  1439. $globals.AIContext);
  1440. $core.addMethod(
  1441. $core.method({
  1442. selector: "fromMethodContext:",
  1443. protocol: 'instance creation',
  1444. fn: function (aMethodContext){
  1445. var self=this;
  1446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1447. return $core.withContext(function($ctx1) {
  1448. //>>excludeEnd("ctx");
  1449. var $2,$3,$1;
  1450. $2=self._new();
  1451. $recv($2)._initializeFromMethodContext_(aMethodContext);
  1452. $3=$recv($2)._yourself();
  1453. $1=$3;
  1454. return $1;
  1455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1456. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},$globals.AIContext.klass)});
  1457. //>>excludeEnd("ctx");
  1458. },
  1459. //>>excludeStart("ide", pragmas.excludeIdeData);
  1460. args: ["aMethodContext"],
  1461. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  1462. referencedClasses: [],
  1463. //>>excludeEnd("ide");
  1464. messageSends: ["initializeFromMethodContext:", "new", "yourself"]
  1465. }),
  1466. $globals.AIContext.klass);
  1467. $core.addClass('AISemanticAnalyzer', $globals.SemanticAnalyzer, ['context'], 'Compiler-Interpreter');
  1468. //>>excludeStart("ide", pragmas.excludeIdeData);
  1469. $globals.AISemanticAnalyzer.comment="I perform the same semantic analysis than `SemanticAnalyzer`, with the difference that provided an `AIContext` context, variables are bound with the context variables.";
  1470. //>>excludeEnd("ide");
  1471. $core.addMethod(
  1472. $core.method({
  1473. selector: "context",
  1474. protocol: 'accessing',
  1475. fn: function (){
  1476. var self=this;
  1477. var $1;
  1478. $1=self["@context"];
  1479. return $1;
  1480. },
  1481. //>>excludeStart("ide", pragmas.excludeIdeData);
  1482. args: [],
  1483. source: "context\x0a\x09^ context",
  1484. referencedClasses: [],
  1485. //>>excludeEnd("ide");
  1486. messageSends: []
  1487. }),
  1488. $globals.AISemanticAnalyzer);
  1489. $core.addMethod(
  1490. $core.method({
  1491. selector: "context:",
  1492. protocol: 'accessing',
  1493. fn: function (anAIContext){
  1494. var self=this;
  1495. self["@context"]=anAIContext;
  1496. return self;
  1497. },
  1498. //>>excludeStart("ide", pragmas.excludeIdeData);
  1499. args: ["anAIContext"],
  1500. source: "context: anAIContext\x0a\x09context := anAIContext",
  1501. referencedClasses: [],
  1502. //>>excludeEnd("ide");
  1503. messageSends: []
  1504. }),
  1505. $globals.AISemanticAnalyzer);
  1506. $core.addMethod(
  1507. $core.method({
  1508. selector: "visitVariableNode:",
  1509. protocol: 'visiting',
  1510. fn: function (aNode){
  1511. var self=this;
  1512. function $ASTContextVar(){return $globals.ASTContextVar||(typeof ASTContextVar=="undefined"?nil:ASTContextVar)}
  1513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1514. return $core.withContext(function($ctx1) {
  1515. //>>excludeEnd("ctx");
  1516. var $1;
  1517. var $early={};
  1518. try {
  1519. $recv(self._context())._localAt_ifAbsent_($recv(aNode)._value(),(function(){
  1520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1521. return $core.withContext(function($ctx2) {
  1522. //>>excludeEnd("ctx");
  1523. $1=(
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. $ctx2.supercall = true,
  1526. //>>excludeEnd("ctx");
  1527. $globals.AISemanticAnalyzer.superclass.fn.prototype._visitVariableNode_.apply($recv(self), [aNode]));
  1528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1529. $ctx2.supercall = false;
  1530. //>>excludeEnd("ctx");;
  1531. throw $early=[$1];
  1532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1533. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1534. //>>excludeEnd("ctx");
  1535. }));
  1536. $recv(aNode)._binding_($recv($ASTContextVar())._new());
  1537. return self;
  1538. }
  1539. catch(e) {if(e===$early)return e[0]; throw e}
  1540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1541. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.AISemanticAnalyzer)});
  1542. //>>excludeEnd("ctx");
  1543. },
  1544. //>>excludeStart("ide", pragmas.excludeIdeData);
  1545. args: ["aNode"],
  1546. source: "visitVariableNode: aNode\x0a\x09self context \x0a\x09\x09localAt: aNode value \x0a\x09\x09ifAbsent: [ ^ super visitVariableNode: aNode ].\x0a\x0a\x09aNode binding: ASTContextVar new",
  1547. referencedClasses: ["ASTContextVar"],
  1548. //>>excludeEnd("ide");
  1549. messageSends: ["localAt:ifAbsent:", "context", "value", "visitVariableNode:", "binding:", "new"]
  1550. }),
  1551. $globals.AISemanticAnalyzer);
  1552. $core.addClass('ASTContextVar', $globals.ScopeVar, ['context'], 'Compiler-Interpreter');
  1553. //>>excludeStart("ide", pragmas.excludeIdeData);
  1554. $globals.ASTContextVar.comment="I am a variable defined in a `context`.";
  1555. //>>excludeEnd("ide");
  1556. $core.addMethod(
  1557. $core.method({
  1558. selector: "context",
  1559. protocol: 'accessing',
  1560. fn: function (){
  1561. var self=this;
  1562. var $1;
  1563. $1=self["@context"];
  1564. return $1;
  1565. },
  1566. //>>excludeStart("ide", pragmas.excludeIdeData);
  1567. args: [],
  1568. source: "context\x0a\x09^ context",
  1569. referencedClasses: [],
  1570. //>>excludeEnd("ide");
  1571. messageSends: []
  1572. }),
  1573. $globals.ASTContextVar);
  1574. $core.addMethod(
  1575. $core.method({
  1576. selector: "context:",
  1577. protocol: 'accessing',
  1578. fn: function (anObject){
  1579. var self=this;
  1580. self["@context"]=anObject;
  1581. return self;
  1582. },
  1583. //>>excludeStart("ide", pragmas.excludeIdeData);
  1584. args: ["anObject"],
  1585. source: "context: anObject\x0a\x09context := anObject",
  1586. referencedClasses: [],
  1587. //>>excludeEnd("ide");
  1588. messageSends: []
  1589. }),
  1590. $globals.ASTContextVar);
  1591. $core.addClass('ASTDebugger', $globals.Object, ['interpreter', 'context', 'result'], 'Compiler-Interpreter');
  1592. //>>excludeStart("ide", pragmas.excludeIdeData);
  1593. $globals.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from an `AIContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
  1594. //>>excludeEnd("ide");
  1595. $core.addMethod(
  1596. $core.method({
  1597. selector: "atEnd",
  1598. protocol: 'testing',
  1599. fn: function (){
  1600. var self=this;
  1601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1602. return $core.withContext(function($ctx1) {
  1603. //>>excludeEnd("ctx");
  1604. var $1,$2,$receiver;
  1605. $1=self._context();
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. $ctx1.sendIdx["context"]=1;
  1608. //>>excludeEnd("ctx");
  1609. if(($receiver = $1) == null || $receiver.isNil){
  1610. return true;
  1611. } else {
  1612. $1;
  1613. };
  1614. $2=$recv($recv(self._interpreter())._atEnd())._and_((function(){
  1615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1616. return $core.withContext(function($ctx2) {
  1617. //>>excludeEnd("ctx");
  1618. return $recv(self._context())._isTopContext();
  1619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1620. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1621. //>>excludeEnd("ctx");
  1622. }));
  1623. return $2;
  1624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1625. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},$globals.ASTDebugger)});
  1626. //>>excludeEnd("ctx");
  1627. },
  1628. //>>excludeStart("ide", pragmas.excludeIdeData);
  1629. args: [],
  1630. source: "atEnd\x09\x0a\x09self context ifNil: [ ^ true ].\x0a\x09\x0a\x09^ self interpreter atEnd and: [ \x0a\x09\x09self context isTopContext ]",
  1631. referencedClasses: [],
  1632. //>>excludeEnd("ide");
  1633. messageSends: ["ifNil:", "context", "and:", "atEnd", "interpreter", "isTopContext"]
  1634. }),
  1635. $globals.ASTDebugger);
  1636. $core.addMethod(
  1637. $core.method({
  1638. selector: "context",
  1639. protocol: 'accessing',
  1640. fn: function (){
  1641. var self=this;
  1642. var $1;
  1643. $1=self["@context"];
  1644. return $1;
  1645. },
  1646. //>>excludeStart("ide", pragmas.excludeIdeData);
  1647. args: [],
  1648. source: "context\x0a\x09^ context",
  1649. referencedClasses: [],
  1650. //>>excludeEnd("ide");
  1651. messageSends: []
  1652. }),
  1653. $globals.ASTDebugger);
  1654. $core.addMethod(
  1655. $core.method({
  1656. selector: "context:",
  1657. protocol: 'accessing',
  1658. fn: function (aContext){
  1659. var self=this;
  1660. self["@context"]=aContext;
  1661. return self;
  1662. },
  1663. //>>excludeStart("ide", pragmas.excludeIdeData);
  1664. args: ["aContext"],
  1665. source: "context: aContext\x0a\x09context := aContext",
  1666. referencedClasses: [],
  1667. //>>excludeEnd("ide");
  1668. messageSends: []
  1669. }),
  1670. $globals.ASTDebugger);
  1671. $core.addMethod(
  1672. $core.method({
  1673. selector: "flushInnerContexts",
  1674. protocol: 'actions',
  1675. fn: function (){
  1676. var self=this;
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. return $core.withContext(function($ctx1) {
  1679. //>>excludeEnd("ctx");
  1680. var $1,$receiver;
  1681. $1=self._context();
  1682. if(($receiver = $1) == null || $receiver.isNil){
  1683. $1;
  1684. } else {
  1685. var cxt;
  1686. cxt=$receiver;
  1687. $recv(cxt)._innerContext_(nil);
  1688. };
  1689. return self;
  1690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1691. }, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{},$globals.ASTDebugger)});
  1692. //>>excludeEnd("ctx");
  1693. },
  1694. //>>excludeStart("ide", pragmas.excludeIdeData);
  1695. args: [],
  1696. source: "flushInnerContexts\x0a\x09\x22When stepping, the inner contexts are not relevent anymore,\x0a\x09and can be flushed\x22\x0a\x09\x0a\x09self context ifNotNil: [ :cxt | \x0a\x09\x09cxt innerContext: nil ]",
  1697. referencedClasses: [],
  1698. //>>excludeEnd("ide");
  1699. messageSends: ["ifNotNil:", "context", "innerContext:"]
  1700. }),
  1701. $globals.ASTDebugger);
  1702. $core.addMethod(
  1703. $core.method({
  1704. selector: "interpreter",
  1705. protocol: 'accessing',
  1706. fn: function (){
  1707. var self=this;
  1708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1709. return $core.withContext(function($ctx1) {
  1710. //>>excludeEnd("ctx");
  1711. var $2,$1,$receiver;
  1712. $2=self._context();
  1713. if(($receiver = $2) == null || $receiver.isNil){
  1714. $1=$2;
  1715. } else {
  1716. var ctx;
  1717. ctx=$receiver;
  1718. $1=$recv(ctx)._interpreter();
  1719. };
  1720. return $1;
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},$globals.ASTDebugger)});
  1723. //>>excludeEnd("ctx");
  1724. },
  1725. //>>excludeStart("ide", pragmas.excludeIdeData);
  1726. args: [],
  1727. source: "interpreter\x0a\x09^ self context ifNotNil: [ :ctx | \x0a\x09\x09ctx interpreter ]",
  1728. referencedClasses: [],
  1729. //>>excludeEnd("ide");
  1730. messageSends: ["ifNotNil:", "context", "interpreter"]
  1731. }),
  1732. $globals.ASTDebugger);
  1733. $core.addMethod(
  1734. $core.method({
  1735. selector: "method",
  1736. protocol: 'accessing',
  1737. fn: function (){
  1738. var self=this;
  1739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1740. return $core.withContext(function($ctx1) {
  1741. //>>excludeEnd("ctx");
  1742. var $1;
  1743. $1=$recv(self._context())._method();
  1744. return $1;
  1745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1746. }, function($ctx1) {$ctx1.fill(self,"method",{},$globals.ASTDebugger)});
  1747. //>>excludeEnd("ctx");
  1748. },
  1749. //>>excludeStart("ide", pragmas.excludeIdeData);
  1750. args: [],
  1751. source: "method\x0a\x09^ self context method",
  1752. referencedClasses: [],
  1753. //>>excludeEnd("ide");
  1754. messageSends: ["method", "context"]
  1755. }),
  1756. $globals.ASTDebugger);
  1757. $core.addMethod(
  1758. $core.method({
  1759. selector: "node",
  1760. protocol: 'accessing',
  1761. fn: function (){
  1762. var self=this;
  1763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1764. return $core.withContext(function($ctx1) {
  1765. //>>excludeEnd("ctx");
  1766. var $2,$1,$receiver;
  1767. $2=self._interpreter();
  1768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1769. $ctx1.sendIdx["interpreter"]=1;
  1770. //>>excludeEnd("ctx");
  1771. if(($receiver = $2) == null || $receiver.isNil){
  1772. $1=$2;
  1773. } else {
  1774. $1=$recv(self._interpreter())._node();
  1775. };
  1776. return $1;
  1777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1778. }, function($ctx1) {$ctx1.fill(self,"node",{},$globals.ASTDebugger)});
  1779. //>>excludeEnd("ctx");
  1780. },
  1781. //>>excludeStart("ide", pragmas.excludeIdeData);
  1782. args: [],
  1783. source: "node\x0a\x09^ self interpreter ifNotNil: [\x0a\x09\x09self interpreter node ]",
  1784. referencedClasses: [],
  1785. //>>excludeEnd("ide");
  1786. messageSends: ["ifNotNil:", "interpreter", "node"]
  1787. }),
  1788. $globals.ASTDebugger);
  1789. $core.addMethod(
  1790. $core.method({
  1791. selector: "onStep",
  1792. protocol: 'private',
  1793. fn: function (){
  1794. var self=this;
  1795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1796. return $core.withContext(function($ctx1) {
  1797. //>>excludeEnd("ctx");
  1798. var $1,$3,$2,$4,$6,$5,$receiver;
  1799. $1=self._interpreter();
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. $ctx1.sendIdx["interpreter"]=1;
  1802. //>>excludeEnd("ctx");
  1803. self["@result"]=$recv($1)._result();
  1804. $3=self._interpreter();
  1805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1806. $ctx1.sendIdx["interpreter"]=2;
  1807. //>>excludeEnd("ctx");
  1808. $2=$recv($3)._atEnd();
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. $ctx1.sendIdx["atEnd"]=1;
  1811. //>>excludeEnd("ctx");
  1812. if($core.assert($2)){
  1813. $4=$recv(self._context())._outerContext();
  1814. if(($receiver = $4) == null || $receiver.isNil){
  1815. $4;
  1816. } else {
  1817. var outerContext;
  1818. outerContext=$receiver;
  1819. self._context_(outerContext);
  1820. };
  1821. $6=self._interpreter();
  1822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1823. $ctx1.sendIdx["interpreter"]=3;
  1824. //>>excludeEnd("ctx");
  1825. $5=$recv($6)._atEnd();
  1826. if(!$core.assert($5)){
  1827. $recv(self._interpreter())._skip();
  1828. };
  1829. };
  1830. self._flushInnerContexts();
  1831. return self;
  1832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1833. }, function($ctx1) {$ctx1.fill(self,"onStep",{},$globals.ASTDebugger)});
  1834. //>>excludeEnd("ctx");
  1835. },
  1836. //>>excludeStart("ide", pragmas.excludeIdeData);
  1837. args: [],
  1838. source: "onStep\x0a\x09\x22After each step, check if the interpreter is at the end,\x0a\x09and if it is move to its outer context if any, skipping its \x0a\x09current node (which was just evaluated by the current \x0a\x09interpreter).\x0a\x09\x0a\x09After each step we also flush inner contexts.\x22\x0a\x09\x0a\x09result := self interpreter result.\x0a\x09\x0a\x09self interpreter atEnd ifTrue: [\x0a\x09\x09self context outerContext ifNotNil: [ :outerContext | \x0a\x09\x09\x09self context: outerContext ].\x0a\x09\x09self interpreter atEnd ifFalse: [ self interpreter skip ] ].\x0a\x09\x09\x0a\x09self flushInnerContexts",
  1839. referencedClasses: [],
  1840. //>>excludeEnd("ide");
  1841. messageSends: ["result", "interpreter", "ifTrue:", "atEnd", "ifNotNil:", "outerContext", "context", "context:", "ifFalse:", "skip", "flushInnerContexts"]
  1842. }),
  1843. $globals.ASTDebugger);
  1844. $core.addMethod(
  1845. $core.method({
  1846. selector: "proceed",
  1847. protocol: 'stepping',
  1848. fn: function (){
  1849. var self=this;
  1850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1851. return $core.withContext(function($ctx1) {
  1852. //>>excludeEnd("ctx");
  1853. $recv((function(){
  1854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1855. return $core.withContext(function($ctx2) {
  1856. //>>excludeEnd("ctx");
  1857. return self._atEnd();
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1860. //>>excludeEnd("ctx");
  1861. }))._whileFalse_((function(){
  1862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1863. return $core.withContext(function($ctx2) {
  1864. //>>excludeEnd("ctx");
  1865. return self._stepOver();
  1866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1867. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1868. //>>excludeEnd("ctx");
  1869. }));
  1870. return self;
  1871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1872. }, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.ASTDebugger)});
  1873. //>>excludeEnd("ctx");
  1874. },
  1875. //>>excludeStart("ide", pragmas.excludeIdeData);
  1876. args: [],
  1877. source: "proceed\x0a\x09[ self atEnd ] whileFalse: [ self stepOver ]",
  1878. referencedClasses: [],
  1879. //>>excludeEnd("ide");
  1880. messageSends: ["whileFalse:", "atEnd", "stepOver"]
  1881. }),
  1882. $globals.ASTDebugger);
  1883. $core.addMethod(
  1884. $core.method({
  1885. selector: "restart",
  1886. protocol: 'stepping',
  1887. fn: function (){
  1888. var self=this;
  1889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1890. return $core.withContext(function($ctx1) {
  1891. //>>excludeEnd("ctx");
  1892. $recv(self._interpreter())._restart();
  1893. self._flushInnerContexts();
  1894. return self;
  1895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1896. }, function($ctx1) {$ctx1.fill(self,"restart",{},$globals.ASTDebugger)});
  1897. //>>excludeEnd("ctx");
  1898. },
  1899. //>>excludeStart("ide", pragmas.excludeIdeData);
  1900. args: [],
  1901. source: "restart\x0a\x09self interpreter restart.\x0a\x09self flushInnerContexts",
  1902. referencedClasses: [],
  1903. //>>excludeEnd("ide");
  1904. messageSends: ["restart", "interpreter", "flushInnerContexts"]
  1905. }),
  1906. $globals.ASTDebugger);
  1907. $core.addMethod(
  1908. $core.method({
  1909. selector: "result",
  1910. protocol: 'accessing',
  1911. fn: function (){
  1912. var self=this;
  1913. var $1;
  1914. $1=self["@result"];
  1915. return $1;
  1916. },
  1917. //>>excludeStart("ide", pragmas.excludeIdeData);
  1918. args: [],
  1919. source: "result\x0a\x09^ result",
  1920. referencedClasses: [],
  1921. //>>excludeEnd("ide");
  1922. messageSends: []
  1923. }),
  1924. $globals.ASTDebugger);
  1925. $core.addMethod(
  1926. $core.method({
  1927. selector: "stepInto",
  1928. protocol: 'stepping',
  1929. fn: function (){
  1930. var self=this;
  1931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1932. return $core.withContext(function($ctx1) {
  1933. //>>excludeEnd("ctx");
  1934. self._shouldBeImplemented();
  1935. return self;
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. }, function($ctx1) {$ctx1.fill(self,"stepInto",{},$globals.ASTDebugger)});
  1938. //>>excludeEnd("ctx");
  1939. },
  1940. //>>excludeStart("ide", pragmas.excludeIdeData);
  1941. args: [],
  1942. source: "stepInto\x0a\x09self shouldBeImplemented",
  1943. referencedClasses: [],
  1944. //>>excludeEnd("ide");
  1945. messageSends: ["shouldBeImplemented"]
  1946. }),
  1947. $globals.ASTDebugger);
  1948. $core.addMethod(
  1949. $core.method({
  1950. selector: "stepOver",
  1951. protocol: 'stepping',
  1952. fn: function (){
  1953. var self=this;
  1954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1955. return $core.withContext(function($ctx1) {
  1956. //>>excludeEnd("ctx");
  1957. var $1,$2;
  1958. $1=$recv(self._context())._isTopContext();
  1959. if($core.assert($1)){
  1960. $recv(self._interpreter())._stepOver();
  1961. } else {
  1962. $2=self._interpreter();
  1963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1964. $ctx1.sendIdx["interpreter"]=1;
  1965. //>>excludeEnd("ctx");
  1966. $recv($2)._skip();
  1967. };
  1968. self._onStep();
  1969. return self;
  1970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1971. }, function($ctx1) {$ctx1.fill(self,"stepOver",{},$globals.ASTDebugger)});
  1972. //>>excludeEnd("ctx");
  1973. },
  1974. //>>excludeStart("ide", pragmas.excludeIdeData);
  1975. args: [],
  1976. source: "stepOver\x0a\x09self context isTopContext \x0a\x09\x09ifFalse: [ self interpreter skip ]\x0a\x09\x09ifTrue: [ self interpreter stepOver ].\x0a\x09self onStep",
  1977. referencedClasses: [],
  1978. //>>excludeEnd("ide");
  1979. messageSends: ["ifFalse:ifTrue:", "isTopContext", "context", "skip", "interpreter", "stepOver", "onStep"]
  1980. }),
  1981. $globals.ASTDebugger);
  1982. $core.addMethod(
  1983. $core.method({
  1984. selector: "context:",
  1985. protocol: 'instance creation',
  1986. fn: function (aContext){
  1987. var self=this;
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. return $core.withContext(function($ctx1) {
  1990. //>>excludeEnd("ctx");
  1991. var $2,$3,$1;
  1992. $2=self._new();
  1993. $recv($2)._context_(aContext);
  1994. $3=$recv($2)._yourself();
  1995. $1=$3;
  1996. return $1;
  1997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1998. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},$globals.ASTDebugger.klass)});
  1999. //>>excludeEnd("ctx");
  2000. },
  2001. //>>excludeStart("ide", pragmas.excludeIdeData);
  2002. args: ["aContext"],
  2003. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09context: aContext;\x0a\x09\x09yourself",
  2004. referencedClasses: [],
  2005. //>>excludeEnd("ide");
  2006. messageSends: ["context:", "new", "yourself"]
  2007. }),
  2008. $globals.ASTDebugger.klass);
  2009. $core.addClass('ASTInterpreter', $globals.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned', 'forceAtEnd'], 'Compiler-Interpreter');
  2010. //>>excludeStart("ide", pragmas.excludeIdeData);
  2011. $globals.ASTInterpreter.comment="I visit an AST, interpreting (evaluating) nodes one after the other, using a small stack machine.\x0a\x0a## API\x0a\x0aWhile my instances should be used from within an `ASTDebugger`, which provides a more high level interface,\x0ayou can use methods from the `interpreting` protocol:\x0a\x0a- `#step` evaluates the current `node` only\x0a- `#stepOver` evaluates the AST from the current `node` up to the next stepping node (most likely the next send node)\x0a- `#proceed` evaluates eagerly the AST\x0a- `#restart` select the first node of the AST\x0a- `#skip` skips the current node, moving to the next one if any";
  2012. //>>excludeEnd("ide");
  2013. $core.addMethod(
  2014. $core.method({
  2015. selector: "assign:to:",
  2016. protocol: 'private',
  2017. fn: function (aNode,anObject){
  2018. var self=this;
  2019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2020. return $core.withContext(function($ctx1) {
  2021. //>>excludeEnd("ctx");
  2022. var $1,$3,$2,$4;
  2023. $1=$recv($recv(aNode)._binding())._isInstanceVar();
  2024. if($core.assert($1)){
  2025. $3=self._context();
  2026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2027. $ctx1.sendIdx["context"]=1;
  2028. //>>excludeEnd("ctx");
  2029. $2=$recv($3)._receiver();
  2030. $4=$recv(aNode)._value();
  2031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2032. $ctx1.sendIdx["value"]=1;
  2033. //>>excludeEnd("ctx");
  2034. $recv($2)._instVarAt_put_($4,anObject);
  2035. } else {
  2036. $recv(self._context())._localAt_put_($recv(aNode)._value(),anObject);
  2037. };
  2038. return self;
  2039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2040. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},$globals.ASTInterpreter)});
  2041. //>>excludeEnd("ctx");
  2042. },
  2043. //>>excludeStart("ide", pragmas.excludeIdeData);
  2044. args: ["aNode", "anObject"],
  2045. source: "assign: aNode to: anObject\x0a\x09aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  2046. referencedClasses: [],
  2047. //>>excludeEnd("ide");
  2048. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"]
  2049. }),
  2050. $globals.ASTInterpreter);
  2051. $core.addMethod(
  2052. $core.method({
  2053. selector: "atEnd",
  2054. protocol: 'testing',
  2055. fn: function (){
  2056. var self=this;
  2057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2058. return $core.withContext(function($ctx1) {
  2059. //>>excludeEnd("ctx");
  2060. var $1,$2;
  2061. $1=self["@forceAtEnd"];
  2062. if($core.assert($1)){
  2063. return true;
  2064. };
  2065. $2=$recv(self._hasReturned())._or_((function(){
  2066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2067. return $core.withContext(function($ctx2) {
  2068. //>>excludeEnd("ctx");
  2069. return $recv(self._node())._isNil();
  2070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2071. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2072. //>>excludeEnd("ctx");
  2073. }));
  2074. return $2;
  2075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2076. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},$globals.ASTInterpreter)});
  2077. //>>excludeEnd("ctx");
  2078. },
  2079. //>>excludeStart("ide", pragmas.excludeIdeData);
  2080. args: [],
  2081. source: "atEnd\x0a\x09forceAtEnd ifTrue: [ ^ true ].\x0a\x09\x0a\x09^ self hasReturned or: [ self node isNil ]",
  2082. referencedClasses: [],
  2083. //>>excludeEnd("ide");
  2084. messageSends: ["ifTrue:", "or:", "hasReturned", "isNil", "node"]
  2085. }),
  2086. $globals.ASTInterpreter);
  2087. $core.addMethod(
  2088. $core.method({
  2089. selector: "context",
  2090. protocol: 'accessing',
  2091. fn: function (){
  2092. var self=this;
  2093. var $1;
  2094. $1=self["@context"];
  2095. return $1;
  2096. },
  2097. //>>excludeStart("ide", pragmas.excludeIdeData);
  2098. args: [],
  2099. source: "context\x0a\x09^ context",
  2100. referencedClasses: [],
  2101. //>>excludeEnd("ide");
  2102. messageSends: []
  2103. }),
  2104. $globals.ASTInterpreter);
  2105. $core.addMethod(
  2106. $core.method({
  2107. selector: "context:",
  2108. protocol: 'accessing',
  2109. fn: function (aContext){
  2110. var self=this;
  2111. self["@context"]=aContext;
  2112. return self;
  2113. },
  2114. //>>excludeStart("ide", pragmas.excludeIdeData);
  2115. args: ["aContext"],
  2116. source: "context: aContext\x0a\x09context := aContext",
  2117. referencedClasses: [],
  2118. //>>excludeEnd("ide");
  2119. messageSends: []
  2120. }),
  2121. $globals.ASTInterpreter);
  2122. $core.addMethod(
  2123. $core.method({
  2124. selector: "eval:",
  2125. protocol: 'private',
  2126. fn: function (aString){
  2127. var self=this;
  2128. var source,function_;
  2129. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2130. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  2131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2132. return $core.withContext(function($ctx1) {
  2133. //>>excludeEnd("ctx");
  2134. var $3,$2,$1,$4,$5;
  2135. source=$recv($String())._streamContents_((function(str){
  2136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2137. return $core.withContext(function($ctx2) {
  2138. //>>excludeEnd("ctx");
  2139. $recv(str)._nextPutAll_("0,(function(");
  2140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2141. $ctx2.sendIdx["nextPutAll:"]=1;
  2142. //>>excludeEnd("ctx");
  2143. $3=self._context();
  2144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2145. $ctx2.sendIdx["context"]=1;
  2146. //>>excludeEnd("ctx");
  2147. $2=$recv($3)._locals();
  2148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2149. $ctx2.sendIdx["locals"]=1;
  2150. //>>excludeEnd("ctx");
  2151. $1=$recv($2)._keys();
  2152. $recv($1)._do_separatedBy_((function(each){
  2153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2154. return $core.withContext(function($ctx3) {
  2155. //>>excludeEnd("ctx");
  2156. return $recv(str)._nextPutAll_(each);
  2157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2158. $ctx3.sendIdx["nextPutAll:"]=2;
  2159. //>>excludeEnd("ctx");
  2160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2161. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  2162. //>>excludeEnd("ctx");
  2163. }),(function(){
  2164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2165. return $core.withContext(function($ctx3) {
  2166. //>>excludeEnd("ctx");
  2167. return $recv(str)._nextPutAll_(",");
  2168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2169. $ctx3.sendIdx["nextPutAll:"]=3;
  2170. //>>excludeEnd("ctx");
  2171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2172. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  2173. //>>excludeEnd("ctx");
  2174. }));
  2175. $recv(str)._nextPutAll_("){ return (function() {");
  2176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2177. $ctx2.sendIdx["nextPutAll:"]=4;
  2178. //>>excludeEnd("ctx");
  2179. $recv(str)._nextPutAll_(aString);
  2180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2181. $ctx2.sendIdx["nextPutAll:"]=5;
  2182. //>>excludeEnd("ctx");
  2183. $4=$recv(str)._nextPutAll_("})()})");
  2184. return $4;
  2185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2186. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  2187. //>>excludeEnd("ctx");
  2188. }));
  2189. function_=$recv($recv($Compiler())._new())._eval_(source);
  2190. $5=$recv(function_)._valueWithPossibleArguments_($recv($recv(self._context())._locals())._values());
  2191. return $5;
  2192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2193. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},$globals.ASTInterpreter)});
  2194. //>>excludeEnd("ctx");
  2195. },
  2196. //>>excludeStart("ide", pragmas.excludeIdeData);
  2197. args: ["aString"],
  2198. source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function.\x0a\x09aString is not sandboxed.\x22\x0a\x09\x0a\x09| source function |\x0a\x09\x0a\x09source := String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '0,(function('.\x0a\x09\x09self context locals keys\x0a\x09\x09\x09do: [ :each | str nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ str nextPutAll: ',' ].\x0a\x09\x09str\x0a\x09\x09\x09nextPutAll: '){ return (function() {';\x0a\x09\x09\x09nextPutAll: aString;\x0a\x09\x09\x09nextPutAll: '})()})' ].\x0a\x09\x09\x09\x0a\x09function := Compiler new eval: source.\x0a\x09\x0a\x09^ function valueWithPossibleArguments: self context locals values",
  2199. referencedClasses: ["String", "Compiler"],
  2200. //>>excludeEnd("ide");
  2201. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]
  2202. }),
  2203. $globals.ASTInterpreter);
  2204. $core.addMethod(
  2205. $core.method({
  2206. selector: "hasReturned",
  2207. protocol: 'testing',
  2208. fn: function (){
  2209. var self=this;
  2210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2211. return $core.withContext(function($ctx1) {
  2212. //>>excludeEnd("ctx");
  2213. var $2,$1,$receiver;
  2214. $2=self["@returned"];
  2215. if(($receiver = $2) == null || $receiver.isNil){
  2216. $1=false;
  2217. } else {
  2218. $1=$2;
  2219. };
  2220. return $1;
  2221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2222. }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},$globals.ASTInterpreter)});
  2223. //>>excludeEnd("ctx");
  2224. },
  2225. //>>excludeStart("ide", pragmas.excludeIdeData);
  2226. args: [],
  2227. source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
  2228. referencedClasses: [],
  2229. //>>excludeEnd("ide");
  2230. messageSends: ["ifNil:"]
  2231. }),
  2232. $globals.ASTInterpreter);
  2233. $core.addMethod(
  2234. $core.method({
  2235. selector: "initialize",
  2236. protocol: 'initialization',
  2237. fn: function (){
  2238. var self=this;
  2239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2240. return $core.withContext(function($ctx1) {
  2241. //>>excludeEnd("ctx");
  2242. (
  2243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2244. $ctx1.supercall = true,
  2245. //>>excludeEnd("ctx");
  2246. $globals.ASTInterpreter.superclass.fn.prototype._initialize.apply($recv(self), []));
  2247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2248. $ctx1.supercall = false;
  2249. //>>excludeEnd("ctx");;
  2250. self["@forceAtEnd"]=false;
  2251. return self;
  2252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2253. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ASTInterpreter)});
  2254. //>>excludeEnd("ctx");
  2255. },
  2256. //>>excludeStart("ide", pragmas.excludeIdeData);
  2257. args: [],
  2258. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09forceAtEnd := false",
  2259. referencedClasses: [],
  2260. //>>excludeEnd("ide");
  2261. messageSends: ["initialize"]
  2262. }),
  2263. $globals.ASTInterpreter);
  2264. $core.addMethod(
  2265. $core.method({
  2266. selector: "interpret",
  2267. protocol: 'interpreting',
  2268. fn: function (){
  2269. var self=this;
  2270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2271. return $core.withContext(function($ctx1) {
  2272. //>>excludeEnd("ctx");
  2273. self._visit_(self._node());
  2274. return self;
  2275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2276. }, function($ctx1) {$ctx1.fill(self,"interpret",{},$globals.ASTInterpreter)});
  2277. //>>excludeEnd("ctx");
  2278. },
  2279. //>>excludeStart("ide", pragmas.excludeIdeData);
  2280. args: [],
  2281. source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
  2282. referencedClasses: [],
  2283. //>>excludeEnd("ide");
  2284. messageSends: ["visit:", "node"]
  2285. }),
  2286. $globals.ASTInterpreter);
  2287. $core.addMethod(
  2288. $core.method({
  2289. selector: "interpret:",
  2290. protocol: 'interpreting',
  2291. fn: function (aNode){
  2292. var self=this;
  2293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2294. return $core.withContext(function($ctx1) {
  2295. //>>excludeEnd("ctx");
  2296. self._node_(aNode);
  2297. self._interpret();
  2298. return self;
  2299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2300. }, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},$globals.ASTInterpreter)});
  2301. //>>excludeEnd("ctx");
  2302. },
  2303. //>>excludeStart("ide", pragmas.excludeIdeData);
  2304. args: ["aNode"],
  2305. source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
  2306. referencedClasses: [],
  2307. //>>excludeEnd("ide");
  2308. messageSends: ["node:", "interpret"]
  2309. }),
  2310. $globals.ASTInterpreter);
  2311. $core.addMethod(
  2312. $core.method({
  2313. selector: "messageFromSendNode:arguments:",
  2314. protocol: 'private',
  2315. fn: function (aSendNode,aCollection){
  2316. var self=this;
  2317. function $Message(){return $globals.Message||(typeof Message=="undefined"?nil:Message)}
  2318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2319. return $core.withContext(function($ctx1) {
  2320. //>>excludeEnd("ctx");
  2321. var $2,$3,$1;
  2322. $2=$recv($Message())._new();
  2323. $recv($2)._selector_($recv(aSendNode)._selector());
  2324. $recv($2)._arguments_(aCollection);
  2325. $3=$recv($2)._yourself();
  2326. $1=$3;
  2327. return $1;
  2328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2329. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},$globals.ASTInterpreter)});
  2330. //>>excludeEnd("ctx");
  2331. },
  2332. //>>excludeStart("ide", pragmas.excludeIdeData);
  2333. args: ["aSendNode", "aCollection"],
  2334. source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
  2335. referencedClasses: ["Message"],
  2336. //>>excludeEnd("ide");
  2337. messageSends: ["selector:", "new", "selector", "arguments:", "yourself"]
  2338. }),
  2339. $globals.ASTInterpreter);
  2340. $core.addMethod(
  2341. $core.method({
  2342. selector: "messageNotUnderstood:receiver:",
  2343. protocol: 'private',
  2344. fn: function (aMessage,anObject){
  2345. var self=this;
  2346. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  2347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2348. return $core.withContext(function($ctx1) {
  2349. //>>excludeEnd("ctx");
  2350. var $1,$2;
  2351. $1=$recv($MessageNotUnderstood())._new();
  2352. $recv($1)._meesage_(aMessage);
  2353. $recv($1)._receiver_(anObject);
  2354. $2=$recv($1)._signal();
  2355. return self;
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. }, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},$globals.ASTInterpreter)});
  2358. //>>excludeEnd("ctx");
  2359. },
  2360. //>>excludeStart("ide", pragmas.excludeIdeData);
  2361. args: ["aMessage", "anObject"],
  2362. source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
  2363. referencedClasses: ["MessageNotUnderstood"],
  2364. //>>excludeEnd("ide");
  2365. messageSends: ["meesage:", "new", "receiver:", "signal"]
  2366. }),
  2367. $globals.ASTInterpreter);
  2368. $core.addMethod(
  2369. $core.method({
  2370. selector: "next",
  2371. protocol: 'interpreting',
  2372. fn: function (){
  2373. var self=this;
  2374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2375. return $core.withContext(function($ctx1) {
  2376. //>>excludeEnd("ctx");
  2377. self._node_($recv(self._node())._nextNode());
  2378. return self;
  2379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2380. }, function($ctx1) {$ctx1.fill(self,"next",{},$globals.ASTInterpreter)});
  2381. //>>excludeEnd("ctx");
  2382. },
  2383. //>>excludeStart("ide", pragmas.excludeIdeData);
  2384. args: [],
  2385. source: "next\x0a\x09self node: self node nextNode",
  2386. referencedClasses: [],
  2387. //>>excludeEnd("ide");
  2388. messageSends: ["node:", "nextNode", "node"]
  2389. }),
  2390. $globals.ASTInterpreter);
  2391. $core.addMethod(
  2392. $core.method({
  2393. selector: "node",
  2394. protocol: 'accessing',
  2395. fn: function (){
  2396. var self=this;
  2397. var $1;
  2398. $1=self["@node"];
  2399. return $1;
  2400. },
  2401. //>>excludeStart("ide", pragmas.excludeIdeData);
  2402. args: [],
  2403. source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
  2404. referencedClasses: [],
  2405. //>>excludeEnd("ide");
  2406. messageSends: []
  2407. }),
  2408. $globals.ASTInterpreter);
  2409. $core.addMethod(
  2410. $core.method({
  2411. selector: "node:",
  2412. protocol: 'accessing',
  2413. fn: function (aNode){
  2414. var self=this;
  2415. self["@node"]=aNode;
  2416. return self;
  2417. },
  2418. //>>excludeStart("ide", pragmas.excludeIdeData);
  2419. args: ["aNode"],
  2420. source: "node: aNode\x0a\x09node := aNode",
  2421. referencedClasses: [],
  2422. //>>excludeEnd("ide");
  2423. messageSends: []
  2424. }),
  2425. $globals.ASTInterpreter);
  2426. $core.addMethod(
  2427. $core.method({
  2428. selector: "peek",
  2429. protocol: 'stack',
  2430. fn: function (){
  2431. var self=this;
  2432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2433. return $core.withContext(function($ctx1) {
  2434. //>>excludeEnd("ctx");
  2435. var $1,$2;
  2436. var $early={};
  2437. try {
  2438. $1=self._stack();
  2439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2440. $ctx1.sendIdx["stack"]=1;
  2441. //>>excludeEnd("ctx");
  2442. $recv($1)._ifEmpty_((function(){
  2443. throw $early=[nil];
  2444. }));
  2445. $2=$recv(self._stack())._last();
  2446. return $2;
  2447. }
  2448. catch(e) {if(e===$early)return e[0]; throw e}
  2449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2450. }, function($ctx1) {$ctx1.fill(self,"peek",{},$globals.ASTInterpreter)});
  2451. //>>excludeEnd("ctx");
  2452. },
  2453. //>>excludeStart("ide", pragmas.excludeIdeData);
  2454. args: [],
  2455. source: "peek\x0a\x09\x22Peek the top object of the context stack\x22\x0a\x09\x0a\x09self stack ifEmpty: [ ^ nil ].\x0a\x09\x0a\x09^ self stack last",
  2456. referencedClasses: [],
  2457. //>>excludeEnd("ide");
  2458. messageSends: ["ifEmpty:", "stack", "last"]
  2459. }),
  2460. $globals.ASTInterpreter);
  2461. $core.addMethod(
  2462. $core.method({
  2463. selector: "pop",
  2464. protocol: 'stack',
  2465. fn: function (){
  2466. var self=this;
  2467. var peekedValue;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. return $core.withContext(function($ctx1) {
  2470. //>>excludeEnd("ctx");
  2471. var $1;
  2472. peekedValue=self._peek();
  2473. $recv(self._stack())._removeLast();
  2474. $1=peekedValue;
  2475. return $1;
  2476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2477. }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},$globals.ASTInterpreter)});
  2478. //>>excludeEnd("ctx");
  2479. },
  2480. //>>excludeStart("ide", pragmas.excludeIdeData);
  2481. args: [],
  2482. source: "pop\x0a\x09\x22Pop an object from the context stack\x22\x0a\x09\x0a\x09| peekedValue |\x0a\x09\x0a\x09peekedValue := self peek.\x0a\x09self stack removeLast.\x0a\x09^ peekedValue",
  2483. referencedClasses: [],
  2484. //>>excludeEnd("ide");
  2485. messageSends: ["peek", "removeLast", "stack"]
  2486. }),
  2487. $globals.ASTInterpreter);
  2488. $core.addMethod(
  2489. $core.method({
  2490. selector: "proceed",
  2491. protocol: 'interpreting',
  2492. fn: function (){
  2493. var self=this;
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. return $core.withContext(function($ctx1) {
  2496. //>>excludeEnd("ctx");
  2497. $recv((function(){
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. return $core.withContext(function($ctx2) {
  2500. //>>excludeEnd("ctx");
  2501. return self._atEnd();
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2504. //>>excludeEnd("ctx");
  2505. }))._whileFalse_((function(){
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. return $core.withContext(function($ctx2) {
  2508. //>>excludeEnd("ctx");
  2509. return self._step();
  2510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2511. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2512. //>>excludeEnd("ctx");
  2513. }));
  2514. return self;
  2515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2516. }, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.ASTInterpreter)});
  2517. //>>excludeEnd("ctx");
  2518. },
  2519. //>>excludeStart("ide", pragmas.excludeIdeData);
  2520. args: [],
  2521. source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] \x0a\x09\x09whileFalse: [ self step ]",
  2522. referencedClasses: [],
  2523. //>>excludeEnd("ide");
  2524. messageSends: ["whileFalse:", "atEnd", "step"]
  2525. }),
  2526. $globals.ASTInterpreter);
  2527. $core.addMethod(
  2528. $core.method({
  2529. selector: "push:",
  2530. protocol: 'stack',
  2531. fn: function (anObject){
  2532. var self=this;
  2533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2534. return $core.withContext(function($ctx1) {
  2535. //>>excludeEnd("ctx");
  2536. var $1;
  2537. $1=$recv(self._stack())._add_(anObject);
  2538. return $1;
  2539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2540. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},$globals.ASTInterpreter)});
  2541. //>>excludeEnd("ctx");
  2542. },
  2543. //>>excludeStart("ide", pragmas.excludeIdeData);
  2544. args: ["anObject"],
  2545. source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
  2546. referencedClasses: [],
  2547. //>>excludeEnd("ide");
  2548. messageSends: ["add:", "stack"]
  2549. }),
  2550. $globals.ASTInterpreter);
  2551. $core.addMethod(
  2552. $core.method({
  2553. selector: "restart",
  2554. protocol: 'interpreting',
  2555. fn: function (){
  2556. var self=this;
  2557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2558. return $core.withContext(function($ctx1) {
  2559. //>>excludeEnd("ctx");
  2560. self._node_($recv($recv(self._context())._ast())._nextChild());
  2561. return self;
  2562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2563. }, function($ctx1) {$ctx1.fill(self,"restart",{},$globals.ASTInterpreter)});
  2564. //>>excludeEnd("ctx");
  2565. },
  2566. //>>excludeStart("ide", pragmas.excludeIdeData);
  2567. args: [],
  2568. source: "restart\x0a\x09self node: self context ast nextChild",
  2569. referencedClasses: [],
  2570. //>>excludeEnd("ide");
  2571. messageSends: ["node:", "nextChild", "ast", "context"]
  2572. }),
  2573. $globals.ASTInterpreter);
  2574. $core.addMethod(
  2575. $core.method({
  2576. selector: "result",
  2577. protocol: 'accessing',
  2578. fn: function (){
  2579. var self=this;
  2580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2581. return $core.withContext(function($ctx1) {
  2582. //>>excludeEnd("ctx");
  2583. var $2,$1;
  2584. $2=self._hasReturned();
  2585. if($core.assert($2)){
  2586. $1=self._returnValue();
  2587. } else {
  2588. $1=$recv(self._context())._receiver();
  2589. };
  2590. return $1;
  2591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2592. }, function($ctx1) {$ctx1.fill(self,"result",{},$globals.ASTInterpreter)});
  2593. //>>excludeEnd("ctx");
  2594. },
  2595. //>>excludeStart("ide", pragmas.excludeIdeData);
  2596. args: [],
  2597. source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
  2598. referencedClasses: [],
  2599. //>>excludeEnd("ide");
  2600. messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"]
  2601. }),
  2602. $globals.ASTInterpreter);
  2603. $core.addMethod(
  2604. $core.method({
  2605. selector: "returnValue",
  2606. protocol: 'accessing',
  2607. fn: function (){
  2608. var self=this;
  2609. var $1;
  2610. $1=self["@returnValue"];
  2611. return $1;
  2612. },
  2613. //>>excludeStart("ide", pragmas.excludeIdeData);
  2614. args: [],
  2615. source: "returnValue\x0a\x09^ returnValue",
  2616. referencedClasses: [],
  2617. //>>excludeEnd("ide");
  2618. messageSends: []
  2619. }),
  2620. $globals.ASTInterpreter);
  2621. $core.addMethod(
  2622. $core.method({
  2623. selector: "returnValue:",
  2624. protocol: 'accessing',
  2625. fn: function (anObject){
  2626. var self=this;
  2627. self["@returnValue"]=anObject;
  2628. return self;
  2629. },
  2630. //>>excludeStart("ide", pragmas.excludeIdeData);
  2631. args: ["anObject"],
  2632. source: "returnValue: anObject\x0a\x09returnValue := anObject",
  2633. referencedClasses: [],
  2634. //>>excludeEnd("ide");
  2635. messageSends: []
  2636. }),
  2637. $globals.ASTInterpreter);
  2638. $core.addMethod(
  2639. $core.method({
  2640. selector: "sendMessage:to:superSend:",
  2641. protocol: 'private',
  2642. fn: function (aMessage,anObject,aBoolean){
  2643. var self=this;
  2644. var method;
  2645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2646. return $core.withContext(function($ctx1) {
  2647. //>>excludeEnd("ctx");
  2648. var $1,$3,$2,$4,$5,$6,$receiver;
  2649. var $early={};
  2650. try {
  2651. if(!$core.assert(aBoolean)){
  2652. $1=$recv(aMessage)._sendTo_(anObject);
  2653. return $1;
  2654. };
  2655. $3=$recv(anObject)._class();
  2656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2657. $ctx1.sendIdx["class"]=1;
  2658. //>>excludeEnd("ctx");
  2659. $2=$recv($3)._superclass();
  2660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2661. $ctx1.sendIdx["superclass"]=1;
  2662. //>>excludeEnd("ctx");
  2663. if(($receiver = $2) == null || $receiver.isNil){
  2664. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  2665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2666. $ctx1.sendIdx["messageNotUnderstood:receiver:"]=1;
  2667. //>>excludeEnd("ctx");
  2668. return $4;
  2669. } else {
  2670. $2;
  2671. };
  2672. method=$recv($recv($recv($recv(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_($recv(aMessage)._selector(),(function(){
  2673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2674. return $core.withContext(function($ctx2) {
  2675. //>>excludeEnd("ctx");
  2676. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  2677. throw $early=[$5];
  2678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2679. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  2680. //>>excludeEnd("ctx");
  2681. }));
  2682. $6=$recv(method)._sendTo_arguments_(anObject,$recv(aMessage)._arguments());
  2683. return $6;
  2684. }
  2685. catch(e) {if(e===$early)return e[0]; throw e}
  2686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2687. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},$globals.ASTInterpreter)});
  2688. //>>excludeEnd("ctx");
  2689. },
  2690. //>>excludeStart("ide", pragmas.excludeIdeData);
  2691. args: ["aMessage", "anObject", "aBoolean"],
  2692. source: "sendMessage: aMessage to: anObject superSend: aBoolean\x0a\x09| method |\x0a\x09\x0a\x09aBoolean ifFalse: [ ^ aMessage sendTo: anObject ].\x0a\x09anObject class superclass ifNil: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x0a\x09method := anObject class superclass methodDictionary\x0a\x09\x09at: aMessage selector\x0a\x09\x09ifAbsent: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x09\x0a\x09^ method sendTo: anObject arguments: aMessage arguments",
  2693. referencedClasses: [],
  2694. //>>excludeEnd("ide");
  2695. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"]
  2696. }),
  2697. $globals.ASTInterpreter);
  2698. $core.addMethod(
  2699. $core.method({
  2700. selector: "setNonLocalReturnFromContext:",
  2701. protocol: 'interpreting',
  2702. fn: function (aContext){
  2703. var self=this;
  2704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2705. return $core.withContext(function($ctx1) {
  2706. //>>excludeEnd("ctx");
  2707. var $2,$1;
  2708. $2=$recv(aContext)._interpreter();
  2709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2710. $ctx1.sendIdx["interpreter"]=1;
  2711. //>>excludeEnd("ctx");
  2712. $1=$recv($2)._hasReturned();
  2713. if($core.assert($1)){
  2714. self["@returned"]=true;
  2715. self["@returned"];
  2716. self._returnValue_($recv($recv(aContext)._interpreter())._returnValue());
  2717. };
  2718. return self;
  2719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2720. }, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},$globals.ASTInterpreter)});
  2721. //>>excludeEnd("ctx");
  2722. },
  2723. //>>excludeStart("ide", pragmas.excludeIdeData);
  2724. args: ["aContext"],
  2725. source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
  2726. referencedClasses: [],
  2727. //>>excludeEnd("ide");
  2728. messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"]
  2729. }),
  2730. $globals.ASTInterpreter);
  2731. $core.addMethod(
  2732. $core.method({
  2733. selector: "skip",
  2734. protocol: 'interpreting',
  2735. fn: function (){
  2736. var self=this;
  2737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2738. return $core.withContext(function($ctx1) {
  2739. //>>excludeEnd("ctx");
  2740. self._next();
  2741. return self;
  2742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2743. }, function($ctx1) {$ctx1.fill(self,"skip",{},$globals.ASTInterpreter)});
  2744. //>>excludeEnd("ctx");
  2745. },
  2746. //>>excludeStart("ide", pragmas.excludeIdeData);
  2747. args: [],
  2748. source: "skip\x0a\x09self next",
  2749. referencedClasses: [],
  2750. //>>excludeEnd("ide");
  2751. messageSends: ["next"]
  2752. }),
  2753. $globals.ASTInterpreter);
  2754. $core.addMethod(
  2755. $core.method({
  2756. selector: "stack",
  2757. protocol: 'accessing',
  2758. fn: function (){
  2759. var self=this;
  2760. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  2761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2762. return $core.withContext(function($ctx1) {
  2763. //>>excludeEnd("ctx");
  2764. var $2,$1,$receiver;
  2765. $2=self["@stack"];
  2766. if(($receiver = $2) == null || $receiver.isNil){
  2767. self["@stack"]=$recv($OrderedCollection())._new();
  2768. $1=self["@stack"];
  2769. } else {
  2770. $1=$2;
  2771. };
  2772. return $1;
  2773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2774. }, function($ctx1) {$ctx1.fill(self,"stack",{},$globals.ASTInterpreter)});
  2775. //>>excludeEnd("ctx");
  2776. },
  2777. //>>excludeStart("ide", pragmas.excludeIdeData);
  2778. args: [],
  2779. source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
  2780. referencedClasses: ["OrderedCollection"],
  2781. //>>excludeEnd("ide");
  2782. messageSends: ["ifNil:", "new"]
  2783. }),
  2784. $globals.ASTInterpreter);
  2785. $core.addMethod(
  2786. $core.method({
  2787. selector: "step",
  2788. protocol: 'interpreting',
  2789. fn: function (){
  2790. var self=this;
  2791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2792. return $core.withContext(function($ctx1) {
  2793. //>>excludeEnd("ctx");
  2794. var $1;
  2795. self._interpret();
  2796. $1=self._next();
  2797. return self;
  2798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2799. }, function($ctx1) {$ctx1.fill(self,"step",{},$globals.ASTInterpreter)});
  2800. //>>excludeEnd("ctx");
  2801. },
  2802. //>>excludeStart("ide", pragmas.excludeIdeData);
  2803. args: [],
  2804. source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
  2805. referencedClasses: [],
  2806. //>>excludeEnd("ide");
  2807. messageSends: ["interpret", "next"]
  2808. }),
  2809. $globals.ASTInterpreter);
  2810. $core.addMethod(
  2811. $core.method({
  2812. selector: "stepOver",
  2813. protocol: 'interpreting',
  2814. fn: function (){
  2815. var self=this;
  2816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2817. return $core.withContext(function($ctx1) {
  2818. //>>excludeEnd("ctx");
  2819. var $2,$1;
  2820. self._step();
  2821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2822. $ctx1.sendIdx["step"]=1;
  2823. //>>excludeEnd("ctx");
  2824. $recv((function(){
  2825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2826. return $core.withContext(function($ctx2) {
  2827. //>>excludeEnd("ctx");
  2828. $2=self._node();
  2829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2830. $ctx2.sendIdx["node"]=1;
  2831. //>>excludeEnd("ctx");
  2832. $1=$recv($2)._isNil();
  2833. return $recv($1)._or_((function(){
  2834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2835. return $core.withContext(function($ctx3) {
  2836. //>>excludeEnd("ctx");
  2837. return $recv(self._node())._isSteppingNode();
  2838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2839. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  2840. //>>excludeEnd("ctx");
  2841. }));
  2842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2843. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2844. //>>excludeEnd("ctx");
  2845. }))._whileFalse_((function(){
  2846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2847. return $core.withContext(function($ctx2) {
  2848. //>>excludeEnd("ctx");
  2849. return self._step();
  2850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2851. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  2852. //>>excludeEnd("ctx");
  2853. }));
  2854. return self;
  2855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2856. }, function($ctx1) {$ctx1.fill(self,"stepOver",{},$globals.ASTInterpreter)});
  2857. //>>excludeEnd("ctx");
  2858. },
  2859. //>>excludeStart("ide", pragmas.excludeIdeData);
  2860. args: [],
  2861. source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isNil or: [ self node isSteppingNode ] ] whileFalse: [ \x0a\x09\x09self step ]",
  2862. referencedClasses: [],
  2863. //>>excludeEnd("ide");
  2864. messageSends: ["step", "whileFalse:", "or:", "isNil", "node", "isSteppingNode"]
  2865. }),
  2866. $globals.ASTInterpreter);
  2867. $core.addMethod(
  2868. $core.method({
  2869. selector: "visit:",
  2870. protocol: 'visiting',
  2871. fn: function (aNode){
  2872. var self=this;
  2873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2874. return $core.withContext(function($ctx1) {
  2875. //>>excludeEnd("ctx");
  2876. var $1;
  2877. $1=self._hasReturned();
  2878. if(!$core.assert($1)){
  2879. (
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. $ctx1.supercall = true,
  2882. //>>excludeEnd("ctx");
  2883. $globals.ASTInterpreter.superclass.fn.prototype._visit_.apply($recv(self), [aNode]));
  2884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2885. $ctx1.supercall = false;
  2886. //>>excludeEnd("ctx");;
  2887. };
  2888. return self;
  2889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2890. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},$globals.ASTInterpreter)});
  2891. //>>excludeEnd("ctx");
  2892. },
  2893. //>>excludeStart("ide", pragmas.excludeIdeData);
  2894. args: ["aNode"],
  2895. source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
  2896. referencedClasses: [],
  2897. //>>excludeEnd("ide");
  2898. messageSends: ["ifFalse:", "hasReturned", "visit:"]
  2899. }),
  2900. $globals.ASTInterpreter);
  2901. $core.addMethod(
  2902. $core.method({
  2903. selector: "visitAssignmentNode:",
  2904. protocol: 'visiting',
  2905. fn: function (aNode){
  2906. var self=this;
  2907. var poppedValue;
  2908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2909. return $core.withContext(function($ctx1) {
  2910. //>>excludeEnd("ctx");
  2911. poppedValue=self._pop();
  2912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2913. $ctx1.sendIdx["pop"]=1;
  2914. //>>excludeEnd("ctx");
  2915. self._pop();
  2916. self._push_(poppedValue);
  2917. self._assign_to_($recv(aNode)._left(),poppedValue);
  2918. return self;
  2919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2920. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},$globals.ASTInterpreter)});
  2921. //>>excludeEnd("ctx");
  2922. },
  2923. //>>excludeStart("ide", pragmas.excludeIdeData);
  2924. args: ["aNode"],
  2925. source: "visitAssignmentNode: aNode\x0a\x09| poppedValue |\x0a\x09\x0a\x09poppedValue := self pop.\x0a\x09\x0a\x09\x22Pop the left side of the assignment.\x0a\x09It already has been visited, and we don't need its value.\x22\x0a\x09self pop.\x0a\x09\x0a\x09self push: poppedValue.\x0a\x09self assign: aNode left to: poppedValue",
  2926. referencedClasses: [],
  2927. //>>excludeEnd("ide");
  2928. messageSends: ["pop", "push:", "assign:to:", "left"]
  2929. }),
  2930. $globals.ASTInterpreter);
  2931. $core.addMethod(
  2932. $core.method({
  2933. selector: "visitBlockNode:",
  2934. protocol: 'visiting',
  2935. fn: function (aNode){
  2936. var self=this;
  2937. var block;
  2938. function $AIBlockClosure(){return $globals.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
  2939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2940. return $core.withContext(function($ctx1) {
  2941. //>>excludeEnd("ctx");
  2942. block=$recv($AIBlockClosure())._forContext_node_(self._context(),aNode);
  2943. self._push_(block);
  2944. return self;
  2945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2946. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},$globals.ASTInterpreter)});
  2947. //>>excludeEnd("ctx");
  2948. },
  2949. //>>excludeStart("ide", pragmas.excludeIdeData);
  2950. args: ["aNode"],
  2951. source: "visitBlockNode: aNode\x0a\x09\x22Do not evaluate the block node.\x0a\x09Instead, put all instructions into a block that we push to the stack for later evaluation\x22\x0a\x09\x0a\x09| block |\x0a\x09\x0a\x09block := AIBlockClosure forContext: self context node: aNode.\x0a\x09\x0a\x09self push: block",
  2952. referencedClasses: ["AIBlockClosure"],
  2953. //>>excludeEnd("ide");
  2954. messageSends: ["forContext:node:", "context", "push:"]
  2955. }),
  2956. $globals.ASTInterpreter);
  2957. $core.addMethod(
  2958. $core.method({
  2959. selector: "visitBlockSequenceNode:",
  2960. protocol: 'visiting',
  2961. fn: function (aNode){
  2962. var self=this;
  2963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2964. return $core.withContext(function($ctx1) {
  2965. //>>excludeEnd("ctx");
  2966. (
  2967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2968. $ctx1.supercall = true,
  2969. //>>excludeEnd("ctx");
  2970. $globals.ASTInterpreter.superclass.fn.prototype._visitBlockSequenceNode_.apply($recv(self), [aNode]));
  2971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2972. $ctx1.supercall = false;
  2973. //>>excludeEnd("ctx");;
  2974. self["@forceAtEnd"]=true;
  2975. return self;
  2976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2977. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},$globals.ASTInterpreter)});
  2978. //>>excludeEnd("ctx");
  2979. },
  2980. //>>excludeStart("ide", pragmas.excludeIdeData);
  2981. args: ["aNode"],
  2982. source: "visitBlockSequenceNode: aNode\x0a\x09\x22If the receiver is actually visiting a BlockSequenceNode,\x0a\x09it means the the context is a block context. Evaluation should \x0a\x09stop right after evaluating the block sequence and the outer\x0a\x09context's interpreter should take over. \x0a\x09Therefore we force #atEnd.\x22\x0a\x09\x0a\x09super visitBlockSequenceNode: aNode.\x0a\x09forceAtEnd := true",
  2983. referencedClasses: [],
  2984. //>>excludeEnd("ide");
  2985. messageSends: ["visitBlockSequenceNode:"]
  2986. }),
  2987. $globals.ASTInterpreter);
  2988. $core.addMethod(
  2989. $core.method({
  2990. selector: "visitDynamicArrayNode:",
  2991. protocol: 'visiting',
  2992. fn: function (aNode){
  2993. var self=this;
  2994. var array;
  2995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2996. return $core.withContext(function($ctx1) {
  2997. //>>excludeEnd("ctx");
  2998. array=[];
  2999. $recv($recv(aNode)._nodes())._do_((function(each){
  3000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3001. return $core.withContext(function($ctx2) {
  3002. //>>excludeEnd("ctx");
  3003. return $recv(array)._addFirst_(self._pop());
  3004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3005. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3006. //>>excludeEnd("ctx");
  3007. }));
  3008. self._push_(array);
  3009. return self;
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},$globals.ASTInterpreter)});
  3012. //>>excludeEnd("ctx");
  3013. },
  3014. //>>excludeStart("ide", pragmas.excludeIdeData);
  3015. args: ["aNode"],
  3016. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09\x0a\x09array := #().\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09array addFirst: self pop ].\x0a\x09\x0a\x09self push: array",
  3017. referencedClasses: [],
  3018. //>>excludeEnd("ide");
  3019. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"]
  3020. }),
  3021. $globals.ASTInterpreter);
  3022. $core.addMethod(
  3023. $core.method({
  3024. selector: "visitDynamicDictionaryNode:",
  3025. protocol: 'visiting',
  3026. fn: function (aNode){
  3027. var self=this;
  3028. var keyValueList;
  3029. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3030. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  3031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3032. return $core.withContext(function($ctx1) {
  3033. //>>excludeEnd("ctx");
  3034. keyValueList=$recv($OrderedCollection())._new();
  3035. $recv($recv(aNode)._nodes())._do_((function(each){
  3036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3037. return $core.withContext(function($ctx2) {
  3038. //>>excludeEnd("ctx");
  3039. return $recv(keyValueList)._add_(self._pop());
  3040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3041. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3042. //>>excludeEnd("ctx");
  3043. }));
  3044. self._push_($recv($HashedCollection())._newFromPairs_($recv(keyValueList)._reversed()));
  3045. return self;
  3046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3047. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,keyValueList:keyValueList},$globals.ASTInterpreter)});
  3048. //>>excludeEnd("ctx");
  3049. },
  3050. //>>excludeStart("ide", pragmas.excludeIdeData);
  3051. args: ["aNode"],
  3052. source: "visitDynamicDictionaryNode: aNode\x0a\x09| keyValueList |\x0a\x09\x0a\x09keyValueList := OrderedCollection new.\x0a\x09\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09keyValueList add: self pop ].\x0a\x09\x0a\x09self push: (HashedCollection newFromPairs: keyValueList reversed)",
  3053. referencedClasses: ["OrderedCollection", "HashedCollection"],
  3054. //>>excludeEnd("ide");
  3055. messageSends: ["new", "do:", "nodes", "add:", "pop", "push:", "newFromPairs:", "reversed"]
  3056. }),
  3057. $globals.ASTInterpreter);
  3058. $core.addMethod(
  3059. $core.method({
  3060. selector: "visitJSStatementNode:",
  3061. protocol: 'visiting',
  3062. fn: function (aNode){
  3063. var self=this;
  3064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3065. return $core.withContext(function($ctx1) {
  3066. //>>excludeEnd("ctx");
  3067. self["@returned"]=true;
  3068. self._returnValue_(self._eval_($recv(aNode)._source()));
  3069. return self;
  3070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3071. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},$globals.ASTInterpreter)});
  3072. //>>excludeEnd("ctx");
  3073. },
  3074. //>>excludeStart("ide", pragmas.excludeIdeData);
  3075. args: ["aNode"],
  3076. source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
  3077. referencedClasses: [],
  3078. //>>excludeEnd("ide");
  3079. messageSends: ["returnValue:", "eval:", "source"]
  3080. }),
  3081. $globals.ASTInterpreter);
  3082. $core.addMethod(
  3083. $core.method({
  3084. selector: "visitNode:",
  3085. protocol: 'visiting',
  3086. fn: function (aNode){
  3087. var self=this;
  3088. return self;
  3089. },
  3090. //>>excludeStart("ide", pragmas.excludeIdeData);
  3091. args: ["aNode"],
  3092. source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
  3093. referencedClasses: [],
  3094. //>>excludeEnd("ide");
  3095. messageSends: []
  3096. }),
  3097. $globals.ASTInterpreter);
  3098. $core.addMethod(
  3099. $core.method({
  3100. selector: "visitReturnNode:",
  3101. protocol: 'visiting',
  3102. fn: function (aNode){
  3103. var self=this;
  3104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3105. return $core.withContext(function($ctx1) {
  3106. //>>excludeEnd("ctx");
  3107. self["@returned"]=true;
  3108. self._returnValue_(self._pop());
  3109. return self;
  3110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3111. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},$globals.ASTInterpreter)});
  3112. //>>excludeEnd("ctx");
  3113. },
  3114. //>>excludeStart("ide", pragmas.excludeIdeData);
  3115. args: ["aNode"],
  3116. source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
  3117. referencedClasses: [],
  3118. //>>excludeEnd("ide");
  3119. messageSends: ["returnValue:", "pop"]
  3120. }),
  3121. $globals.ASTInterpreter);
  3122. $core.addMethod(
  3123. $core.method({
  3124. selector: "visitSendNode:",
  3125. protocol: 'visiting',
  3126. fn: function (aNode){
  3127. var self=this;
  3128. var receiver,args,message,result;
  3129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3130. return $core.withContext(function($ctx1) {
  3131. //>>excludeEnd("ctx");
  3132. var $1;
  3133. args=$recv($recv(aNode)._arguments())._collect_((function(each){
  3134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3135. return $core.withContext(function($ctx2) {
  3136. //>>excludeEnd("ctx");
  3137. return self._pop();
  3138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3139. $ctx2.sendIdx["pop"]=1;
  3140. //>>excludeEnd("ctx");
  3141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3142. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3143. //>>excludeEnd("ctx");
  3144. }));
  3145. receiver=self._pop();
  3146. message=self._messageFromSendNode_arguments_(aNode,$recv(args)._reversed());
  3147. result=self._sendMessage_to_superSend_(message,receiver,$recv(aNode)._superSend());
  3148. $1=$recv($recv(aNode)._isCascadeSendNode())._and_((function(){
  3149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3150. return $core.withContext(function($ctx2) {
  3151. //>>excludeEnd("ctx");
  3152. return $recv($recv(aNode)._isLastChild())._not();
  3153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  3155. //>>excludeEnd("ctx");
  3156. }));
  3157. if($core.assert($1)){
  3158. self._push_(receiver);
  3159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3160. $ctx1.sendIdx["push:"]=1;
  3161. //>>excludeEnd("ctx");
  3162. } else {
  3163. self._push_(result);
  3164. };
  3165. return self;
  3166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3167. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},$globals.ASTInterpreter)});
  3168. //>>excludeEnd("ctx");
  3169. },
  3170. //>>excludeStart("ide", pragmas.excludeIdeData);
  3171. args: ["aNode"],
  3172. source: "visitSendNode: aNode\x0a\x09| receiver args message result |\x0a\x09\x0a\x09args := aNode arguments collect: [ :each | self pop ].\x0a\x09receiver := self pop.\x0a\x09\x0a\x09message := self\x0a\x09\x09messageFromSendNode: aNode\x0a\x09\x09arguments: args reversed.\x0a\x09\x0a\x09result := self sendMessage: message to: receiver superSend: aNode superSend.\x0a\x09\x0a\x09\x22For cascade sends, push the reciever if the send is not the last one\x22\x0a\x09(aNode isCascadeSendNode and: [ aNode isLastChild not ])\x0a\x09\x09ifTrue: [ self push: receiver ]\x0a\x09\x09ifFalse: [ self push: result ]",
  3173. referencedClasses: [],
  3174. //>>excludeEnd("ide");
  3175. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"]
  3176. }),
  3177. $globals.ASTInterpreter);
  3178. $core.addMethod(
  3179. $core.method({
  3180. selector: "visitSequenceNode:",
  3181. protocol: 'visiting',
  3182. fn: function (aNode){
  3183. var self=this;
  3184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3185. return $core.withContext(function($ctx1) {
  3186. //>>excludeEnd("ctx");
  3187. $recv($recv(aNode)._temps())._do_((function(each){
  3188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3189. return $core.withContext(function($ctx2) {
  3190. //>>excludeEnd("ctx");
  3191. return $recv(self._context())._defineLocal_(each);
  3192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3193. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3194. //>>excludeEnd("ctx");
  3195. }));
  3196. return self;
  3197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3198. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},$globals.ASTInterpreter)});
  3199. //>>excludeEnd("ctx");
  3200. },
  3201. //>>excludeStart("ide", pragmas.excludeIdeData);
  3202. args: ["aNode"],
  3203. source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [ :each |\x0a\x09\x09self context defineLocal: each ]",
  3204. referencedClasses: [],
  3205. //>>excludeEnd("ide");
  3206. messageSends: ["do:", "temps", "defineLocal:", "context"]
  3207. }),
  3208. $globals.ASTInterpreter);
  3209. $core.addMethod(
  3210. $core.method({
  3211. selector: "visitValueNode:",
  3212. protocol: 'visiting',
  3213. fn: function (aNode){
  3214. var self=this;
  3215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3216. return $core.withContext(function($ctx1) {
  3217. //>>excludeEnd("ctx");
  3218. self._push_($recv(aNode)._value());
  3219. return self;
  3220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3221. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},$globals.ASTInterpreter)});
  3222. //>>excludeEnd("ctx");
  3223. },
  3224. //>>excludeStart("ide", pragmas.excludeIdeData);
  3225. args: ["aNode"],
  3226. source: "visitValueNode: aNode\x0a\x09self push: aNode value",
  3227. referencedClasses: [],
  3228. //>>excludeEnd("ide");
  3229. messageSends: ["push:", "value"]
  3230. }),
  3231. $globals.ASTInterpreter);
  3232. $core.addMethod(
  3233. $core.method({
  3234. selector: "visitVariableNode:",
  3235. protocol: 'visiting',
  3236. fn: function (aNode){
  3237. var self=this;
  3238. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  3239. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3241. return $core.withContext(function($ctx1) {
  3242. //>>excludeEnd("ctx");
  3243. var $2,$1,$5,$6,$4,$3,$8,$10,$9,$11,$12,$13,$15,$14,$16,$17,$7;
  3244. $2=$recv(aNode)._binding();
  3245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3246. $ctx1.sendIdx["binding"]=1;
  3247. //>>excludeEnd("ctx");
  3248. $1=$recv($2)._isUnknownVar();
  3249. if($core.assert($1)){
  3250. $5=$recv($PlatformInterface())._globals();
  3251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3252. $ctx1.sendIdx["globals"]=1;
  3253. //>>excludeEnd("ctx");
  3254. $6=$recv(aNode)._value();
  3255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3256. $ctx1.sendIdx["value"]=1;
  3257. //>>excludeEnd("ctx");
  3258. $4=$recv($5)._at_ifAbsent_($6,(function(){
  3259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3260. return $core.withContext(function($ctx2) {
  3261. //>>excludeEnd("ctx");
  3262. return self._error_("Unknown variable");
  3263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3264. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  3265. //>>excludeEnd("ctx");
  3266. }));
  3267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3268. $ctx1.sendIdx["at:ifAbsent:"]=1;
  3269. //>>excludeEnd("ctx");
  3270. $3=self._push_($4);
  3271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3272. $ctx1.sendIdx["push:"]=1;
  3273. //>>excludeEnd("ctx");
  3274. return $3;
  3275. };
  3276. $8=$recv($recv(aNode)._binding())._isInstanceVar();
  3277. if($core.assert($8)){
  3278. $10=self._context();
  3279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3280. $ctx1.sendIdx["context"]=1;
  3281. //>>excludeEnd("ctx");
  3282. $9=$recv($10)._receiver();
  3283. $11=$recv(aNode)._value();
  3284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3285. $ctx1.sendIdx["value"]=2;
  3286. //>>excludeEnd("ctx");
  3287. $7=$recv($9)._instVarAt_($11);
  3288. } else {
  3289. $12=self._context();
  3290. $13=$recv(aNode)._value();
  3291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3292. $ctx1.sendIdx["value"]=3;
  3293. //>>excludeEnd("ctx");
  3294. $7=$recv($12)._localAt_ifAbsent_($13,(function(){
  3295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3296. return $core.withContext(function($ctx2) {
  3297. //>>excludeEnd("ctx");
  3298. $15=$recv(aNode)._value();
  3299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3300. $ctx2.sendIdx["value"]=4;
  3301. //>>excludeEnd("ctx");
  3302. $14=$recv($15)._isCapitalized();
  3303. if($core.assert($14)){
  3304. $16=$recv($Smalltalk())._globals();
  3305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3306. $ctx2.sendIdx["globals"]=2;
  3307. //>>excludeEnd("ctx");
  3308. $17=$recv(aNode)._value();
  3309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3310. $ctx2.sendIdx["value"]=5;
  3311. //>>excludeEnd("ctx");
  3312. return $recv($16)._at_ifAbsent_($17,(function(){
  3313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3314. return $core.withContext(function($ctx3) {
  3315. //>>excludeEnd("ctx");
  3316. return $recv($recv($PlatformInterface())._globals())._at_($recv(aNode)._value());
  3317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3318. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)});
  3319. //>>excludeEnd("ctx");
  3320. }));
  3321. };
  3322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3323. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  3324. //>>excludeEnd("ctx");
  3325. }));
  3326. };
  3327. self._push_($7);
  3328. return self;
  3329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3330. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.ASTInterpreter)});
  3331. //>>excludeEnd("ctx");
  3332. },
  3333. //>>excludeStart("ide", pragmas.excludeIdeData);
  3334. args: ["aNode"],
  3335. source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (PlatformInterface globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk globals \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ] ] ] ])",
  3336. referencedClasses: ["PlatformInterface", "Smalltalk"],
  3337. //>>excludeEnd("ide");
  3338. messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:ifAbsent:", "isCapitalized", "at:"]
  3339. }),
  3340. $globals.ASTInterpreter);
  3341. $core.addClass('ASTInterpreterError', $globals.Error, [], 'Compiler-Interpreter');
  3342. //>>excludeStart("ide", pragmas.excludeIdeData);
  3343. $globals.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
  3344. //>>excludeEnd("ide");
  3345. $core.addClass('ASTPCNodeVisitor', $globals.NodeVisitor, ['context', 'index', 'selector', 'currentNode'], 'Compiler-Interpreter');
  3346. //>>excludeStart("ide", pragmas.excludeIdeData);
  3347. $globals.ASTPCNodeVisitor.comment="I visit an AST until I get to the current node for the `context` and answer it.\x0a\x0a## API\x0a\x0aMy instances must be filled with a context object using `#context:`.\x0a\x0aAfter visiting the AST the current node is answered by `#currentNode`";
  3348. //>>excludeEnd("ide");
  3349. $core.addMethod(
  3350. $core.method({
  3351. selector: "context",
  3352. protocol: 'accessing',
  3353. fn: function (){
  3354. var self=this;
  3355. var $1;
  3356. $1=self["@context"];
  3357. return $1;
  3358. },
  3359. //>>excludeStart("ide", pragmas.excludeIdeData);
  3360. args: [],
  3361. source: "context\x0a\x09^ context",
  3362. referencedClasses: [],
  3363. //>>excludeEnd("ide");
  3364. messageSends: []
  3365. }),
  3366. $globals.ASTPCNodeVisitor);
  3367. $core.addMethod(
  3368. $core.method({
  3369. selector: "context:",
  3370. protocol: 'accessing',
  3371. fn: function (aContext){
  3372. var self=this;
  3373. self["@context"]=aContext;
  3374. return self;
  3375. },
  3376. //>>excludeStart("ide", pragmas.excludeIdeData);
  3377. args: ["aContext"],
  3378. source: "context: aContext\x0a\x09context := aContext",
  3379. referencedClasses: [],
  3380. //>>excludeEnd("ide");
  3381. messageSends: []
  3382. }),
  3383. $globals.ASTPCNodeVisitor);
  3384. $core.addMethod(
  3385. $core.method({
  3386. selector: "currentNode",
  3387. protocol: 'accessing',
  3388. fn: function (){
  3389. var self=this;
  3390. var $1;
  3391. $1=self["@currentNode"];
  3392. return $1;
  3393. },
  3394. //>>excludeStart("ide", pragmas.excludeIdeData);
  3395. args: [],
  3396. source: "currentNode\x0a\x09^ currentNode",
  3397. referencedClasses: [],
  3398. //>>excludeEnd("ide");
  3399. messageSends: []
  3400. }),
  3401. $globals.ASTPCNodeVisitor);
  3402. $core.addMethod(
  3403. $core.method({
  3404. selector: "increaseIndex",
  3405. protocol: 'accessing',
  3406. fn: function (){
  3407. var self=this;
  3408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3409. return $core.withContext(function($ctx1) {
  3410. //>>excludeEnd("ctx");
  3411. self["@index"]=$recv(self._index()).__plus((1));
  3412. return self;
  3413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3414. }, function($ctx1) {$ctx1.fill(self,"increaseIndex",{},$globals.ASTPCNodeVisitor)});
  3415. //>>excludeEnd("ctx");
  3416. },
  3417. //>>excludeStart("ide", pragmas.excludeIdeData);
  3418. args: [],
  3419. source: "increaseIndex\x0a\x09index := self index + 1",
  3420. referencedClasses: [],
  3421. //>>excludeEnd("ide");
  3422. messageSends: ["+", "index"]
  3423. }),
  3424. $globals.ASTPCNodeVisitor);
  3425. $core.addMethod(
  3426. $core.method({
  3427. selector: "index",
  3428. protocol: 'accessing',
  3429. fn: function (){
  3430. var self=this;
  3431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3432. return $core.withContext(function($ctx1) {
  3433. //>>excludeEnd("ctx");
  3434. var $2,$1,$receiver;
  3435. $2=self["@index"];
  3436. if(($receiver = $2) == null || $receiver.isNil){
  3437. self["@index"]=(0);
  3438. $1=self["@index"];
  3439. } else {
  3440. $1=$2;
  3441. };
  3442. return $1;
  3443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3444. }, function($ctx1) {$ctx1.fill(self,"index",{},$globals.ASTPCNodeVisitor)});
  3445. //>>excludeEnd("ctx");
  3446. },
  3447. //>>excludeStart("ide", pragmas.excludeIdeData);
  3448. args: [],
  3449. source: "index\x0a\x09^ index ifNil: [ index := 0 ]",
  3450. referencedClasses: [],
  3451. //>>excludeEnd("ide");
  3452. messageSends: ["ifNil:"]
  3453. }),
  3454. $globals.ASTPCNodeVisitor);
  3455. $core.addMethod(
  3456. $core.method({
  3457. selector: "selector",
  3458. protocol: 'accessing',
  3459. fn: function (){
  3460. var self=this;
  3461. var $1;
  3462. $1=self["@selector"];
  3463. return $1;
  3464. },
  3465. //>>excludeStart("ide", pragmas.excludeIdeData);
  3466. args: [],
  3467. source: "selector\x0a\x09^ selector",
  3468. referencedClasses: [],
  3469. //>>excludeEnd("ide");
  3470. messageSends: []
  3471. }),
  3472. $globals.ASTPCNodeVisitor);
  3473. $core.addMethod(
  3474. $core.method({
  3475. selector: "selector:",
  3476. protocol: 'accessing',
  3477. fn: function (aString){
  3478. var self=this;
  3479. self["@selector"]=aString;
  3480. return self;
  3481. },
  3482. //>>excludeStart("ide", pragmas.excludeIdeData);
  3483. args: ["aString"],
  3484. source: "selector: aString\x0a\x09selector := aString",
  3485. referencedClasses: [],
  3486. //>>excludeEnd("ide");
  3487. messageSends: []
  3488. }),
  3489. $globals.ASTPCNodeVisitor);
  3490. $core.addMethod(
  3491. $core.method({
  3492. selector: "visitJSStatementNode:",
  3493. protocol: 'visiting',
  3494. fn: function (aNode){
  3495. var self=this;
  3496. self["@currentNode"]=aNode;
  3497. return self;
  3498. },
  3499. //>>excludeStart("ide", pragmas.excludeIdeData);
  3500. args: ["aNode"],
  3501. source: "visitJSStatementNode: aNode\x0a\x09\x22If a JSStatementNode is encountered, it always is the current node.\x0a\x09Stop visiting the AST there\x22\x0a\x09\x0a\x09currentNode := aNode",
  3502. referencedClasses: [],
  3503. //>>excludeEnd("ide");
  3504. messageSends: []
  3505. }),
  3506. $globals.ASTPCNodeVisitor);
  3507. $core.addMethod(
  3508. $core.method({
  3509. selector: "visitSendNode:",
  3510. protocol: 'visiting',
  3511. fn: function (aNode){
  3512. var self=this;
  3513. var sendIndex;
  3514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3515. return $core.withContext(function($ctx1) {
  3516. //>>excludeEnd("ctx");
  3517. var $1,$2,$4,$3,$5;
  3518. $1=self._context();
  3519. $2=self._selector();
  3520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3521. $ctx1.sendIdx["selector"]=1;
  3522. //>>excludeEnd("ctx");
  3523. sendIndex=$recv($1)._sendIndexAt_($2);
  3524. (
  3525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3526. $ctx1.supercall = true,
  3527. //>>excludeEnd("ctx");
  3528. $globals.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply($recv(self), [aNode]));
  3529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3530. $ctx1.supercall = false;
  3531. //>>excludeEnd("ctx");;
  3532. $4=self._selector();
  3533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3534. $ctx1.sendIdx["selector"]=2;
  3535. //>>excludeEnd("ctx");
  3536. $3=$recv($4).__eq($recv(aNode)._selector());
  3537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3538. $ctx1.sendIdx["="]=1;
  3539. //>>excludeEnd("ctx");
  3540. if($core.assert($3)){
  3541. $5=$recv(self._index()).__eq(sendIndex);
  3542. if($core.assert($5)){
  3543. self["@currentNode"]=aNode;
  3544. self["@currentNode"];
  3545. };
  3546. self._increaseIndex();
  3547. };
  3548. return self;
  3549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3550. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,sendIndex:sendIndex},$globals.ASTPCNodeVisitor)});
  3551. //>>excludeEnd("ctx");
  3552. },
  3553. //>>excludeStart("ide", pragmas.excludeIdeData);
  3554. args: ["aNode"],
  3555. source: "visitSendNode: aNode\x0a\x09| sendIndex |\x0a\x09sendIndex := self context sendIndexAt: self selector.\x0a\x09\x0a\x09super visitSendNode: aNode.\x0a\x09\x0a\x09self selector = aNode selector ifTrue: [\x0a\x09\x09self index = sendIndex ifTrue: [ currentNode := aNode ].\x0a\x09\x09self increaseIndex ]",
  3556. referencedClasses: [],
  3557. //>>excludeEnd("ide");
  3558. messageSends: ["sendIndexAt:", "context", "selector", "visitSendNode:", "ifTrue:", "=", "index", "increaseIndex"]
  3559. }),
  3560. $globals.ASTPCNodeVisitor);
  3561. $core.addMethod(
  3562. $core.method({
  3563. selector: "isSteppingNode",
  3564. protocol: '*Compiler-Interpreter',
  3565. fn: function (){
  3566. var self=this;
  3567. return true;
  3568. },
  3569. //>>excludeStart("ide", pragmas.excludeIdeData);
  3570. args: [],
  3571. source: "isSteppingNode\x0a\x09^ true",
  3572. referencedClasses: [],
  3573. //>>excludeEnd("ide");
  3574. messageSends: []
  3575. }),
  3576. $globals.AssignmentNode);
  3577. $core.addMethod(
  3578. $core.method({
  3579. selector: "isSteppingNode",
  3580. protocol: '*Compiler-Interpreter',
  3581. fn: function (){
  3582. var self=this;
  3583. return true;
  3584. },
  3585. //>>excludeStart("ide", pragmas.excludeIdeData);
  3586. args: [],
  3587. source: "isSteppingNode\x0a\x09^ true",
  3588. referencedClasses: [],
  3589. //>>excludeEnd("ide");
  3590. messageSends: []
  3591. }),
  3592. $globals.BlockNode);
  3593. $core.addMethod(
  3594. $core.method({
  3595. selector: "isSteppingNode",
  3596. protocol: '*Compiler-Interpreter',
  3597. fn: function (){
  3598. var self=this;
  3599. return true;
  3600. },
  3601. //>>excludeStart("ide", pragmas.excludeIdeData);
  3602. args: [],
  3603. source: "isSteppingNode\x0a\x09^ true",
  3604. referencedClasses: [],
  3605. //>>excludeEnd("ide");
  3606. messageSends: []
  3607. }),
  3608. $globals.DynamicArrayNode);
  3609. $core.addMethod(
  3610. $core.method({
  3611. selector: "isSteppingNode",
  3612. protocol: '*Compiler-Interpreter',
  3613. fn: function (){
  3614. var self=this;
  3615. return true;
  3616. },
  3617. //>>excludeStart("ide", pragmas.excludeIdeData);
  3618. args: [],
  3619. source: "isSteppingNode\x0a\x09^ true",
  3620. referencedClasses: [],
  3621. //>>excludeEnd("ide");
  3622. messageSends: []
  3623. }),
  3624. $globals.DynamicDictionaryNode);
  3625. $core.addMethod(
  3626. $core.method({
  3627. selector: "isSteppingNode",
  3628. protocol: '*Compiler-Interpreter',
  3629. fn: function (){
  3630. var self=this;
  3631. return true;
  3632. },
  3633. //>>excludeStart("ide", pragmas.excludeIdeData);
  3634. args: [],
  3635. source: "isSteppingNode\x0a\x09^ true",
  3636. referencedClasses: [],
  3637. //>>excludeEnd("ide");
  3638. messageSends: []
  3639. }),
  3640. $globals.JSStatementNode);
  3641. $core.addMethod(
  3642. $core.method({
  3643. selector: "isSteppingNode",
  3644. protocol: '*Compiler-Interpreter',
  3645. fn: function (){
  3646. var self=this;
  3647. return false;
  3648. },
  3649. //>>excludeStart("ide", pragmas.excludeIdeData);
  3650. args: [],
  3651. source: "isSteppingNode\x0a\x09^ false",
  3652. referencedClasses: [],
  3653. //>>excludeEnd("ide");
  3654. messageSends: []
  3655. }),
  3656. $globals.Node);
  3657. $core.addMethod(
  3658. $core.method({
  3659. selector: "isSteppingNode",
  3660. protocol: '*Compiler-Interpreter',
  3661. fn: function (){
  3662. var self=this;
  3663. return true;
  3664. },
  3665. //>>excludeStart("ide", pragmas.excludeIdeData);
  3666. args: [],
  3667. source: "isSteppingNode\x0a\x09^ true",
  3668. referencedClasses: [],
  3669. //>>excludeEnd("ide");
  3670. messageSends: []
  3671. }),
  3672. $globals.SendNode);
  3673. });