12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863 |
- define("amber_core/Compiler-Interpreter", ["amber/boot", "amber_core/Kernel-Methods", "amber_core/Compiler-Semantic", "amber_core/Kernel-Objects", "amber_core/Compiler-Core", "amber_core/Kernel-Exceptions", "amber_core/Compiler-AST"], function($boot){"use strict";
- var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
- $core.addPackage('Compiler-Interpreter');
- $core.packages["Compiler-Interpreter"].innerEval = function (expr) { return eval(expr); };
- $core.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber_core"};
- $core.addClass('AIBlockClosure', $globals.BlockClosure, ['node', 'outerContext'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.AIBlockClosure.comment="I am a special `BlockClosure` subclass used by an interpreter to interpret a block node.\x0a\x0aWhile I am polymorphic with `BlockClosure`, some methods such as `#new` will raise interpretation errors. Unlike a `BlockClosure`, my instance are not JavaScript functions.\x0a\x0aEvaluating an instance will result in interpreting the `node` instance variable (instance of `BlockNode`).";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "applyTo:arguments:",
- protocol: 'evaluating',
- fn: function (anObject,aCollection){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._interpreterError();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "aCollection"],
- source: "applyTo: anObject arguments: aCollection\x0a\x09self interpreterError",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["interpreterError"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "compiledSource",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return "[ AST Block closure ]";
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "compiledSource\x0a\x09\x22Unlike blocks, the receiver doesn't represent a JS function\x22\x0a\x09\x0a\x09^ '[ AST Block closure ]'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "currySelf",
- protocol: 'converting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._interpreterError();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"currySelf",{},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "currySelf\x0a\x09self interpreterError",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["interpreterError"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "initializeWithContext:node:",
- protocol: 'initialization',
- fn: function (aContext,aNode){
- var self=this;
- self["@node"]=aNode;
- self["@outerContext"]=aContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext", "aNode"],
- source: "initializeWithContext: aContext node: aNode\x0a\x09node := aNode.\x0a\x09outerContext := aContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "interpreterError",
- protocol: 'error handling',
- fn: function (){
- var self=this;
- function $ASTInterpreterError(){return $globals.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($ASTInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"interpreterError",{},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "interpreterError\x0a\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
- referencedClasses: ["ASTInterpreterError"],
- //>>excludeEnd("ide");
- messageSends: ["signal:"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "numArgs",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($recv(self["@node"])._temps())._size();
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"numArgs",{},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "numArgs\x0a\x09^ node temps size",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["size", "temps"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value",
- protocol: 'evaluating',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._valueWithPossibleArguments_([]);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "value\x0a\x09^ self valueWithPossibleArguments: #()",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["valueWithPossibleArguments:"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:",
- protocol: 'evaluating',
- fn: function (anArgument){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._valueWithPossibleArguments_([anArgument]);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:",{anArgument:anArgument},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArgument"],
- source: "value: anArgument\x0a\x09^ self valueWithPossibleArguments: {anArgument}",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["valueWithPossibleArguments:"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:value:",
- protocol: 'evaluating',
- fn: function (firstArgument,secondArgument){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._valueWithPossibleArguments_([firstArgument,secondArgument]);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArgument", "secondArgument"],
- source: "value: firstArgument value: secondArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument}",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["valueWithPossibleArguments:"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:value:value:",
- protocol: 'evaluating',
- fn: function (firstArgument,secondArgument,thirdArgument){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._valueWithPossibleArguments_([firstArgument,secondArgument,thirdArgument]);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArgument", "secondArgument", "thirdArgument"],
- source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument . thirdArgument}",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["valueWithPossibleArguments:"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "valueWithPossibleArguments:",
- protocol: 'evaluating',
- fn: function (aCollection){
- var self=this;
- var context,sequenceNode;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4,$5,$6;
- context=$recv(self["@outerContext"])._newInnerContext();
- $1=$recv($recv($recv(self["@node"])._nodes())._first())._copy();
- $recv($1)._parent_(nil);
- $2=$recv($1)._yourself();
- sequenceNode=$2;
- $recv($recv(sequenceNode)._temps())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(context)._defineLocal_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["defineLocal:"]=1;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv($recv(self["@node"])._parameters())._withIndexDo_((function(each,index){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(context)._defineLocal_(each);
- return $recv(context)._localAt_put_(each,$recv(aCollection)._at_ifAbsent_(index,(function(){
- return nil;
- })));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- $3=$recv(context)._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=1;
- //>>excludeEnd("ctx");
- $recv($3)._node_($recv(sequenceNode)._nextChild());
- $4=$recv($3)._proceed();
- $5=$recv(self["@outerContext"])._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=2;
- //>>excludeEnd("ctx");
- $recv($5)._setNonLocalReturnFromContext_(context);
- $6=$recv($recv(context)._interpreter())._pop();
- return $6;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context,sequenceNode:sequenceNode},$globals.AIBlockClosure)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "valueWithPossibleArguments: aCollection\x0a\x09| context sequenceNode |\x0a\x09context := outerContext newInnerContext.\x0a\x0a\x09\x22Interpret a copy of the sequence node to avoid creating a new AIBlockClosure\x22\x0a\x09sequenceNode := node nodes first copy\x0a\x09\x09parent: nil;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09\x22Define locals in the context\x22\x0a\x09sequenceNode temps do: [ :each |\x0a\x09\x09context defineLocal: each ].\x0a\x09\x09\x0a\x09\x22Populate the arguments into the context locals\x22\x09\x0a\x09node parameters withIndexDo: [ :each :index |\x0a\x09\x09context defineLocal: each.\x0a\x09\x09context localAt: each put: (aCollection at: index ifAbsent: [ nil ]) ].\x0a\x0a\x09\x22Interpret the first node of the BlockSequenceNode\x22\x0a\x09context interpreter\x0a\x09\x09node: sequenceNode nextChild;\x0a\x09\x09proceed.\x0a\x09\x09\x0a\x09outerContext interpreter\x0a\x09\x09setNonLocalReturnFromContext: context.\x0a\x09\x09\x0a\x09^ context interpreter pop",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["newInnerContext", "parent:", "copy", "first", "nodes", "yourself", "do:", "temps", "defineLocal:", "withIndexDo:", "parameters", "localAt:put:", "at:ifAbsent:", "node:", "interpreter", "nextChild", "proceed", "setNonLocalReturnFromContext:", "pop"]
- }),
- $globals.AIBlockClosure);
- $core.addMethod(
- $core.method({
- selector: "forContext:node:",
- protocol: 'instance creation',
- fn: function (aContext,aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=self._new();
- $recv($2)._initializeWithContext_node_(aContext,aNode);
- $3=$recv($2)._yourself();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"forContext:node:",{aContext:aContext,aNode:aNode},$globals.AIBlockClosure.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext", "aNode"],
- source: "forContext: aContext node: aNode\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext node: aNode;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["initializeWithContext:node:", "new", "yourself"]
- }),
- $globals.AIBlockClosure.klass);
- $core.addClass('AIContext', $globals.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'sendIndexes', 'evaluatedSelector', 'ast', 'interpreter', 'supercall'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "arguments",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($recv(self._ast())._arguments())._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._localAt_ifAbsent_(each,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return self._error_("Argument not in context");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"arguments",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "arguments\x0a\x09^ self ast arguments collect: [ :each |\x0a\x09\x09self localAt: each ifAbsent: [ self error: 'Argument not in context' ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["collect:", "arguments", "ast", "localAt:ifAbsent:", "error:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "ast",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4,$5,$receiver;
- $1=self._isBlockContext();
- if($core.assert($1)){
- $3=self._outerContext();
- if(($receiver = $3) == null || $receiver.isNil){
- $2=$3;
- } else {
- var context;
- context=$receiver;
- $2=$recv(context)._ast();
- };
- return $2;
- };
- $4=self["@ast"];
- if(($receiver = $4) == null || $receiver.isNil){
- self._initializeAST();
- } else {
- $4;
- };
- $5=self["@ast"];
- return $5;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ast",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "ast\x0a\x09self isBlockContext ifTrue: [ \x0a\x09\x09^ self outerContext ifNotNil: [ :context | context ast ] ].\x0a\x0a\x09ast ifNil: [ self initializeAST ].\x0a\x09^ ast",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:", "isBlockContext", "ifNotNil:", "outerContext", "ast", "ifNil:", "initializeAST"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "basicLocalAt:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(self._locals())._at_(aString);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicLocalAt:",{aString:aString},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "basicLocalAt: aString\x0a\x09^ self locals at: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:", "locals"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "basicLocalAt:put:",
- protocol: 'private',
- fn: function (aString,anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._locals())._at_put_(aString,anObject);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicLocalAt:put:",{aString:aString,anObject:anObject},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject"],
- source: "basicLocalAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:put:", "locals"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "basicReceiver",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._localAt_("self");
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicReceiver",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicReceiver\x0a\x09^ self localAt: 'self'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["localAt:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "defineLocal:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._locals())._at_put_(aString,nil);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defineLocal:",{aString:aString},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "defineLocal: aString\x0a\x09self locals at: aString put: nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:put:", "locals"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "evaluate:on:",
- protocol: 'evaluating',
- fn: function (aString,anEvaluator){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(anEvaluator)._evaluate_context_(aString,self);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"evaluate:on:",{aString:aString,anEvaluator:anEvaluator},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anEvaluator"],
- source: "evaluate: aString on: anEvaluator\x0a\x09^ anEvaluator evaluate: aString context: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["evaluate:context:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "evaluateNode:",
- protocol: 'evaluating',
- fn: function (aNode){
- var self=this;
- function $ASTInterpreter(){return $globals.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=$recv($ASTInterpreter())._new();
- $recv($2)._context_(self);
- $recv($2)._node_($recv(aNode)._nextChild());
- $recv($2)._proceed();
- $3=$recv($2)._result();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"evaluateNode:",{aNode:aNode},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "evaluateNode: aNode\x0a\x09^ ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09node: aNode nextChild;\x0a\x09\x09proceed;\x0a\x09\x09result",
- referencedClasses: ["ASTInterpreter"],
- //>>excludeEnd("ide");
- messageSends: ["context:", "new", "node:", "nextChild", "proceed", "result"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "evaluatedSelector",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@evaluatedSelector"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "evaluatedSelector\x0a\x09^ evaluatedSelector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "evaluatedSelector:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@evaluatedSelector"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "evaluatedSelector: aString\x0a\x09evaluatedSelector := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "index",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@index"];
- if(($receiver = $2) == null || $receiver.isNil){
- $1=(0);
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"index",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "index\x0a\x09^ index ifNil: [ 0 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "index:",
- protocol: 'accessing',
- fn: function (anInteger){
- var self=this;
- self["@index"]=anInteger;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInteger"],
- source: "index: anInteger\x0a\x09index := anInteger",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "initializeAST",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- function $SemanticAnalyzer(){return $globals.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._method();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["method"]=1;
- //>>excludeEnd("ctx");
- self["@ast"]=$recv($1)._ast();
- $recv($recv($SemanticAnalyzer())._on_($recv(self._method())._methodClass()))._visit_(self["@ast"]);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeAST",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeAST\x0a\x09ast := self method ast.\x0a\x09(SemanticAnalyzer on: self method methodClass)\x0a\x09\x09visit: ast",
- referencedClasses: ["SemanticAnalyzer"],
- //>>excludeEnd("ide");
- messageSends: ["ast", "method", "visit:", "on:", "methodClass"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "initializeFromMethodContext:",
- protocol: 'initialization',
- fn: function (aMethodContext){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4,$receiver;
- self._evaluatedSelector_($recv(aMethodContext)._evaluatedSelector());
- self._index_($recv(aMethodContext)._index());
- self._sendIndexes_($recv(aMethodContext)._sendIndexes());
- self._receiver_($recv(aMethodContext)._receiver());
- self._supercall_($recv(aMethodContext)._supercall());
- $1=self._selector_($recv(aMethodContext)._selector());
- $2=$recv(aMethodContext)._outerContext();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["outerContext"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $2) == null || $receiver.isNil){
- $2;
- } else {
- var outer;
- outer=$receiver;
- $3=$recv(outer)._methodContext();
- if(($receiver = $3) == null || $receiver.isNil){
- $3;
- } else {
- self._outerContext_($recv(self._class())._fromMethodContext_($recv(aMethodContext)._outerContext()));
- };
- $4=$recv(aMethodContext)._locals();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["locals"]=1;
- //>>excludeEnd("ctx");
- $recv($4)._keysAndValuesDo_((function(key,value){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._locals())._at_put_(key,value);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethodContext"],
- source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09evaluatedSelector: aMethodContext evaluatedSelector;\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09sendIndexes: aMethodContext sendIndexes;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09supercall: aMethodContext supercall;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\x0a\x09aMethodContext outerContext ifNotNil: [ :outer |\x0a\x09\x09\x22If the method context is nil, the block was defined in JS, so ignore it\x22\x0a\x09\x09outer methodContext ifNotNil: [\x0a\x09\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09\x09\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09self locals at: key put: value ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["evaluatedSelector:", "evaluatedSelector", "index:", "index", "sendIndexes:", "sendIndexes", "receiver:", "receiver", "supercall:", "supercall", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "initializeInterpreter",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- function $ASTInterpreter(){return $globals.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$receiver;
- $1=$recv($ASTInterpreter())._new();
- $recv($1)._context_(self);
- $2=$recv($1)._yourself();
- self["@interpreter"]=$2;
- $3=self._innerContext();
- if(($receiver = $3) == null || $receiver.isNil){
- $3;
- } else {
- self._setupInterpreter_(self["@interpreter"]);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09yourself.\x0a\x09\x0a\x09self innerContext ifNotNil: [\x0a\x09\x09self setupInterpreter: interpreter ]",
- referencedClasses: ["ASTInterpreter"],
- //>>excludeEnd("ide");
- messageSends: ["context:", "new", "yourself", "ifNotNil:", "innerContext", "setupInterpreter:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "initializeLocals",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self["@locals"]=$recv($Dictionary())._new();
- $recv(self["@locals"])._at_put_("thisContext",self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
- referencedClasses: ["Dictionary"],
- //>>excludeEnd("ide");
- messageSends: ["new", "at:put:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "innerContext",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@innerContext"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "innerContext\x0a\x09^ innerContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "innerContext:",
- protocol: 'accessing',
- fn: function (anAIContext){
- var self=this;
- self["@innerContext"]=anAIContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anAIContext"],
- source: "innerContext: anAIContext\x0a\x09innerContext := anAIContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "interpreter",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$receiver;
- $1=self["@interpreter"];
- if(($receiver = $1) == null || $receiver.isNil){
- self._initializeInterpreter();
- } else {
- $1;
- };
- $2=self["@interpreter"];
- return $2;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"interpreter",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "interpreter\x0a\x09interpreter ifNil: [ self initializeInterpreter ].\x0a\x09^ interpreter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "initializeInterpreter"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "interpreter:",
- protocol: 'interpreting',
- fn: function (anInterpreter){
- var self=this;
- self["@interpreter"]=anInterpreter;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInterpreter"],
- source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "isTopContext",
- protocol: 'testing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(self._innerContext())._isNil();
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"isTopContext",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isTopContext\x0a\x09^ self innerContext isNil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["isNil", "innerContext"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "localAt:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- var context;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- context=self._lookupContextForLocal_(aString);
- $1=$recv(context)._basicLocalAt_(aString);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString,context:context},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "localAt: aString\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09| context |\x0a\x09\x0a\x09context := self lookupContextForLocal: aString.\x0a\x09^ context basicLocalAt: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lookupContextForLocal:", "basicLocalAt:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "localAt:ifAbsent:",
- protocol: 'accessing',
- fn: function (aString,aBlock){
- var self=this;
- var context;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- var $early={};
- try {
- context=self._lookupContextForLocal_ifNone_(aString,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(aBlock)._value();
- throw $early=[$1];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $2=$recv(context)._basicLocalAt_(aString);
- return $2;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"localAt:ifAbsent:",{aString:aString,aBlock:aBlock,context:context},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "aBlock"],
- source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09| context |\x0a\x09\x0a\x09context := self \x09\x0a\x09\x09lookupContextForLocal: aString \x0a\x09\x09ifNone: [ ^ aBlock value ].\x0a\x09\x0a\x09^ context basicLocalAt: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lookupContextForLocal:ifNone:", "value", "basicLocalAt:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "localAt:put:",
- protocol: 'accessing',
- fn: function (aString,anObject){
- var self=this;
- var context;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- context=self._lookupContextForLocal_(aString);
- $recv(context)._basicLocalAt_put_(aString,anObject);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject,context:context},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject"],
- source: "localAt: aString put: anObject\x0a\x09| context |\x0a\x09\x0a\x09context := self lookupContextForLocal: aString.\x0a\x09context basicLocalAt: aString put: anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lookupContextForLocal:", "basicLocalAt:put:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "locals",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$receiver;
- $1=self["@locals"];
- if(($receiver = $1) == null || $receiver.isNil){
- self._initializeLocals();
- } else {
- $1;
- };
- $2=self["@locals"];
- return $2;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"locals",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "initializeLocals"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "lookupContextForLocal:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._lookupContextForLocal_ifNone_(aString,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._variableNotFound();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"lookupContextForLocal:",{aString:aString},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "lookupContextForLocal: aString\x0a\x09\x22Lookup the context defining the local named `aString` \x0a\x09up to the method context\x22\x0a\x0a\x09^ self \x0a\x09\x09lookupContextForLocal: aString \x0a\x09\x09ifNone: [ self variableNotFound ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lookupContextForLocal:ifNone:", "variableNotFound"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "lookupContextForLocal:ifNone:",
- protocol: 'private',
- fn: function (aString,aBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- $1=$recv(self._locals())._at_ifPresent_ifAbsent_(aString,(function(){
- return self;
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $2=self._outerContext();
- return $recv($2)._ifNil_ifNotNil_(aBlock,(function(context){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(context)._lookupContextForLocal_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({context:context},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"lookupContextForLocal:ifNone:",{aString:aString,aBlock:aBlock},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "aBlock"],
- source: "lookupContextForLocal: aString ifNone: aBlock\x0a\x09\x22Lookup the context defining the local named `aString` \x0a\x09up to the method context\x22\x0a\x0a\x09^ self locals \x0a\x09\x09at: aString\x0a\x09\x09ifPresent: [ self ]\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09self outerContext \x0a\x09\x09\x09\x09ifNil: aBlock\x0a\x09\x09\x09\x09ifNotNil: [ :context | \x0a\x09\x09\x09\x09\x09context lookupContextForLocal: aString ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:ifPresent:ifAbsent:", "locals", "ifNil:ifNotNil:", "outerContext", "lookupContextForLocal:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "newInnerContext",
- protocol: 'factory',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=$recv(self._class())._new();
- $recv($2)._outerContext_(self);
- $3=$recv($2)._yourself();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"newInnerContext",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "newInnerContext\x0a\x09^ self class new\x0a\x09\x09outerContext: self;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["outerContext:", "new", "class", "yourself"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "outerContext",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@outerContext"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "outerContext\x0a\x09^ outerContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "outerContext:",
- protocol: 'accessing',
- fn: function (anAIContext){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- self["@outerContext"]=anAIContext;
- $1=self["@outerContext"];
- if(($receiver = $1) == null || $receiver.isNil){
- $1;
- } else {
- var context;
- context=$receiver;
- $recv(context)._innerContext_(self);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anAIContext"],
- source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext.\x0a\x09outerContext ifNotNil: [ :context | \x0a\x09\x09context innerContext: self ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotNil:", "innerContext:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "receiver:",
- protocol: 'interpreting',
- fn: function (anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._locals())._at_put_("self",anObject);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "receiver: anObject\x0a\x09self locals at: 'self' put: anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:put:", "locals"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@selector"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@selector"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "sendIndexAt:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(self._sendIndexes())._at_ifAbsent_(aString,(function(){
- return (0);
- }));
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendIndexAt:",{aString:aString},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "sendIndexAt: aString\x0a\x09^ self sendIndexes at: aString ifAbsent: [ 0 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:ifAbsent:", "sendIndexes"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "sendIndexes",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@sendIndexes"];
- if(($receiver = $2) == null || $receiver.isNil){
- $1=$recv($Dictionary())._new();
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendIndexes",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "sendIndexes\x0a\x09^ sendIndexes ifNil: [ Dictionary new ]",
- referencedClasses: ["Dictionary"],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "new"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "sendIndexes:",
- protocol: 'accessing',
- fn: function (aDictionary){
- var self=this;
- self["@sendIndexes"]=aDictionary;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aDictionary"],
- source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "setupInterpreter:",
- protocol: 'interpreting',
- fn: function (anInterpreter){
- var self=this;
- var currentNode;
- function $ASTPCNodeVisitor(){return $globals.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4,$5,$8,$7,$6,$receiver;
- $1=$recv($ASTPCNodeVisitor())._new();
- $recv($1)._selector_(self._evaluatedSelector());
- $recv($1)._context_(self);
- $2=$1;
- $3=self._ast();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["ast"]=1;
- //>>excludeEnd("ctx");
- $recv($2)._visit_($3);
- $4=$recv($1)._currentNode();
- currentNode=$4;
- $5=$recv(self._ast())._sequenceNode();
- if(($receiver = $5) == null || $receiver.isNil){
- $5;
- } else {
- var sequence;
- sequence=$receiver;
- $recv($recv(sequence)._temps())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._defineLocal_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["do:"]=1;
- //>>excludeEnd("ctx");
- };
- $recv(anInterpreter)._node_(currentNode);
- $8=self._innerContext();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["innerContext"]=1;
- //>>excludeEnd("ctx");
- $7=$recv($8)._arguments();
- $6=$recv($7)._reversed();
- $recv($6)._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(anInterpreter)._push_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["push:"]=1;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $recv(anInterpreter)._push_($recv(self._innerContext())._receiver());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter,currentNode:currentNode},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInterpreter"],
- source: "setupInterpreter: anInterpreter\x0a\x09| currentNode |\x0a\x09\x0a\x09\x22Retrieve the current node\x22\x0a\x09currentNode := ASTPCNodeVisitor new\x0a\x09\x09\x09selector: self evaluatedSelector;\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode.\x0a\x09\x0a\x09\x22Define locals for the context\x22\x0a\x09self ast sequenceNode ifNotNil: [ :sequence |\x0a\x09\x09sequence temps do: [ :each |\x0a\x09\x09\x09self defineLocal: each ] ].\x0a\x09\x0a\x09anInterpreter node: currentNode.\x0a\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
- referencedClasses: ["ASTPCNodeVisitor"],
- //>>excludeEnd("ide");
- messageSends: ["selector:", "new", "evaluatedSelector", "context:", "visit:", "ast", "currentNode", "ifNotNil:", "sequenceNode", "do:", "temps", "defineLocal:", "node:", "reversed", "arguments", "innerContext", "push:", "receiver"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "supercall",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@supercall"];
- if(($receiver = $2) == null || $receiver.isNil){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"supercall",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "supercall\x0a\x09^ supercall ifNil: [ false ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "supercall:",
- protocol: 'interpreting',
- fn: function (aBoolean){
- var self=this;
- self["@supercall"]=aBoolean;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBoolean"],
- source: "supercall: aBoolean\x0a\x09supercall := aBoolean",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "variableNotFound",
- protocol: 'error handling',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._error_("Variable missing");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"variableNotFound",{},$globals.AIContext)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "variableNotFound\x0a\x09\x22Error thrown whenever a variable lookup fails\x22\x0a\x09\x0a\x09self error: 'Variable missing'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["error:"]
- }),
- $globals.AIContext);
- $core.addMethod(
- $core.method({
- selector: "fromMethodContext:",
- protocol: 'instance creation',
- fn: function (aMethodContext){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=self._new();
- $recv($2)._initializeFromMethodContext_(aMethodContext);
- $3=$recv($2)._yourself();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},$globals.AIContext.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethodContext"],
- source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["initializeFromMethodContext:", "new", "yourself"]
- }),
- $globals.AIContext.klass);
- $core.addClass('AISemanticAnalyzer', $globals.SemanticAnalyzer, ['context'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.AISemanticAnalyzer.comment="I perform the same semantic analysis than `SemanticAnalyzer`, with the difference that provided an `AIContext` context, variables are bound with the context variables.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "context",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@context"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "context\x0a\x09^ context",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AISemanticAnalyzer);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'accessing',
- fn: function (anAIContext){
- var self=this;
- self["@context"]=anAIContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anAIContext"],
- source: "context: anAIContext\x0a\x09context := anAIContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AISemanticAnalyzer);
- $core.addMethod(
- $core.method({
- selector: "visitVariableNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- function $ASTContextVar(){return $globals.ASTContextVar||(typeof ASTContextVar=="undefined"?nil:ASTContextVar)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- var $early={};
- try {
- $recv(self._context())._localAt_ifAbsent_($recv(aNode)._value(),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.supercall = true,
- //>>excludeEnd("ctx");
- $globals.AISemanticAnalyzer.superclass.fn.prototype._visitVariableNode_.apply($recv(self), [aNode]));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.supercall = false;
- //>>excludeEnd("ctx");;
- throw $early=[$1];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv(aNode)._binding_($recv($ASTContextVar())._new());
- return self;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.AISemanticAnalyzer)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09self context \x0a\x09\x09localAt: aNode value \x0a\x09\x09ifAbsent: [ ^ super visitVariableNode: aNode ].\x0a\x0a\x09aNode binding: ASTContextVar new",
- referencedClasses: ["ASTContextVar"],
- //>>excludeEnd("ide");
- messageSends: ["localAt:ifAbsent:", "context", "value", "visitVariableNode:", "binding:", "new"]
- }),
- $globals.AISemanticAnalyzer);
- $core.addClass('ASTContextVar', $globals.ScopeVar, ['context'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ASTContextVar.comment="I am a variable defined in a `context`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "context",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@context"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "context\x0a\x09^ context",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTContextVar);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'accessing',
- fn: function (anObject){
- var self=this;
- self["@context"]=anObject;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "context: anObject\x0a\x09context := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTContextVar);
- $core.addClass('ASTDebugger', $globals.Object, ['interpreter', 'context', 'result'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from an `AIContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "atEnd",
- protocol: 'testing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$receiver;
- $1=self._context();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["context"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $1) == null || $receiver.isNil){
- return true;
- } else {
- $1;
- };
- $2=$recv($recv(self._interpreter())._atEnd())._and_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._context())._isTopContext();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return $2;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"atEnd",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "atEnd\x09\x0a\x09self context ifNil: [ ^ true ].\x0a\x09\x0a\x09^ self interpreter atEnd and: [ \x0a\x09\x09self context isTopContext ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "context", "and:", "atEnd", "interpreter", "isTopContext"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "context",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@context"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "context\x0a\x09^ context",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'accessing',
- fn: function (aContext){
- var self=this;
- self["@context"]=aContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext"],
- source: "context: aContext\x0a\x09context := aContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "flushInnerContexts",
- protocol: 'actions',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=self._context();
- if(($receiver = $1) == null || $receiver.isNil){
- $1;
- } else {
- var cxt;
- cxt=$receiver;
- $recv(cxt)._innerContext_(nil);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "flushInnerContexts\x0a\x09\x22When stepping, the inner contexts are not relevent anymore,\x0a\x09and can be flushed\x22\x0a\x09\x0a\x09self context ifNotNil: [ :cxt | \x0a\x09\x09cxt innerContext: nil ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotNil:", "context", "innerContext:"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "interpreter",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self._context();
- if(($receiver = $2) == null || $receiver.isNil){
- $1=$2;
- } else {
- var ctx;
- ctx=$receiver;
- $1=$recv(ctx)._interpreter();
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"interpreter",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "interpreter\x0a\x09^ self context ifNotNil: [ :ctx | \x0a\x09\x09ctx interpreter ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotNil:", "context", "interpreter"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "method",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(self._context())._method();
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"method",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "method\x0a\x09^ self context method",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["method", "context"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "node",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $2) == null || $receiver.isNil){
- $1=$2;
- } else {
- $1=$recv(self._interpreter())._node();
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"node",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "node\x0a\x09^ self interpreter ifNotNil: [\x0a\x09\x09self interpreter node ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotNil:", "interpreter", "node"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "onStep",
- protocol: 'private',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4,$6,$5,$receiver;
- $1=self._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=1;
- //>>excludeEnd("ctx");
- self["@result"]=$recv($1)._result();
- $3=self._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=2;
- //>>excludeEnd("ctx");
- $2=$recv($3)._atEnd();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["atEnd"]=1;
- //>>excludeEnd("ctx");
- if($core.assert($2)){
- $4=$recv(self._context())._outerContext();
- if(($receiver = $4) == null || $receiver.isNil){
- $4;
- } else {
- var outerContext;
- outerContext=$receiver;
- self._context_(outerContext);
- };
- $6=self._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=3;
- //>>excludeEnd("ctx");
- $5=$recv($6)._atEnd();
- if(!$core.assert($5)){
- $recv(self._interpreter())._skip();
- };
- };
- self._flushInnerContexts();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"onStep",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "onStep\x0a\x09\x22After each step, check if the interpreter is at the end,\x0a\x09and if it is move to its outer context if any, skipping its \x0a\x09current node (which was just evaluated by the current \x0a\x09interpreter).\x0a\x09\x0a\x09After each step we also flush inner contexts.\x22\x0a\x09\x0a\x09result := self interpreter result.\x0a\x09\x0a\x09self interpreter atEnd ifTrue: [\x0a\x09\x09self context outerContext ifNotNil: [ :outerContext | \x0a\x09\x09\x09self context: outerContext ].\x0a\x09\x09self interpreter atEnd ifFalse: [ self interpreter skip ] ].\x0a\x09\x09\x0a\x09self flushInnerContexts",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["result", "interpreter", "ifTrue:", "atEnd", "ifNotNil:", "outerContext", "context", "context:", "ifFalse:", "skip", "flushInnerContexts"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "proceed",
- protocol: 'stepping',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._atEnd();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._stepOver();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "proceed\x0a\x09[ self atEnd ] whileFalse: [ self stepOver ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["whileFalse:", "atEnd", "stepOver"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "restart",
- protocol: 'stepping',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._interpreter())._restart();
- self._flushInnerContexts();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"restart",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "restart\x0a\x09self interpreter restart.\x0a\x09self flushInnerContexts",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["restart", "interpreter", "flushInnerContexts"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "result",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@result"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "result\x0a\x09^ result",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "stepInto",
- protocol: 'stepping',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._shouldBeImplemented();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"stepInto",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "stepInto\x0a\x09self shouldBeImplemented",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["shouldBeImplemented"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "stepOver",
- protocol: 'stepping',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv(self._context())._isTopContext();
- if($core.assert($1)){
- $recv(self._interpreter())._stepOver();
- } else {
- $2=self._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=1;
- //>>excludeEnd("ctx");
- $recv($2)._skip();
- };
- self._onStep();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"stepOver",{},$globals.ASTDebugger)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "stepOver\x0a\x09self context isTopContext \x0a\x09\x09ifFalse: [ self interpreter skip ]\x0a\x09\x09ifTrue: [ self interpreter stepOver ].\x0a\x09self onStep",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifFalse:ifTrue:", "isTopContext", "context", "skip", "interpreter", "stepOver", "onStep"]
- }),
- $globals.ASTDebugger);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'instance creation',
- fn: function (aContext){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=self._new();
- $recv($2)._context_(aContext);
- $3=$recv($2)._yourself();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},$globals.ASTDebugger.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext"],
- source: "context: aContext\x0a\x09^ self new\x0a\x09\x09context: aContext;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["context:", "new", "yourself"]
- }),
- $globals.ASTDebugger.klass);
- $core.addClass('ASTInterpreter', $globals.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned', 'forceAtEnd'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ASTInterpreter.comment="I visit an AST, interpreting (evaluating) nodes one after the other, using a small stack machine.\x0a\x0a## API\x0a\x0aWhile my instances should be used from within an `ASTDebugger`, which provides a more high level interface,\x0ayou can use methods from the `interpreting` protocol:\x0a\x0a- `#step` evaluates the current `node` only\x0a- `#stepOver` evaluates the AST from the current `node` up to the next stepping node (most likely the next send node)\x0a- `#proceed` evaluates eagerly the AST\x0a- `#restart` select the first node of the AST\x0a- `#skip` skips the current node, moving to the next one if any";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "assign:to:",
- protocol: 'private',
- fn: function (aNode,anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4;
- $1=$recv($recv(aNode)._binding())._isInstanceVar();
- if($core.assert($1)){
- $3=self._context();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["context"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._receiver();
- $4=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["value"]=1;
- //>>excludeEnd("ctx");
- $recv($2)._instVarAt_put_($4,anObject);
- } else {
- $recv(self._context())._localAt_put_($recv(aNode)._value(),anObject);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode", "anObject"],
- source: "assign: aNode to: anObject\x0a\x09aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "atEnd",
- protocol: 'testing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=self["@forceAtEnd"];
- if($core.assert($1)){
- return true;
- };
- $2=$recv(self._hasReturned())._or_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._node())._isNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return $2;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"atEnd",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "atEnd\x0a\x09forceAtEnd ifTrue: [ ^ true ].\x0a\x09\x0a\x09^ self hasReturned or: [ self node isNil ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:", "or:", "hasReturned", "isNil", "node"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "context",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@context"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "context\x0a\x09^ context",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'accessing',
- fn: function (aContext){
- var self=this;
- self["@context"]=aContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext"],
- source: "context: aContext\x0a\x09context := aContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "eval:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- var source,function_;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $3,$2,$1,$4,$5;
- source=$recv($String())._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(str)._nextPutAll_("0,(function(");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $3=self._context();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["context"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._locals();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["locals"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._keys();
- $recv($1)._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(str)._nextPutAll_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(str)._nextPutAll_(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- $recv(str)._nextPutAll_("){ return (function() {");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(str)._nextPutAll_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=5;
- //>>excludeEnd("ctx");
- $4=$recv(str)._nextPutAll_("})()})");
- return $4;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- function_=$recv($recv($Compiler())._new())._eval_(source);
- $5=$recv(function_)._valueWithPossibleArguments_($recv($recv(self._context())._locals())._values());
- return $5;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function.\x0a\x09aString is not sandboxed.\x22\x0a\x09\x0a\x09| source function |\x0a\x09\x0a\x09source := String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '0,(function('.\x0a\x09\x09self context locals keys\x0a\x09\x09\x09do: [ :each | str nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ str nextPutAll: ',' ].\x0a\x09\x09str\x0a\x09\x09\x09nextPutAll: '){ return (function() {';\x0a\x09\x09\x09nextPutAll: aString;\x0a\x09\x09\x09nextPutAll: '})()})' ].\x0a\x09\x09\x09\x0a\x09function := Compiler new eval: source.\x0a\x09\x0a\x09^ function valueWithPossibleArguments: self context locals values",
- referencedClasses: ["String", "Compiler"],
- //>>excludeEnd("ide");
- messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "hasReturned",
- protocol: 'testing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@returned"];
- if(($receiver = $2) == null || $receiver.isNil){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- $globals.ASTInterpreter.superclass.fn.prototype._initialize.apply($recv(self), []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- self["@forceAtEnd"]=false;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x0a\x09forceAtEnd := false",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["initialize"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "interpret",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._visit_(self._node());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"interpret",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["visit:", "node"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "interpret:",
- protocol: 'interpreting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._node_(aNode);
- self._interpret();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["node:", "interpret"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "messageFromSendNode:arguments:",
- protocol: 'private',
- fn: function (aSendNode,aCollection){
- var self=this;
- function $Message(){return $globals.Message||(typeof Message=="undefined"?nil:Message)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$1;
- $2=$recv($Message())._new();
- $recv($2)._selector_($recv(aSendNode)._selector());
- $recv($2)._arguments_(aCollection);
- $3=$recv($2)._yourself();
- $1=$3;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSendNode", "aCollection"],
- source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
- referencedClasses: ["Message"],
- //>>excludeEnd("ide");
- messageSends: ["selector:", "new", "selector", "arguments:", "yourself"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "messageNotUnderstood:receiver:",
- protocol: 'private',
- fn: function (aMessage,anObject){
- var self=this;
- function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv($MessageNotUnderstood())._new();
- $recv($1)._meesage_(aMessage);
- $recv($1)._receiver_(anObject);
- $2=$recv($1)._signal();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMessage", "anObject"],
- source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
- referencedClasses: ["MessageNotUnderstood"],
- //>>excludeEnd("ide");
- messageSends: ["meesage:", "new", "receiver:", "signal"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "next",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._node_($recv(self._node())._nextNode());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"next",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "next\x0a\x09self node: self node nextNode",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["node:", "nextNode", "node"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "node",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@node"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "node:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- self["@node"]=aNode;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "node: aNode\x0a\x09node := aNode",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "peek",
- protocol: 'stack',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- var $early={};
- try {
- $1=self._stack();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["stack"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._ifEmpty_((function(){
- throw $early=[nil];
- }));
- $2=$recv(self._stack())._last();
- return $2;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"peek",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "peek\x0a\x09\x22Peek the top object of the context stack\x22\x0a\x09\x0a\x09self stack ifEmpty: [ ^ nil ].\x0a\x09\x0a\x09^ self stack last",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifEmpty:", "stack", "last"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "pop",
- protocol: 'stack',
- fn: function (){
- var self=this;
- var peekedValue;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- peekedValue=self._peek();
- $recv(self._stack())._removeLast();
- $1=peekedValue;
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "pop\x0a\x09\x22Pop an object from the context stack\x22\x0a\x09\x0a\x09| peekedValue |\x0a\x09\x0a\x09peekedValue := self peek.\x0a\x09self stack removeLast.\x0a\x09^ peekedValue",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["peek", "removeLast", "stack"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "proceed",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._atEnd();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._step();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] \x0a\x09\x09whileFalse: [ self step ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["whileFalse:", "atEnd", "step"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "push:",
- protocol: 'stack',
- fn: function (anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(self._stack())._add_(anObject);
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["add:", "stack"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "restart",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._node_($recv($recv(self._context())._ast())._nextChild());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"restart",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "restart\x0a\x09self node: self context ast nextChild",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["node:", "nextChild", "ast", "context"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "result",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- $2=self._hasReturned();
- if($core.assert($2)){
- $1=self._returnValue();
- } else {
- $1=$recv(self._context())._receiver();
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"result",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "returnValue",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@returnValue"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "returnValue\x0a\x09^ returnValue",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "returnValue:",
- protocol: 'accessing',
- fn: function (anObject){
- var self=this;
- self["@returnValue"]=anObject;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "returnValue: anObject\x0a\x09returnValue := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "sendMessage:to:superSend:",
- protocol: 'private',
- fn: function (aMessage,anObject,aBoolean){
- var self=this;
- var method;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4,$5,$6,$receiver;
- var $early={};
- try {
- if(!$core.assert(aBoolean)){
- $1=$recv(aMessage)._sendTo_(anObject);
- return $1;
- };
- $3=$recv(anObject)._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._superclass();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["superclass"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $2) == null || $receiver.isNil){
- $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["messageNotUnderstood:receiver:"]=1;
- //>>excludeEnd("ctx");
- return $4;
- } else {
- $2;
- };
- method=$recv($recv($recv($recv(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_($recv(aMessage)._selector(),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
- throw $early=[$5];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $6=$recv(method)._sendTo_arguments_(anObject,$recv(aMessage)._arguments());
- return $6;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMessage", "anObject", "aBoolean"],
- source: "sendMessage: aMessage to: anObject superSend: aBoolean\x0a\x09| method |\x0a\x09\x0a\x09aBoolean ifFalse: [ ^ aMessage sendTo: anObject ].\x0a\x09anObject class superclass ifNil: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x0a\x09method := anObject class superclass methodDictionary\x0a\x09\x09at: aMessage selector\x0a\x09\x09ifAbsent: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x09\x0a\x09^ method sendTo: anObject arguments: aMessage arguments",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "setNonLocalReturnFromContext:",
- protocol: 'interpreting',
- fn: function (aContext){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- $2=$recv(aContext)._interpreter();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["interpreter"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._hasReturned();
- if($core.assert($1)){
- self["@returned"]=true;
- self["@returned"];
- self._returnValue_($recv($recv(aContext)._interpreter())._returnValue());
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext"],
- source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "skip",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._next();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"skip",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "skip\x0a\x09self next",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["next"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "stack",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@stack"];
- if(($receiver = $2) == null || $receiver.isNil){
- self["@stack"]=$recv($OrderedCollection())._new();
- $1=self["@stack"];
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"stack",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
- referencedClasses: ["OrderedCollection"],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "new"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "step",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- self._interpret();
- $1=self._next();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"step",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["interpret", "next"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "stepOver",
- protocol: 'interpreting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- self._step();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["step"]=1;
- //>>excludeEnd("ctx");
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $2=self._node();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["node"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._isNil();
- return $recv($1)._or_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(self._node())._isSteppingNode();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._step();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"stepOver",{},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isNil or: [ self node isSteppingNode ] ] whileFalse: [ \x0a\x09\x09self step ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["step", "whileFalse:", "or:", "isNil", "node", "isSteppingNode"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visit:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._hasReturned();
- if(!$core.assert($1)){
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- $globals.ASTInterpreter.superclass.fn.prototype._visit_.apply($recv(self), [aNode]));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifFalse:", "hasReturned", "visit:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitAssignmentNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var poppedValue;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- poppedValue=self._pop();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["pop"]=1;
- //>>excludeEnd("ctx");
- self._pop();
- self._push_(poppedValue);
- self._assign_to_($recv(aNode)._left(),poppedValue);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a\x09| poppedValue |\x0a\x09\x0a\x09poppedValue := self pop.\x0a\x09\x0a\x09\x22Pop the left side of the assignment.\x0a\x09It already has been visited, and we don't need its value.\x22\x0a\x09self pop.\x0a\x09\x0a\x09self push: poppedValue.\x0a\x09self assign: aNode left to: poppedValue",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["pop", "push:", "assign:to:", "left"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitBlockNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var block;
- function $AIBlockClosure(){return $globals.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- block=$recv($AIBlockClosure())._forContext_node_(self._context(),aNode);
- self._push_(block);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a\x09\x22Do not evaluate the block node.\x0a\x09Instead, put all instructions into a block that we push to the stack for later evaluation\x22\x0a\x09\x0a\x09| block |\x0a\x09\x0a\x09block := AIBlockClosure forContext: self context node: aNode.\x0a\x09\x0a\x09self push: block",
- referencedClasses: ["AIBlockClosure"],
- //>>excludeEnd("ide");
- messageSends: ["forContext:node:", "context", "push:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitBlockSequenceNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- $globals.ASTInterpreter.superclass.fn.prototype._visitBlockSequenceNode_.apply($recv(self), [aNode]));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- self["@forceAtEnd"]=true;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitBlockSequenceNode: aNode\x0a\x09\x22If the receiver is actually visiting a BlockSequenceNode,\x0a\x09it means the the context is a block context. Evaluation should \x0a\x09stop right after evaluating the block sequence and the outer\x0a\x09context's interpreter should take over. \x0a\x09Therefore we force #atEnd.\x22\x0a\x09\x0a\x09super visitBlockSequenceNode: aNode.\x0a\x09forceAtEnd := true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["visitBlockSequenceNode:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitDynamicArrayNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var array;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- array=[];
- $recv($recv(aNode)._nodes())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(array)._addFirst_(self._pop());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- self._push_(array);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09\x0a\x09array := #().\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09array addFirst: self pop ].\x0a\x09\x0a\x09self push: array",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitDynamicDictionaryNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var keyValueList;
- function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- keyValueList=$recv($OrderedCollection())._new();
- $recv($recv(aNode)._nodes())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(keyValueList)._add_(self._pop());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- self._push_($recv($HashedCollection())._newFromPairs_($recv(keyValueList)._reversed()));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,keyValueList:keyValueList},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitDynamicDictionaryNode: aNode\x0a\x09| keyValueList |\x0a\x09\x0a\x09keyValueList := OrderedCollection new.\x0a\x09\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09keyValueList add: self pop ].\x0a\x09\x0a\x09self push: (HashedCollection newFromPairs: keyValueList reversed)",
- referencedClasses: ["OrderedCollection", "HashedCollection"],
- //>>excludeEnd("ide");
- messageSends: ["new", "do:", "nodes", "add:", "pop", "push:", "newFromPairs:", "reversed"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitJSStatementNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self["@returned"]=true;
- self._returnValue_(self._eval_($recv(aNode)._source()));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["returnValue:", "eval:", "source"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitReturnNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self["@returned"]=true;
- self._returnValue_(self._pop());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["returnValue:", "pop"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitSendNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var receiver,args,message,result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- args=$recv($recv(aNode)._arguments())._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._pop();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["pop"]=1;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- receiver=self._pop();
- message=self._messageFromSendNode_arguments_(aNode,$recv(args)._reversed());
- result=self._sendMessage_to_superSend_(message,receiver,$recv(aNode)._superSend());
- $1=$recv($recv(aNode)._isCascadeSendNode())._and_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(aNode)._isLastChild())._not();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- if($core.assert($1)){
- self._push_(receiver);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["push:"]=1;
- //>>excludeEnd("ctx");
- } else {
- self._push_(result);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x09| receiver args message result |\x0a\x09\x0a\x09args := aNode arguments collect: [ :each | self pop ].\x0a\x09receiver := self pop.\x0a\x09\x0a\x09message := self\x0a\x09\x09messageFromSendNode: aNode\x0a\x09\x09arguments: args reversed.\x0a\x09\x0a\x09result := self sendMessage: message to: receiver superSend: aNode superSend.\x0a\x09\x0a\x09\x22For cascade sends, push the reciever if the send is not the last one\x22\x0a\x09(aNode isCascadeSendNode and: [ aNode isLastChild not ])\x0a\x09\x09ifTrue: [ self push: receiver ]\x0a\x09\x09ifFalse: [ self push: result ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitSequenceNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv(aNode)._temps())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._context())._defineLocal_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [ :each |\x0a\x09\x09self context defineLocal: each ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["do:", "temps", "defineLocal:", "context"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitValueNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._push_($recv(aNode)._value());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09self push: aNode value",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["push:", "value"]
- }),
- $globals.ASTInterpreter);
- $core.addMethod(
- $core.method({
- selector: "visitVariableNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- function $Platform(){return $globals.Platform||(typeof Platform=="undefined"?nil:Platform)}
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$5,$6,$4,$3,$8,$10,$9,$11,$12,$13,$15,$14,$16,$17,$7;
- $2=$recv(aNode)._binding();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["binding"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._isUnknownVar();
- if($core.assert($1)){
- $5=$recv($Platform())._globals();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["globals"]=1;
- //>>excludeEnd("ctx");
- $6=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["value"]=1;
- //>>excludeEnd("ctx");
- $4=$recv($5)._at_ifAbsent_($6,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._error_("Unknown variable");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:ifAbsent:"]=1;
- //>>excludeEnd("ctx");
- $3=self._push_($4);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["push:"]=1;
- //>>excludeEnd("ctx");
- return $3;
- };
- $8=$recv($recv(aNode)._binding())._isInstanceVar();
- if($core.assert($8)){
- $10=self._context();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["context"]=1;
- //>>excludeEnd("ctx");
- $9=$recv($10)._receiver();
- $11=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["value"]=2;
- //>>excludeEnd("ctx");
- $7=$recv($9)._instVarAt_($11);
- } else {
- $12=self._context();
- $13=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["value"]=3;
- //>>excludeEnd("ctx");
- $7=$recv($12)._localAt_ifAbsent_($13,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $15=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["value"]=4;
- //>>excludeEnd("ctx");
- $14=$recv($15)._isCapitalized();
- if($core.assert($14)){
- $16=$recv($Smalltalk())._globals();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["globals"]=2;
- //>>excludeEnd("ctx");
- $17=$recv(aNode)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["value"]=5;
- //>>excludeEnd("ctx");
- return $recv($16)._at_ifAbsent_($17,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv($recv($Platform())._globals())._at_($recv(aNode)._value());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)});
- //>>excludeEnd("ctx");
- }));
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
- //>>excludeEnd("ctx");
- }));
- };
- self._push_($7);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.ASTInterpreter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (Platform globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk globals \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ Platform globals at: aNode value ] ] ] ])",
- referencedClasses: ["Platform", "Smalltalk"],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:ifAbsent:", "isCapitalized", "at:"]
- }),
- $globals.ASTInterpreter);
- $core.addClass('ASTInterpreterError', $globals.Error, [], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
- //>>excludeEnd("ide");
- $core.addClass('ASTPCNodeVisitor', $globals.NodeVisitor, ['context', 'index', 'selector', 'currentNode'], 'Compiler-Interpreter');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ASTPCNodeVisitor.comment="I visit an AST until I get to the current node for the `context` and answer it.\x0a\x0a## API\x0a\x0aMy instances must be filled with a context object using `#context:`.\x0a\x0aAfter visiting the AST the current node is answered by `#currentNode`";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "context",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@context"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "context\x0a\x09^ context",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "context:",
- protocol: 'accessing',
- fn: function (aContext){
- var self=this;
- self["@context"]=aContext;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aContext"],
- source: "context: aContext\x0a\x09context := aContext",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "currentNode",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@currentNode"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "currentNode\x0a\x09^ currentNode",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "increaseIndex",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self["@index"]=$recv(self._index()).__plus((1));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"increaseIndex",{},$globals.ASTPCNodeVisitor)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "increaseIndex\x0a\x09index := self index + 1",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["+", "index"]
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "index",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$receiver;
- $2=self["@index"];
- if(($receiver = $2) == null || $receiver.isNil){
- self["@index"]=(0);
- $1=self["@index"];
- } else {
- $1=$2;
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"index",{},$globals.ASTPCNodeVisitor)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "index\x0a\x09^ index ifNil: [ index := 0 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:"]
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@selector"];
- return $1;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@selector"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "visitJSStatementNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- self["@currentNode"]=aNode;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09\x22If a JSStatementNode is encountered, it always is the current node.\x0a\x09Stop visiting the AST there\x22\x0a\x09\x0a\x09currentNode := aNode",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "visitSendNode:",
- protocol: 'visiting',
- fn: function (aNode){
- var self=this;
- var sendIndex;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$4,$3,$5;
- $1=self._context();
- $2=self._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["selector"]=1;
- //>>excludeEnd("ctx");
- sendIndex=$recv($1)._sendIndexAt_($2);
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- $globals.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply($recv(self), [aNode]));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $4=self._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["selector"]=2;
- //>>excludeEnd("ctx");
- $3=$recv($4).__eq($recv(aNode)._selector());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["="]=1;
- //>>excludeEnd("ctx");
- if($core.assert($3)){
- $5=$recv(self._index()).__eq(sendIndex);
- if($core.assert($5)){
- self["@currentNode"]=aNode;
- self["@currentNode"];
- };
- self._increaseIndex();
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,sendIndex:sendIndex},$globals.ASTPCNodeVisitor)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x09| sendIndex |\x0a\x09sendIndex := self context sendIndexAt: self selector.\x0a\x09\x0a\x09super visitSendNode: aNode.\x0a\x09\x0a\x09self selector = aNode selector ifTrue: [\x0a\x09\x09self index = sendIndex ifTrue: [ currentNode := aNode ].\x0a\x09\x09self increaseIndex ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["sendIndexAt:", "context", "selector", "visitSendNode:", "ifTrue:", "=", "index", "increaseIndex"]
- }),
- $globals.ASTPCNodeVisitor);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AssignmentNode);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.BlockNode);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.DynamicArrayNode);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.DynamicDictionaryNode);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.JSStatementNode);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return false;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ false",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.Node);
- $core.addMethod(
- $core.method({
- selector: "isSteppingNode",
- protocol: '*Compiler-Interpreter',
- fn: function (){
- var self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isSteppingNode\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.SendNode);
- });
|