Compiler-Interpreter.js 130 KB

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