12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594 |
- smalltalk.addPackage('Compiler-Interpreter');
- smalltalk.addClass('AIBlockClosure', smalltalk.BlockClosure, ['node', 'outerContext'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "applyTo:arguments:",
- fn: function (anObject,aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpreterError();
- return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.AIBlockClosure)})},
- messageSends: ["interpreterError"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "compiledSource",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "[ AST Block closure ]";
- }, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.AIBlockClosure)})},
- messageSends: []}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "currySelf",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpreterError();
- return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.AIBlockClosure)})},
- messageSends: ["interpreterError"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeWithContext:node:",
- fn: function (aContext,aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@node"]=aNode;
- self["@outerContext"]=aContext;
- return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure)})},
- messageSends: []}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreterError",
- fn: function (){
- var self=this;
- function $AIInterpreterError(){return smalltalk.AIInterpreterError||(typeof AIInterpreterError=="undefined"?nil:AIInterpreterError)}
- return smalltalk.withContext(function($ctx1) {
- _st($AIInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
- return self}, function($ctx1) {$ctx1.fill(self,"interpreterError",{},smalltalk.AIBlockClosure)})},
- messageSends: ["signal:"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "numArgs",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self["@node"])._temps())._size();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"numArgs",{},smalltalk.AIBlockClosure)})},
- messageSends: ["size", "temps"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueWithPossibleArguments_([]);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.AIBlockClosure)})},
- messageSends: ["valueWithPossibleArguments:"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value:",
- fn: function (anArgument){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueWithPossibleArguments_(["anArgument"]);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"value:",{anArgument:anArgument},smalltalk.AIBlockClosure)})},
- messageSends: ["valueWithPossibleArguments:"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value:value:",
- fn: function (firstArgument,secondArgument){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueWithPossibleArguments_(["firstArgument", "secondArgument"]);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},smalltalk.AIBlockClosure)})},
- messageSends: ["valueWithPossibleArguments:"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value:value:value:",
- fn: function (firstArgument,secondArgument,thirdArgument){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueWithPossibleArguments_(["firstArgument", "secondArgument", "thirdArgument"]);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},smalltalk.AIBlockClosure)})},
- messageSends: ["valueWithPossibleArguments:"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "valueWithPossibleArguments:",
- fn: function (aCollection){
- var self=this;
- var context;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4;
- context=_st(self["@outerContext"])._newBlockContext();
- _st(_st(self["@node"])._parameters())._withIndexDo_((function(each,index){
- return smalltalk.withContext(function($ctx2) {
- return _st(context)._localAt_put_(each,_st(aCollection)._at_ifAbsent_(index,(function(){
- return smalltalk.withContext(function($ctx3) {
- return nil;
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})));
- }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)})}));
- $1=_st(context)._interpreter();
- _st($1)._node_(_st(_st(_st(self["@node"])._nodes())._first())._nextChild());
- $2=_st($1)._proceed();
- $3=_st(self["@outerContext"])._interpreter();
- _st($3)._push_(_st(_st(context)._interpreter())._value());
- $4=_st($3)._returnValue_(_st(context)._returnValue());
- return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context},smalltalk.AIBlockClosure)})},
- messageSends: ["newBlockContext", "withIndexDo:", "parameters", "localAt:put:", "at:ifAbsent:", "node:", "interpreter", "nextChild", "first", "nodes", "proceed", "push:", "value", "returnValue:", "returnValue"]}),
- smalltalk.AIBlockClosure);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "forContext:node:",
- fn: function (aContext,aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._new();
- _st($2)._initializeWithContext_node_(aContext,aNode);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"forContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure.klass)})},
- messageSends: ["initializeWithContext:node:", "new", "yourself"]}),
- smalltalk.AIBlockClosure.klass);
- smalltalk.addClass('AIContext', smalltalk.Object, ['outerContext', 'innerContext', 'pc', 'locals', 'method', 'index', 'ast', 'interpreter'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "arguments",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self._ast())._arguments())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return self._localAt_(each);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.AIContext)})},
- messageSends: ["collect:", "arguments", "ast", "localAt:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "asString",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._isBlockContext();
- if(smalltalk.assert($2)){
- $1=_st("a block (in ".__comma(_st(self._methodContext())._asString())).__comma(")");
- } else {
- $1=_st(_st(_st(_st(self._receiver())._class())._name()).__comma(" >> ")).__comma(self._selector());
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.AIContext)})},
- messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "name", "class", "receiver", "selector"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "ast",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4;
- $1=self._isBlockContext();
- if(smalltalk.assert($1)){
- $2=_st(self._outerContext())._ast();
- return $2;
- };
- $3=self["@ast"];
- if(($receiver = $3) == nil || $receiver == undefined){
- self._initializeAST();
- } else {
- $3;
- };
- $4=self["@ast"];
- return $4;
- }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.AIContext)})},
- messageSends: ["ifTrue:", "isBlockContext", "ast", "outerContext", "ifNil:", "initializeAST"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "index",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@index"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=(0);
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.AIContext)})},
- messageSends: ["ifNil:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "index:",
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@index"]=anInteger;
- return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeAST",
- fn: function (){
- var self=this;
- function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
- return smalltalk.withContext(function($ctx1) {
- self["@ast"]=_st(self._method())._ast();
- _st(_st($SemanticAnalyzer())._on_(_st(self._method())._methodClass()))._visit_(self["@ast"]);
- return self}, function($ctx1) {$ctx1.fill(self,"initializeAST",{},smalltalk.AIContext)})},
- messageSends: ["ast", "method", "visit:", "on:", "methodClass"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeFromMethodContext:",
- fn: function (aMethodContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4;
- $1=self;
- _st($1)._pc_(_st(aMethodContext)._pc());
- _st($1)._index_(_st(aMethodContext)._index());
- _st($1)._receiver_(_st(aMethodContext)._receiver());
- $2=_st($1)._method_(_st(aMethodContext)._method());
- $3=_st(aMethodContext)._outerContext();
- if(($receiver = $3) == nil || $receiver == undefined){
- $3;
- } else {
- var outer;
- outer=$receiver;
- $4=_st(outer)._methodContext();
- if(($receiver = $4) == nil || $receiver == undefined){
- $4;
- } else {
- self._outerContext_(_st(self._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
- };
- _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._locals())._at_put_(key,value);
- }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)})}));
- };
- return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
- messageSends: ["pc:", "pc", "index:", "index", "receiver:", "receiver", "method:", "method", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeInterpreter",
- fn: function (){
- var self=this;
- function $Interpreter(){return smalltalk.Interpreter||(typeof Interpreter=="undefined"?nil:Interpreter)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- $1=_st($Interpreter())._new();
- _st($1)._context_(self);
- _st($1)._node_(self._retrieveNode());
- $2=_st($1)._yourself();
- self["@interpreter"]=$2;
- $3=_st(_st(self._innerContext())._notNil())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(self._innerContext())._isBlockContext())._not();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- if(smalltalk.assert($3)){
- self._setupInterpreter_(self["@interpreter"]);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
- messageSends: ["context:", "new", "node:", "retrieveNode", "yourself", "ifTrue:", "and:", "notNil", "innerContext", "not", "isBlockContext", "setupInterpreter:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeLocals",
- fn: function (){
- var self=this;
- function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
- return smalltalk.withContext(function($ctx1) {
- self["@locals"]=_st($Dictionary())._new();
- _st(self["@locals"])._at_put_("thisContext",self);
- return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
- messageSends: ["new", "at:put:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "innerContext",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@innerContext"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"innerContext",{},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "innerContext:",
- fn: function (anAIContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@innerContext"]=anAIContext;
- return self}, function($ctx1) {$ctx1.fill(self,"innerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=self["@interpreter"];
- if(($receiver = $1) == nil || $receiver == undefined){
- self._initializeInterpreter();
- } else {
- $1;
- };
- $2=self["@interpreter"];
- return $2;
- }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.AIContext)})},
- messageSends: ["ifNil:", "initializeInterpreter"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isBlockContext",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._selector())._isNil();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.AIContext)})},
- messageSends: ["isNil", "selector"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "localAt:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
- return smalltalk.withContext(function($ctx2) {
- $2=self._isBlockContext();
- if(smalltalk.assert($2)){
- return nil;
- } else {
- return _st(self._outerContext())._localAt_(aString);
- };
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
- messageSends: ["at:ifAbsent:", "locals", "ifTrue:ifFalse:", "isBlockContext", "localAt:", "outerContext"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "localAt:put:",
- fn: function (aString,anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._locals())._at_put_(aString,anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
- messageSends: ["at:put:", "locals"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "locals",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=self["@locals"];
- if(($receiver = $1) == nil || $receiver == undefined){
- self._initializeLocals();
- } else {
- $1;
- };
- $2=self["@locals"];
- return $2;
- }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
- messageSends: ["ifNil:", "initializeLocals"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "method",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@method"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "method:",
- fn: function (aCompiledMethod){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@method"]=aCompiledMethod;
- return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "methodContext",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$4,$3;
- $1=self._isBlockContext();
- if(! smalltalk.assert($1)){
- $2=self;
- return $2;
- };
- $4=self._outerContext();
- if(($receiver = $4) == nil || $receiver == undefined){
- $3=$4;
- } else {
- var outer;
- outer=$receiver;
- $3=_st(outer)._methodContext();
- };
- return $3;
- }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.AIContext)})},
- messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "newBlockContext",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st(self._class())._new();
- _st($2)._outerContext_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"newBlockContext",{},smalltalk.AIContext)})},
- messageSends: ["outerContext:", "new", "class", "yourself"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "outerContext",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@outerContext"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "outerContext:",
- fn: function (anAIContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@outerContext"]=anAIContext;
- _st(self["@outerContext"])._innerContext_(self);
- return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
- messageSends: ["innerContext:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pc",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@pc"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@pc"]=(0);
- $1=self["@pc"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.AIContext)})},
- messageSends: ["ifNil:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pc:",
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@pc"]=anInteger;
- return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.AIContext)})},
- messageSends: []}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._localAt_("self");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
- messageSends: ["localAt:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver:",
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._localAt_put_("self",anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
- messageSends: ["localAt:put:"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "retrieveNode",
- fn: function (){
- var self=this;
- function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($ASTPCNodeVisitor())._new();
- _st($2)._context_(self);
- _st($2)._visit_(self._ast());
- $3=_st($2)._currentNode();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"retrieveNode",{},smalltalk.AIContext)})},
- messageSends: ["context:", "new", "visit:", "ast", "currentNode"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selector",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._method();
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=$2;
- } else {
- $1=_st(self._method())._selector();
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
- messageSends: ["ifNotNil:", "method", "selector"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupInterpreter:",
- fn: function (anInterpreter){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(_st(self._innerContext())._arguments())._reversed())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(anInterpreter)._push_(each);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- _st(anInterpreter)._push_(_st(self._innerContext())._receiver());
- return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
- messageSends: ["do:", "reversed", "arguments", "innerContext", "push:", "receiver"]}),
- smalltalk.AIContext);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "fromMethodContext:",
- fn: function (aMethodContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._new();
- _st($2)._initializeFromMethodContext_(aMethodContext);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
- messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
- smalltalk.AIContext.klass);
- smalltalk.addClass('AIInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
- smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "atEnd",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._interpreter())._atEnd();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
- messageSends: ["atEnd", "interpreter"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "buildAST",
- fn: function (){
- var self=this;
- var ast;
- function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
- _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
- $1=ast;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
- messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@context"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
- messageSends: []}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context:",
- fn: function (aContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@context"]=aContext;
- return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
- messageSends: []}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultInterpreterClass",
- fn: function (){
- var self=this;
- function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=$ASTSteppingInterpreter();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
- messageSends: []}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeInterpreter",
- fn: function (){
- var self=this;
- var ast,next;
- function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- ast=self._buildAST();
- $1=_st($ASTPCNodeVisitor())._new();
- _st($1)._context_(self._context());
- _st($1)._visit_(ast);
- $2=_st($1)._currentNode();
- next=$2;
- _st(self._interpreter())._interpret_(next);
- return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
- messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "interpret:", "interpreter"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initializeWithContext:",
- fn: function (aContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._context_(aContext);
- self._initializeInterpreter();
- return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
- messageSends: ["context:", "initializeInterpreter"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@interpreter"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
- $1=self["@interpreter"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
- messageSends: ["ifNil:", "new", "defaultInterpreterClass"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:",
- fn: function (anInterpreter){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@interpreter"]=anInterpreter;
- return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
- messageSends: []}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "method",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._context())._method();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
- messageSends: ["method", "context"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._interpreter())._nextNode();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
- messageSends: ["nextNode", "interpreter"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "proceed",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._shouldBeImplemented();
- return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
- messageSends: ["shouldBeImplemented"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "restart",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._shouldBeImplemented();
- return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
- messageSends: ["shouldBeImplemented"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "step",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(_st(_st(self._interpreter())._nextNode())._notNil())._and_((function(){
- return smalltalk.withContext(function($ctx3) {
- return _st(_st(self._interpreter())._nextNode())._stopOnStepping();
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._or_((function(){
- return smalltalk.withContext(function($ctx3) {
- return _st(_st(self._interpreter())._atEnd())._not();
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
- return smalltalk.withContext(function($ctx2) {
- _st(self._interpreter())._step();
- return self._step();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
- messageSends: ["whileFalse:", "or:", "and:", "notNil", "nextNode", "interpreter", "stopOnStepping", "not", "atEnd", "step"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stepInto",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._shouldBeImplemented();
- return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
- messageSends: ["shouldBeImplemented"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stepOver",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._step();
- return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
- messageSends: ["step"]}),
- smalltalk.ASTDebugger);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context:",
- fn: function (aContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._new();
- _st($2)._initializeWithContext_(aContext);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
- messageSends: ["initializeWithContext:", "new", "yourself"]}),
- smalltalk.ASTDebugger.klass);
- smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'nextNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "assign:to:",
- fn: function (aNode,anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=_st(_st(aNode)._binding())._isInstanceVar();
- if(smalltalk.assert($2)){
- $1=_st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
- } else {
- $1=_st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
- messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context",
- fn: function (){
- var self=this;
- function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@context"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@context"]=_st($AIContext())._new();
- $1=self["@context"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
- messageSends: ["ifNil:", "new"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context:",
- fn: function (anAIContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@context"]=anAIContext;
- return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
- messageSends: []}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "continue:value:",
- fn: function (aBlock,anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@result"]=anObject;
- _st(aBlock)._value_(anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
- messageSends: ["value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "currentNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@currentNode"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
- messageSends: []}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "eval:",
- fn: function (aString){
- var self=this;
- var source,function_;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- source=_st($String())._streamContents_((function(str){
- return smalltalk.withContext(function($ctx2) {
- _st(str)._nextPutAll_("(function(");
- _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx3) {
- return _st(str)._nextPutAll_(each);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
- return smalltalk.withContext(function($ctx3) {
- return _st(str)._nextPutAll_(",");
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
- $1=str;
- _st($1)._nextPutAll_("){ return (function() {");
- _st($1)._nextPutAll_(aString);
- $2=_st($1)._nextPutAll_("})() })");
- return $2;
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
- function_=_st(_st($Compiler())._new())._eval_(source);
- $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
- return $3;
- }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
- messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initialize",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
- self["@shouldReturn"]=false;
- return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
- messageSends: ["initialize"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpret:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@shouldReturn"]=false;
- self._interpret_continue_(aNode,(function(value){
- return smalltalk.withContext(function($ctx2) {
- self["@result"]=value;
- return self["@result"];
- }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
- messageSends: ["interpret:continue:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpret:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- $1=self["@shouldReturn"];
- if(smalltalk.assert($1)){
- $2=self;
- return $2;
- };
- $3=_st(aNode)._isNode();
- if(smalltalk.assert($3)){
- self["@currentNode"]=aNode;
- self["@currentNode"];
- self._interpretNode_continue_(aNode,(function(value){
- return smalltalk.withContext(function($ctx2) {
- return self._continue_value_(aBlock,value);
- }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,3)})}));
- } else {
- self._continue_value_(aBlock,aNode);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["ifTrue:", "ifTrue:ifFalse:", "isNode", "interpretNode:continue:", "continue:value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretAll:continue:",
- fn: function (aCollection,aBlock){
- var self=this;
- function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- return smalltalk.withContext(function($ctx1) {
- self._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretAll:continue:result:", "new"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretAll:continue:result:",
- fn: function (nodes,aBlock,aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(nodes)._isEmpty();
- if(smalltalk.assert($1)){
- self._continue_value_(aBlock,aCollection);
- } else {
- self._interpret_continue_(_st(nodes)._first(),(function(value){
- return smalltalk.withContext(function($ctx2) {
- return self._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
- }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,3)})}));
- };
- return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
- messageSends: ["ifTrue:ifFalse:", "isEmpty", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ","]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretAssignmentNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpret_continue_(_st(aNode)._right(),(function(value){
- return smalltalk.withContext(function($ctx2) {
- return self._continue_value_(aBlock,self._assign_to_(_st(aNode)._left(),value));
- }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretBlockNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- self._continue_value_(aBlock,(function(){
- return smalltalk.withContext(function($ctx2) {
- return self._withBlockContext_((function(){
- return smalltalk.withContext(function($ctx3) {
- $1=self;
- _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
- $2=_st($1)._result();
- return $2;
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretBlockSequenceNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpretSequenceNode_continue_(aNode,aBlock);
- return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretSequenceNode:continue:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretCascadeNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
- return smalltalk.withContext(function($ctx2) {
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx3) {
- return _st(each)._receiver_(receiver);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
- return self._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
- return smalltalk.withContext(function($ctx3) {
- return self._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
- return smalltalk.withContext(function($ctx4) {
- return self._continue_value_(aBlock,val);
- }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx3,4)})}));
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
- }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpret:continue:", "receiver", "do:", "nodes", "receiver:", "interpretAll:continue:", "allButLast", "last", "continue:value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretClassReferenceNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- return smalltalk.withContext(function($ctx1) {
- self._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "at:", "current", "value"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretDynamicArrayNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
- return smalltalk.withContext(function($ctx2) {
- return self._continue_value_(aBlock,array);
- }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretAll:continue:", "nodes", "continue:value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretDynamicDictionaryNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
- return smalltalk.withContext(function($ctx1) {
- self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
- var hashedCollection;
- return smalltalk.withContext(function($ctx2) {
- hashedCollection=_st($HashedCollection())._new();
- hashedCollection;
- _st(array)._do_((function(each){
- return smalltalk.withContext(function($ctx3) {
- return _st(hashedCollection)._add_(each);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
- return self._continue_value_(aBlock,hashedCollection);
- }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretJSStatementNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@shouldReturn"]=true;
- self._continue_value_(aBlock,self._eval_(_st(aNode)._source()));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "eval:", "source"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretMethodNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
- return smalltalk.withContext(function($ctx2) {
- return self._continue_value_(aBlock,_st(array)._first());
- }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(aNode)._interpreter_continue_(self,aBlock);
- return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpreter:continue:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretReturnNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
- return smalltalk.withContext(function($ctx2) {
- self["@shouldReturn"]=true;
- self["@shouldReturn"];
- return self._continue_value_(aBlock,value);
- }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretSendNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
- return smalltalk.withContext(function($ctx2) {
- return self._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
- return smalltalk.withContext(function($ctx3) {
- return self._messageFromSendNode_arguments_do_(aNode,args,(function(message){
- return smalltalk.withContext(function($ctx4) {
- _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
- return self._continue_value_(aBlock,self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
- }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx3,3)})}));
- }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx2,2)})}));
- }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "context", "+", "pc", "continue:value:", "sendMessage:to:superSend:", "superSend"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretSequenceNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
- return smalltalk.withContext(function($ctx2) {
- return self._continue_value_(aBlock,_st(array)._last());
- }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretValueNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._continue_value_(aBlock,_st(aNode)._value());
- return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "value"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpretVariableNode:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$4,$3;
- $1=self;
- $2=aBlock;
- $4=_st(_st(aNode)._binding())._isInstanceVar();
- if(smalltalk.assert($4)){
- $3=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
- } else {
- $3=_st(self._context())._localAt_(_st(aNode)._value());
- };
- _st($1)._continue_value_($2,$3);
- return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:", "receiver", "context", "value", "localAt:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageFromSendNode:arguments:do:",
- fn: function (aSendNode,aCollection,aBlock){
- var self=this;
- function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st($Message())._new();
- _st($1)._selector_(_st(aSendNode)._selector());
- _st($1)._arguments_(aCollection);
- $2=_st($1)._yourself();
- self._continue_value_(aBlock,$2);
- return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
- messageSends: ["continue:value:", "selector:", "new", "selector", "arguments:", "yourself"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@nextNode"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=self._currentNode();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTInterpreter)})},
- messageSends: ["ifNil:", "currentNode"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@nextNode"]=aNode;
- return self}, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
- messageSends: []}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "result",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@result"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
- messageSends: []}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "sendMessage:to:superSend:",
- fn: function (aMessage,anObject,aBoolean){
- var self=this;
- var method;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4,$5,$6;
- var $early={};
- try {
- $1=aBoolean;
- if(! smalltalk.assert($1)){
- $2=_st(aMessage)._sendTo_(anObject);
- return $2;
- };
- $3=_st(_st(anObject)._class())._superclass();
- if(($receiver = $3) == nil || $receiver == undefined){
- $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
- return $4;
- } else {
- $3;
- };
- method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
- return smalltalk.withContext(function($ctx2) {
- $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
- throw $early=[$5];
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
- $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
- return $6;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
- messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "applyTo:arguments:", "fn", "arguments"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldReturn",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@shouldReturn"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
- messageSends: ["ifNil:"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "withBlockContext:",
- fn: function (aBlock){
- var self=this;
- var blockResult;
- function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- $1=_st($AIContext())._new();
- _st($1)._outerContext_(self._context());
- $2=_st($1)._yourself();
- self._context_($2);
- blockResult=_st(aBlock)._value();
- self._context_(_st(self._context())._outerContext());
- $3=blockResult;
- return $3;
- }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
- messageSends: ["context:", "outerContext:", "new", "context", "yourself", "value", "outerContext"]}),
- smalltalk.ASTInterpreter);
- smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "atEnd",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._shouldReturn())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._nextNode()).__eq_eq(self._currentNode());
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
- messageSends: ["or:", "shouldReturn", "==", "nextNode", "currentNode"]}),
- smalltalk.ASTSteppingInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initialize",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
- self["@continuation"]=(function(){
- return smalltalk.withContext(function($ctx2) {
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})});
- return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
- messageSends: ["initialize"]}),
- smalltalk.ASTSteppingInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpret:continue:",
- fn: function (aNode,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@nextNode"]=aNode;
- self["@continuation"]=(function(){
- return smalltalk.withContext(function($ctx2) {
- return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})});
- return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
- messageSends: ["interpret:continue:"]}),
- smalltalk.ASTSteppingInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@nextNode"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
- messageSends: []}),
- smalltalk.ASTSteppingInterpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "step",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self["@continuation"])._value();
- return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
- messageSends: ["value"]}),
- smalltalk.ASTSteppingInterpreter);
- smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'blockIndex', 'currentNode'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "blockIndex",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@blockIndex"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@blockIndex"]=(0);
- $1=self["@blockIndex"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"blockIndex",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["ifNil:"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@context"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context:",
- fn: function (aContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@context"]=aContext;
- return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "currentNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@currentNode"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "increaseBlockIndex",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@blockIndex"]=_st(self._blockIndex()).__plus((1));
- return self}, function($ctx1) {$ctx1.fill(self,"increaseBlockIndex",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["+", "blockIndex"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pc",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@pc"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=(0);
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["ifNil:"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pc:",
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@pc"]=anInteger;
- return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "useInlinings",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@useInlinings"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=true;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["ifNil:"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "useInlinings:",
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@useInlinings"]=aBoolean;
- return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitBlockNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._blockIndex()).__gt_eq(_st(self._context())._index());
- if(! smalltalk.assert($1)){
- self._increaseBlockIndex();
- smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["ifFalse:", ">=", "blockIndex", "index", "context", "increaseBlockIndex", "visitBlockNode:"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitJSStatementNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@currentNode"]=aNode;
- return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
- messageSends: []}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitSendNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
- $1=_st(self._pc()).__eq(_st(self._context())._pc());
- if(! smalltalk.assert($1)){
- $2=_st(aNode)._shouldBeInlined();
- if(! smalltalk.assert($2)){
- $3=_st(self._blockIndex()).__eq(_st(self._context())._index());
- if(smalltalk.assert($3)){
- self._pc_(_st(self._pc()).__plus((1)));
- self["@currentNode"]=aNode;
- self["@currentNode"];
- };
- };
- };
- return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
- messageSends: ["visitSendNode:", "ifFalse:", "=", "pc", "context", "shouldBeInlined", "ifTrue:", "blockIndex", "index", "pc:", "+"]}),
- smalltalk.ASTPCNodeVisitor);
- smalltalk.addClass('Interpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'value', 'returnValue'], 'Compiler-Interpreter');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "assign:to:",
- fn: function (aNode,anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(aNode)._binding())._isInstanceVar();
- if(smalltalk.assert($1)){
- _st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
- } else {
- _st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.Interpreter)})},
- messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "atEnd",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._shouldReturn())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._node())._isNil();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Interpreter)})},
- messageSends: ["or:", "shouldReturn", "isNil", "node"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@context"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "context:",
- fn: function (aContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@context"]=aContext;
- return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "eval:",
- fn: function (aString){
- var self=this;
- var source,function_;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- source=_st($String())._streamContents_((function(str){
- return smalltalk.withContext(function($ctx2) {
- _st(str)._nextPutAll_("(function(");
- _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx3) {
- return _st(str)._nextPutAll_(each);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
- return smalltalk.withContext(function($ctx3) {
- return _st(str)._nextPutAll_(",");
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
- $1=str;
- _st($1)._nextPutAll_("){ return (function() {");
- _st($1)._nextPutAll_(aString);
- $2=_st($1)._nextPutAll_("})() })");
- return $2;
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
- function_=_st(_st($Compiler())._new())._eval_(source);
- $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
- return $3;
- }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.Interpreter)})},
- messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpret",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._visit_(self._node());
- return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.Interpreter)})},
- messageSends: ["visit:", "node"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpret:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._node_(aNode);
- self._interpret();
- return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["node:", "interpret"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageFromSendNode:arguments:",
- fn: function (aSendNode,aCollection){
- var self=this;
- function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($Message())._new();
- _st($2)._selector_(_st(aSendNode)._selector());
- _st($2)._arguments_(aCollection);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.Interpreter)})},
- messageSends: ["selector:", "new", "selector", "arguments:", "yourself"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageNotUnderstood:receiver:",
- fn: function (aMessage,anObject){
- var self=this;
- function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st($MessageNotUnderstood())._new();
- _st($1)._meesage_(aMessage);
- _st($1)._receiver_(anObject);
- $2=_st($1)._signal();
- return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.Interpreter)})},
- messageSends: ["meesage:", "new", "receiver:", "signal"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "next",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._node_(_st(self._node())._nextNode());
- return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Interpreter)})},
- messageSends: ["node:", "nextNode", "node"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "node",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@node"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "node:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@node"]=aNode;
- return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "peek",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._stack())._last();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Interpreter)})},
- messageSends: ["last", "stack"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pop",
- fn: function (){
- var self=this;
- var value;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- value=self._peek();
- _st(self._stack())._removeLast();
- $1=value;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"pop",{value:value},smalltalk.Interpreter)})},
- messageSends: ["peek", "removeLast", "stack"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "proceed",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._atEnd();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._step();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.Interpreter)})},
- messageSends: ["whileFalse:", "atEnd", "step"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "push:",
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._stack())._add_(anObject);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.Interpreter)})},
- messageSends: ["add:", "stack"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "restart",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._node_(_st(_st(self._context())._ast())._nextChild());
- return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.Interpreter)})},
- messageSends: ["node:", "nextChild", "ast", "context"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "result",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._returnValue();
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=_st(self._context())._receiver();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.Interpreter)})},
- messageSends: ["ifNil:", "returnValue", "receiver", "context"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "returnValue",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@returnValue"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "returnValue:",
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@returnValue"]=anObject;
- return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "sendMessage:to:superSend:",
- fn: function (aMessage,anObject,aBoolean){
- var self=this;
- var method;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4,$5,$6;
- var $early={};
- try {
- $1=aBoolean;
- if(! smalltalk.assert($1)){
- $2=_st(aMessage)._sendTo_(anObject);
- return $2;
- };
- $3=_st(_st(anObject)._class())._superclass();
- if(($receiver = $3) == nil || $receiver == undefined){
- $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
- return $4;
- } else {
- $3;
- };
- method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
- return smalltalk.withContext(function($ctx2) {
- $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
- throw $early=[$5];
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
- $6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
- return $6;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.Interpreter)})},
- messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldReturn",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._returnValue())._notNil();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.Interpreter)})},
- messageSends: ["notNil", "returnValue"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "skip",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._next();
- return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.Interpreter)})},
- messageSends: ["next"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stack",
- fn: function (){
- var self=this;
- function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@stack"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@stack"]=_st($OrderedCollection())._new();
- $1=self["@stack"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.Interpreter)})},
- messageSends: ["ifNil:", "new"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "step",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=self;
- _st($1)._interpret();
- $2=_st($1)._next();
- return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.Interpreter)})},
- messageSends: ["interpret", "next"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stepOver",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._step();
- _st((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._node())._isSteppingNode();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._step();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.Interpreter)})},
- messageSends: ["step", "whileFalse:", "isSteppingNode", "node"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visit:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._shouldReturn();
- if(! smalltalk.assert($1)){
- smalltalk.NodeVisitor.fn.prototype._visit_.apply(_st(self), [aNode]);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["ifFalse:", "shouldReturn", "visit:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitAssignmentNode:",
- fn: function (aNode){
- var self=this;
- var value;
- return smalltalk.withContext(function($ctx1) {
- value=self._pop();
- self._pop();
- self._push_(value);
- self._assign_to_(_st(aNode)._left(),value);
- return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,value:value},smalltalk.Interpreter)})},
- messageSends: ["pop", "push:", "assign:to:", "left"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitBlockNode:",
- fn: function (aNode){
- var self=this;
- var blockContext,block;
- function $AIBlockClosure(){return smalltalk.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
- return smalltalk.withContext(function($ctx1) {
- block=_st($AIBlockClosure())._forContext_node_(self._context(),aNode);
- self._push_(block);
- return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,blockContext:blockContext,block:block},smalltalk.Interpreter)})},
- messageSends: ["forContext:node:", "context", "push:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- fn: function (aNode){
- var self=this;
- function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- return smalltalk.withContext(function($ctx1) {
- self._push_(_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
- return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["push:", "at:", "current", "value"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitDynamicArrayNode:",
- fn: function (aNode){
- var self=this;
- var array;
- return smalltalk.withContext(function($ctx1) {
- array=[];
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(array)._addFirst_(self._pop());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- self._push_(array);
- return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.Interpreter)})},
- messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitDynamicDictionaryNode:",
- fn: function (aNode){
- var self=this;
- var hashedCollection;
- function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
- return smalltalk.withContext(function($ctx1) {
- hashedCollection=_st($HashedCollection())._new();
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(hashedCollection)._add_(self._pop());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- self._push_(hashedCollection);
- return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,hashedCollection:hashedCollection},smalltalk.Interpreter)})},
- messageSends: ["new", "do:", "nodes", "add:", "pop", "push:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitJSStatementNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._returnValue_(self._eval_(_st(aNode)._source()));
- return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["returnValue:", "eval:", "source"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: []}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitReturnNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._returnValue_(self._pop());
- return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["returnValue:", "pop"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitSendNode:",
- fn: function (aNode){
- var self=this;
- var receiver,args,message,result;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- args=_st(_st(aNode)._arguments())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return self._pop();
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- receiver=self._pop();
- message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
- result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
- _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
- $1=_st(_st(aNode)._isCascadeSendNode())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(aNode)._isLastChild())._not();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
- if(smalltalk.assert($1)){
- self._push_(receiver);
- } else {
- self._push_(result);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.Interpreter)})},
- messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "pc:", "context", "+", "pc", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitValueNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._push_(_st(aNode)._value());
- return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["push:", "value"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "visitVariableNode:",
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$5,$4;
- $1=_st(_st(aNode)._binding())._isUnknownVar();
- if(smalltalk.assert($1)){
- $2=self._push_(_st(window)._at_ifAbsent_(_st(aNode)._value(),(function(){
- return smalltalk.withContext(function($ctx2) {
- return self._error_("Unknown variable");
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})));
- return $2;
- };
- $3=self;
- $5=_st(_st(aNode)._binding())._isInstanceVar();
- if(smalltalk.assert($5)){
- $4=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
- } else {
- $4=_st(self._context())._localAt_(_st(aNode)._value());
- };
- _st($3)._push_($4);
- return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.Interpreter)})},
- messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:"]}),
- smalltalk.Interpreter);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
- messageSends: ["interpretNode:continue:"]}),
- smalltalk.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return false;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
- messageSends: []}),
- smalltalk.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
- messageSends: ["interpretAssignmentNode:continue:"]}),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
- messageSends: []}),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
- messageSends: ["interpretBlockNode:continue:"]}),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
- messageSends: []}),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
- messageSends: ["interpretCascadeNode:continue:"]}),
- smalltalk.CascadeNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
- messageSends: ["interpretDynamicArrayNode:continue:"]}),
- smalltalk.DynamicArrayNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
- messageSends: []}),
- smalltalk.DynamicArrayNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
- messageSends: ["interpretDynamicDictionaryNode:continue:"]}),
- smalltalk.DynamicDictionaryNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
- messageSends: []}),
- smalltalk.DynamicDictionaryNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
- messageSends: ["interpretJSStatementNode:continue:"]}),
- smalltalk.JSStatementNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
- messageSends: []}),
- smalltalk.JSStatementNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
- messageSends: ["interpretMethodNode:continue:"]}),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
- messageSends: ["interpretReturnNode:continue:"]}),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
- messageSends: ["interpretSendNode:continue:"]}),
- smalltalk.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSteppingNode",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
- messageSends: []}),
- smalltalk.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
- messageSends: ["interpretSequenceNode:continue:"]}),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
- messageSends: ["interpretBlockSequenceNode:continue:"]}),
- smalltalk.BlockSequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
- messageSends: ["interpretValueNode:continue:"]}),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
- messageSends: ["interpretVariableNode:continue:"]}),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "interpreter:continue:",
- fn: function (anInterpreter,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
- messageSends: ["interpretClassReferenceNode:continue:"]}),
- smalltalk.ClassReferenceNode);
|