123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773 |
- define(["amber/boot", "require", "amber/core/Kernel-Objects"], function($boot,requirejs){"use strict";
- var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
- var $pkg = $core.addPackage("Helios-Helpers");
- $pkg.innerEval = function (expr) { return eval(expr); };
- $pkg.transport = {"type":"amd","amdNamespace":"helios"};
- $core.addClass("HLClassifier", $globals.Object, ["next", "method"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLClassifier.comment="I am an abstract class implementing a link in a `chain of responsibility` pattern.\x0a\x0aSubclasses are in charge of classifying a method according to multiple strategies.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "classify",
- protocol: "protocol",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$receiver;
- $1=$self._next();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["next"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $1) == null || $receiver.a$nil){
- return false;
- } else {
- $1;
- }
- $2=$self._doClassify();
- if($core.assert($2)){
- return true;
- } else {
- return $recv($self._next())._classify();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classify",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "classify\x0a\x09self next ifNil: [ ^ false ].\x0a\x09\x0a\x09^ self doClassify\x0a\x09\x09ifTrue: [ true ]\x0a\x09\x09ifFalse: [ self next classify ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "next", "ifTrue:ifFalse:", "doClassify", "classify"]
- }),
- $globals.HLClassifier);
- $core.addMethod(
- $core.method({
- selector: "doClassify",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doClassify",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doClassify\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }),
- $globals.HLClassifier);
- $core.addMethod(
- $core.method({
- selector: "method",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.method;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "method\x0a\x09^ method",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLClassifier);
- $core.addMethod(
- $core.method({
- selector: "method:",
- protocol: "accessing",
- fn: function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $self.method=anObject;
- $1=$self._next();
- if(($receiver = $1) == null || $receiver.a$nil){
- $1;
- } else {
- var nextLink;
- nextLink=$receiver;
- $recv(nextLink)._method_(anObject);
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"method:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "method: anObject\x0a\x09method := anObject.\x0a\x09self next\x0a\x09\x09ifNotNil: [ :nextLink | nextLink method: anObject ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "next", "method:"]
- }),
- $globals.HLClassifier);
- $core.addMethod(
- $core.method({
- selector: "next",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.next;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "next\x0a\x09^ next",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLClassifier);
- $core.addMethod(
- $core.method({
- selector: "next:",
- protocol: "accessing",
- fn: function (anObject){
- var self=this,$self=this;
- $self.next=anObject;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "next: anObject\x0a\x09next := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLClassifier);
- $core.addClass("HLAccessorClassifier", $globals.HLClassifier, [], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLAccessorClassifier.comment="I am a classifier checking the method selector matches an instance variable name.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "doClassify",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- var names,selector;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- names=$recv($recv($self.method)._origin())._allInstanceVariableNames();
- selector=$recv($self.method)._selector();
- $1=$recv($recv(selector)._last()).__eq(":");
- if($core.assert($1)){
- selector=$recv(selector)._allButLast();
- selector;
- }
- $2=$recv(names)._includes_(selector);
- if(!$core.assert($2)){
- return false;
- }
- $recv($self.method)._protocol_("accessing");
- return true;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doClassify",{names:names,selector:selector})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doClassify\x0a\x09| names selector |\x0a\x09\x0a\x09names := method origin allInstanceVariableNames.\x0a\x09selector := method selector.\x0a\x09\x0a\x09(selector last = ':')\x0a\x09\x09ifTrue: [ \x22selector might be a setter\x22\x0a\x09\x09\x09selector := selector allButLast ].\x0a\x09\x0a\x09(names includes: selector)\x0a\x09\x09ifFalse: [ ^ false ].\x0a\x09\x09\x0a\x09method protocol: 'accessing'.\x0a\x09^ true.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["allInstanceVariableNames", "origin", "selector", "ifTrue:", "=", "last", "allButLast", "ifFalse:", "includes:", "protocol:"]
- }),
- $globals.HLAccessorClassifier);
- $core.addClass("HLImplementorClassifier", $globals.HLClassifier, [], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLImplementorClassifier.comment="I am a classifier checking the other implementations of the same selector and choose the protocol the most populated.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "doClassify",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- var currentClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$4,$2;
- var $early={};
- try {
- currentClass=$recv($self.method)._origin();
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(currentClass)._superclass();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["superclass"]=1;
- //>>excludeEnd("ctx");
- return $recv($1)._isNil();
- //>>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");
- currentClass=$recv(currentClass)._superclass();
- $3=currentClass;
- $4=$recv($self.method)._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["selector"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._includesSelector_($4);
- if($core.assert($2)){
- $recv($self.method)._protocol_($recv($recv(currentClass).__gt_gt($recv($self.method)._selector()))._protocol());
- throw $early=[true];
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return false;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doClassify",{currentClass:currentClass})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doClassify\x0a\x09| currentClass |\x0a\x09currentClass := method origin.\x0a\x09\x0a\x09[ currentClass superclass isNil ] whileFalse: [\x0a\x09\x09currentClass := currentClass superclass.\x0a\x09\x09(currentClass includesSelector: method selector)\x0a\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09method protocol: (currentClass >> method selector) protocol.\x0a\x09\x09\x09\x09^ true ]].\x0a\x09\x0a\x09^ false.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["origin", "whileFalse:", "isNil", "superclass", "ifTrue:", "includesSelector:", "selector", "protocol:", "protocol", ">>"]
- }),
- $globals.HLImplementorClassifier);
- $core.addClass("HLPrefixClassifier", $globals.HLClassifier, ["prefixMapping"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLPrefixClassifier.comment="I am classifier checking the method selector to know if it begins with a known prefix.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "buildPrefixDictionary",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $self.prefixMapping=$recv($globals.Dictionary)._new();
- $1=$self.prefixMapping;
- $recv($1)._at_put_("test","tests");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("bench","benchmarking");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=2;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("copy","copying");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=3;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("initialize","initialization");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=4;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("accept","visitor");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=5;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("visit","visitor");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=6;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("signal","signalling");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=7;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("parse","parsing");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=8;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("add","adding");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=9;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("is","testing");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=10;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("as","converting");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["at:put:"]=11;
- //>>excludeEnd("ctx");
- $recv($1)._at_put_("new","instance creation");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"buildPrefixDictionary",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "buildPrefixDictionary\x0a\x09prefixMapping := Dictionary new.\x0a\x09prefixMapping \x0a\x09\x09at: 'test' put: 'tests';\x0a\x09 \x09at: 'bench' put: 'benchmarking';\x0a\x09 \x09at: 'copy' put: 'copying';\x0a\x09\x09at: 'initialize' put: 'initialization';\x0a\x09\x09at: 'accept' put: 'visitor';\x0a\x09\x09at: 'visit' put: 'visitor';\x0a\x09\x09at: 'signal' put: 'signalling';\x0a\x09\x09at: 'parse' put: 'parsing';\x0a\x09\x09at: 'add' put: 'adding';\x0a\x09\x09at: 'is' put: 'testing';\x0a\x09\x09at: 'as' put: 'converting';\x0a\x09\x09at: 'new' put: 'instance creation'.",
- referencedClasses: ["Dictionary"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "at:put:"]
- }),
- $globals.HLPrefixClassifier);
- $core.addMethod(
- $core.method({
- selector: "doClassify",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- var $early={};
- try {
- $recv($self.prefixMapping)._keysAndValuesDo_((function(prefix,protocol){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv($recv($self.method)._selector())._beginsWith_(prefix);
- if($core.assert($1)){
- $recv($self.method)._protocol_(protocol);
- throw $early=[true];
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({prefix:prefix,protocol:protocol},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return false;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doClassify",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doClassify\x0a\x09prefixMapping keysAndValuesDo: [ :prefix :protocol |\x0a\x09\x09(method selector beginsWith: prefix)\x0a\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09method protocol: protocol.\x0a\x09\x09\x09\x09^ true ]].\x0a\x09^ false.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["keysAndValuesDo:", "ifTrue:", "beginsWith:", "selector", "protocol:"]
- }),
- $globals.HLPrefixClassifier);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLPrefixClassifier.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $self._buildPrefixDictionary();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x0a\x09self buildPrefixDictionary",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "buildPrefixDictionary"]
- }),
- $globals.HLPrefixClassifier);
- $core.addClass("HLSuperclassClassifier", $globals.HLClassifier, [], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLSuperclassClassifier.comment="I am a classifier checking the superclass chain to find a matching selector.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "doClassify",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- var protocolBag,methods,protocolToUse,counter;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$4,$3,$5;
- var $early={};
- try {
- protocolBag=$recv($globals.Dictionary)._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["new"]=1;
- //>>excludeEnd("ctx");
- methods=$recv($recv($globals.HLReferencesModel)._new())._implementorsOf_($recv($self.method)._selector());
- $recv(methods)._ifEmpty_ifNotEmpty_((function(){
- throw $early=[false];
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(methods)._do_((function(aMethod){
- var protocol;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- protocol=$recv($recv(aMethod)._method())._protocol();
- $2=$recv($self.method)._origin();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["origin"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2).__eq($recv(aMethod)._origin());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["="]=1;
- //>>excludeEnd("ctx");
- if(!$core.assert($1)){
- $4=$recv($recv(protocol)._first()).__eq("*");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["="]=2;
- //>>excludeEnd("ctx");
- $3=$recv($4)._or_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return $recv(protocol).__eq($recv($self.method)._defaultProtocol());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)});
- //>>excludeEnd("ctx");
- }));
- if(!$core.assert($3)){
- return $recv(protocolBag)._at_put_(protocol,$recv($recv(protocolBag)._at_ifAbsent_(protocol,(function(){
- return (0);
- }))).__plus((1)));
- }
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({aMethod:aMethod,protocol:protocol},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- $recv(protocolBag)._ifEmpty_((function(){
- throw $early=[false];
- }));
- protocolToUse=nil;
- counter=(0);
- $recv(protocolBag)._keysAndValuesDo_((function(key,value){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $5=$recv(value).__gt(counter);
- if($core.assert($5)){
- counter=value;
- protocolToUse=key;
- return protocolToUse;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,9)});
- //>>excludeEnd("ctx");
- }));
- $recv($self.method)._protocol_(protocolToUse);
- return true;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doClassify",{protocolBag:protocolBag,methods:methods,protocolToUse:protocolToUse,counter:counter})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doClassify\x0a\x09| protocolBag methods protocolToUse counter |\x0a\x09\x0a\x09protocolBag := Dictionary new.\x0a\x09methods := HLReferencesModel new implementorsOf: method selector.\x0a\x09methods\x0a\x09\x09ifEmpty: [ ^ false ]\x0a\x09\x09ifNotEmpty: [\x0a\x09\x09\x09methods \x0a\x09\x09\x09\x09do: [ :aMethod || protocol |\x0a\x09\x09\x09\x09\x09protocol := aMethod method protocol.\x0a\x09\x09\x09\x09\x09(method origin = aMethod origin)\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09((protocol first = '*') or: [ protocol = method defaultProtocol ])\x0a\x09\x09\x09\x09\x09\x09\x09ifFalse: [ \x0a\x09\x09\x09\x09\x09\x09\x09\x09protocolBag \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09at: protocol \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09put: (protocolBag at: protocol ifAbsent: [ 0 ]) + 1 ] ] ] ].\x0a\x09\x09\x09\x0a\x09protocolBag ifEmpty: [ ^ false ].\x0a\x09protocolToUse := nil.\x0a\x09counter := 0.\x0a\x09protocolBag keysAndValuesDo: [ :key :value | value > counter \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09counter := value.\x0a\x09\x09\x09protocolToUse := key ] ].\x0a\x09method protocol: protocolToUse.\x0a\x09^ true",
- referencedClasses: ["Dictionary", "HLReferencesModel"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "implementorsOf:", "selector", "ifEmpty:ifNotEmpty:", "do:", "protocol", "method", "ifFalse:", "=", "origin", "or:", "first", "defaultProtocol", "at:put:", "+", "at:ifAbsent:", "ifEmpty:", "keysAndValuesDo:", "ifTrue:", ">", "protocol:"]
- }),
- $globals.HLSuperclassClassifier);
- $core.addClass("HLGenerationOutput", $globals.Object, ["sourceCodes", "protocol", "targetClass"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLGenerationOutput.comment="I am a simple data object used to store the result of a generation process.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "addSourceCode:",
- protocol: "protocol",
- fn: function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.sourceCodes)._add_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addSourceCode:",{aString:aString})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "addSourceCode: aString\x0a\x09sourceCodes add: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["add:"]
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "compile",
- protocol: "protocol",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $recv($self.sourceCodes)._do_((function(methodSourceCode){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv($self.targetClass)._includesSelector_($recv(methodSourceCode)._selector());
- if(!$core.assert($1)){
- return $recv($self.targetClass)._compile_protocol_($recv(methodSourceCode)._sourceCode(),$self.protocol);
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({methodSourceCode:methodSourceCode},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"compile",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "compile\x0a\x09sourceCodes do: [ :methodSourceCode |\x0a\x09\x09(targetClass includesSelector: methodSourceCode selector)\x0a\x09\x09\x09ifFalse: [ \x0a\x09\x09\x09\x09targetClass \x0a\x09\x09\x09\x09\x09compile: methodSourceCode sourceCode\x0a\x09\x09\x09\x09\x09protocol: protocol ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["do:", "ifFalse:", "includesSelector:", "selector", "compile:protocol:", "sourceCode"]
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLGenerationOutput.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $self.sourceCodes=$recv($globals.OrderedCollection)._new();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09sourceCodes := OrderedCollection new",
- referencedClasses: ["OrderedCollection"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "new"]
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "protocol",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.protocol;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "protocol\x0a\x09^ protocol",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "protocol:",
- protocol: "accessing",
- fn: function (aString){
- var self=this,$self=this;
- $self.protocol=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "protocol: aString\x0a\x09protocol := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "sourceCodes",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.sourceCodes;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "sourceCodes\x0a\x09^ sourceCodes",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "sourceCodes:",
- protocol: "accessing",
- fn: function (aCollection){
- var self=this,$self=this;
- $self.sourceCodes=aCollection;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "sourceCodes: aCollection\x0a\x09sourceCodes := aCollection",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "targetClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.targetClass;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "targetClass\x0a\x09^ targetClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addMethod(
- $core.method({
- selector: "targetClass:",
- protocol: "accessing",
- fn: function (aClass){
- var self=this,$self=this;
- $self.targetClass=aClass;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "targetClass: aClass\x0a\x09targetClass := aClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLGenerationOutput);
- $core.addClass("HLMethodClassifier", $globals.Object, ["firstClassifier"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLMethodClassifier.comment="I am in charge of categorizing methods following this strategy:\x0a\x0a- is it an accessor?\x0a- is it overriding a superclass method?\x0a- is it starting with a know prefix?\x0a- how are categorized the other implementations?";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "addClassifier:",
- protocol: "private",
- fn: function (aClassifier){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aClassifier)._next_($self.firstClassifier);
- $self.firstClassifier=aClassifier;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addClassifier:",{aClassifier:aClassifier})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClassifier"],
- source: "addClassifier: aClassifier\x0a\x09aClassifier next: firstClassifier.\x0a\x09firstClassifier := aClassifier",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["next:"]
- }),
- $globals.HLMethodClassifier);
- $core.addMethod(
- $core.method({
- selector: "classify:",
- protocol: "protocol",
- fn: function (aMethod){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.firstClassifier;
- $recv($1)._method_(aMethod);
- $recv($1)._classify();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classify:",{aMethod:aMethod})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod"],
- source: "classify: aMethod\x0a\x09firstClassifier\x0a\x09\x09method: aMethod;\x0a\x09\x09classify",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["method:", "classify"]
- }),
- $globals.HLMethodClassifier);
- $core.addMethod(
- $core.method({
- selector: "classifyAll:",
- protocol: "protocol",
- fn: function (aCollectionOfMethods){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aCollectionOfMethods)._do_((function(method){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._classify_(method);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classifyAll:",{aCollectionOfMethods:aCollectionOfMethods})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollectionOfMethods"],
- source: "classifyAll: aCollectionOfMethods\x0a\x09aCollectionOfMethods do: [ :method |\x0a\x09\x09self classify: method ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["do:", "classify:"]
- }),
- $globals.HLMethodClassifier);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLMethodClassifier.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $self._setupClassifiers();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09self setupClassifiers",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "setupClassifiers"]
- }),
- $globals.HLMethodClassifier);
- $core.addMethod(
- $core.method({
- selector: "setupClassifiers",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3;
- $1=$recv($globals.HLImplementorClassifier)._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["new"]=1;
- //>>excludeEnd("ctx");
- $self._addClassifier_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["addClassifier:"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($globals.HLPrefixClassifier)._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["new"]=2;
- //>>excludeEnd("ctx");
- $self._addClassifier_($2);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["addClassifier:"]=2;
- //>>excludeEnd("ctx");
- $3=$recv($globals.HLSuperclassClassifier)._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["new"]=3;
- //>>excludeEnd("ctx");
- $self._addClassifier_($3);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["addClassifier:"]=3;
- //>>excludeEnd("ctx");
- $self._addClassifier_($recv($globals.HLAccessorClassifier)._new());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setupClassifiers",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "setupClassifiers\x0a\x09self addClassifier: HLImplementorClassifier new.\x0a\x09self addClassifier: HLPrefixClassifier new.\x0a\x09self addClassifier: HLSuperclassClassifier new.\x0a\x09self addClassifier: HLAccessorClassifier new",
- referencedClasses: ["HLImplementorClassifier", "HLPrefixClassifier", "HLSuperclassClassifier", "HLAccessorClassifier"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addClassifier:", "new"]
- }),
- $globals.HLMethodClassifier);
- $core.addClass("HLMethodGenerator", $globals.Object, ["output"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLMethodGenerator.comment="I am the abstract super class of the method generators.\x0a\x0aMy main method is `generate` which produces an `output` object accessed with `#output`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "class:",
- protocol: "accessing",
- fn: function (aClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.output)._targetClass_(aClass);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "class: aClass\x0a\x09output targetClass: aClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["targetClass:"]
- }),
- $globals.HLMethodGenerator);
- $core.addMethod(
- $core.method({
- selector: "generate",
- protocol: "protocol",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=$recv($self.output)._targetClass();
- if(($receiver = $1) == null || $receiver.a$nil){
- $self._error_("class should not be nil");
- } else {
- $1;
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"generate",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "generate\x0a\x09output targetClass ifNil: [ self error: 'class should not be nil'].",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "targetClass", "error:"]
- }),
- $globals.HLMethodGenerator);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLMethodGenerator.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $self.output=$recv($globals.HLGenerationOutput)._new();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09output := HLGenerationOutput new",
- referencedClasses: ["HLGenerationOutput"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "new"]
- }),
- $globals.HLMethodGenerator);
- $core.addMethod(
- $core.method({
- selector: "output",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.output;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "output\x0a\x09^ output",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLMethodGenerator);
- $core.addClass("HLAccessorsGenerator", $globals.HLMethodGenerator, [], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLAccessorsGenerator.comment="I am a generator used to compile the getters/setters of a class.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "accessorProtocolForObject",
- protocol: "double-dispatch",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.output)._protocol_("accessing");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"accessorProtocolForObject",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "accessorProtocolForObject\x0a\x09output protocol: 'accessing'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["protocol:"]
- }),
- $globals.HLAccessorsGenerator);
- $core.addMethod(
- $core.method({
- selector: "accessorsForObject",
- protocol: "double-dispatch",
- fn: function (){
- var self=this,$self=this;
- var sources;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- sources=$recv($globals.OrderedCollection)._new();
- $recv($recv($recv($recv($self.output)._targetClass())._instanceVariableNames())._sorted())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=sources;
- $recv($1)._add_($self._getterFor_(each));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["add:"]=1;
- //>>excludeEnd("ctx");
- return $recv($1)._add_($self._setterFor_(each));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv($self.output)._sourceCodes_(sources);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"accessorsForObject",{sources:sources})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "accessorsForObject\x0a\x09| sources |\x0a\x09\x0a\x09sources := OrderedCollection new.\x0a\x09output targetClass instanceVariableNames sorted do: [ :each | \x0a\x09\x09sources \x0a\x09\x09\x09add: (self getterFor: each);\x0a\x09\x09\x09add: (self setterFor: each) ].\x0a\x09output sourceCodes: sources",
- referencedClasses: ["OrderedCollection"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "do:", "sorted", "instanceVariableNames", "targetClass", "add:", "getterFor:", "setterFor:", "sourceCodes:"]
- }),
- $globals.HLAccessorsGenerator);
- $core.addMethod(
- $core.method({
- selector: "generate",
- protocol: "protocol",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLAccessorsGenerator.superclass||$boot.nilAsClass).fn.prototype._generate.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $1=$recv($self.output)._targetClass();
- $recv($1)._accessorsSourceCodesWith_(self);
- $recv($1)._accessorProtocolWith_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"generate",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "generate\x0a\x09super generate.\x0a\x09\x0a\x09output targetClass \x0a\x09\x09accessorsSourceCodesWith: self;\x0a\x09\x09accessorProtocolWith: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["generate", "accessorsSourceCodesWith:", "targetClass", "accessorProtocolWith:"]
- }),
- $globals.HLAccessorsGenerator);
- $core.addMethod(
- $core.method({
- selector: "getterFor:",
- protocol: "private",
- fn: function (anInstanceVariable){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($globals.HLMethodSourceCode)._new();
- $recv($1)._selector_(anInstanceVariable);
- return $recv($1)._sourceCode_($recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(stream).__lt_lt(anInstanceVariable);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=1;
- //>>excludeEnd("ctx");
- $recv($recv(stream)._cr())._tab();
- return $recv($recv(stream).__lt_lt("^ ")).__lt_lt(anInstanceVariable);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=2;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- })));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"getterFor:",{anInstanceVariable:anInstanceVariable})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInstanceVariable"],
- source: "getterFor: anInstanceVariable\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector:anInstanceVariable;\x0a\x09\x09sourceCode: (String streamContents: [ :stream |\x0a\x09\x09stream << anInstanceVariable.\x0a\x09\x09stream cr tab.\x0a\x09\x09stream << '^ ' << anInstanceVariable ])",
- referencedClasses: ["HLMethodSourceCode", "String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector:", "new", "sourceCode:", "streamContents:", "<<", "tab", "cr"]
- }),
- $globals.HLAccessorsGenerator);
- $core.addMethod(
- $core.method({
- selector: "setterFor:",
- protocol: "private",
- fn: function (anInstanceVariable){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv($globals.HLMethodSourceCode)._new();
- $recv($1)._selector_($recv(anInstanceVariable).__comma(":"));
- return $recv($1)._sourceCode_($recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $2=$recv(stream).__lt_lt(anInstanceVariable);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=2;
- //>>excludeEnd("ctx");
- $recv($2).__lt_lt(": anObject");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=1;
- //>>excludeEnd("ctx");
- $recv($recv(stream)._cr())._tab();
- return $recv($recv(stream).__lt_lt(anInstanceVariable)).__lt_lt(" := anObject");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=3;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- })));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setterFor:",{anInstanceVariable:anInstanceVariable})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInstanceVariable"],
- source: "setterFor: anInstanceVariable\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector: anInstanceVariable, ':';\x0a\x09\x09sourceCode: (String streamContents: [ :stream |\x0a\x09\x09stream << anInstanceVariable << ': anObject'.\x0a\x09\x09stream cr tab.\x0a\x09\x09stream << anInstanceVariable << ' := anObject' ])",
- referencedClasses: ["HLMethodSourceCode", "String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector:", "new", ",", "sourceCode:", "streamContents:", "<<", "tab", "cr"]
- }),
- $globals.HLAccessorsGenerator);
- $core.addClass("HLInitializeGenerator", $globals.HLMethodGenerator, [], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLInitializeGenerator.comment="I am used to double-dispatch the `initialize` method(s) generation. I am a disposable object.\x0a\x0a## Usage\x0a\x0a ^ HLInitializeGenerator new\x0a class: aClass;\x0a generate;\x0a output";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "generate",
- protocol: "protocol",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLInitializeGenerator.superclass||$boot.nilAsClass).fn.prototype._generate.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $1=$recv($self.output)._targetClass();
- $recv($1)._initializeSourceCodesWith_(self);
- $recv($1)._initializeProtocolWith_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"generate",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "generate\x0a\x09super generate.\x0a\x09\x0a\x09output targetClass \x0a\x09\x09initializeSourceCodesWith: self;\x0a\x09\x09initializeProtocolWith: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["generate", "initializeSourceCodesWith:", "targetClass", "initializeProtocolWith:"]
- }),
- $globals.HLInitializeGenerator);
- $core.addMethod(
- $core.method({
- selector: "generateInitializeCodeForObject",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$3,$4,$5,$6;
- return $recv($globals.String)._streamContents_((function(str){
- var instVars,size;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- instVars=$recv($recv($recv($self.output)._targetClass())._instanceVariableNames())._sorted();
- size=$recv(instVars)._size();
- $recv(str).__lt_lt("initialize");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=1;
- //>>excludeEnd("ctx");
- $2=$recv(str)._cr();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["cr"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._tab();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["tab"]=1;
- //>>excludeEnd("ctx");
- $recv($1).__lt_lt("super initialize.");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["<<"]=2;
- //>>excludeEnd("ctx");
- $recv($1)._cr();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["cr"]=2;
- //>>excludeEnd("ctx");
- $3=$recv(str)._cr();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["cr"]=3;
- //>>excludeEnd("ctx");
- $recv($3)._tab();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["tab"]=2;
- //>>excludeEnd("ctx");
- return $recv(instVars)._withIndexDo_((function(name,index){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- $4=$recv(index).__tild_eq((1));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["~="]=1;
- //>>excludeEnd("ctx");
- if($core.assert($4)){
- $recv($recv(str)._cr())._tab();
- }
- $5=$recv(str).__lt_lt(name);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["<<"]=4;
- //>>excludeEnd("ctx");
- $recv($5).__lt_lt(" := nil");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["<<"]=3;
- //>>excludeEnd("ctx");
- $6=$recv(index).__tild_eq(size);
- if($core.assert($6)){
- return $recv(str).__lt_lt(".");
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({name:name,index:index},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str,instVars:instVars,size:size},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"generateInitializeCodeForObject",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "generateInitializeCodeForObject\x09\x0a\x09^ String streamContents: [ :str || instVars size |\x0a\x09\x09instVars := output targetClass instanceVariableNames sorted.\x0a\x09\x09size := instVars size.\x0a\x09\x09str << 'initialize'.\x0a\x09\x09str cr tab << 'super initialize.';cr.\x0a\x09\x09str cr tab.\x0a\x09\x09instVars withIndexDo: [ :name :index |\x0a\x09\x09\x09index ~= 1 ifTrue: [ str cr tab ].\x0a\x09\x09\x09str << name << ' := nil'.\x0a\x09\x09\x09index ~= size ifTrue: [ str << '.' ] ] ].",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "sorted", "instanceVariableNames", "targetClass", "size", "<<", "tab", "cr", "withIndexDo:", "ifTrue:", "~="]
- }),
- $globals.HLInitializeGenerator);
- $core.addMethod(
- $core.method({
- selector: "initializeForObject",
- protocol: "double-dispatch",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.output)._addSourceCode_($self._initializeMethodForObject());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeForObject",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeForObject\x0a\x09output addSourceCode: self initializeMethodForObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addSourceCode:", "initializeMethodForObject"]
- }),
- $globals.HLInitializeGenerator);
- $core.addMethod(
- $core.method({
- selector: "initializeMethodForObject",
- protocol: "private",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($globals.HLMethodSourceCode)._new();
- $recv($1)._selector_("initialize");
- $recv($1)._sourceCode_($self._generateInitializeCodeForObject());
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeMethodForObject",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeMethodForObject\x09\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector: 'initialize';\x0a\x09\x09sourceCode: self generateInitializeCodeForObject;\x0a\x09\x09yourself",
- referencedClasses: ["HLMethodSourceCode"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector:", "new", "sourceCode:", "generateInitializeCodeForObject", "yourself"]
- }),
- $globals.HLInitializeGenerator);
- $core.addMethod(
- $core.method({
- selector: "initializeProtocolForObject",
- protocol: "double-dispatch",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.output)._protocol_("initialization");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initializeProtocolForObject",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initializeProtocolForObject\x0a\x09output protocol: 'initialization'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["protocol:"]
- }),
- $globals.HLInitializeGenerator);
- $core.addClass("HLMethodSourceCode", $globals.Object, ["selector", "sourceCode"], "Helios-Helpers");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.HLMethodSourceCode.comment="I am a simple data object keeping track of the information about a method that will be compiled at the end of the generation process.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.selector;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLMethodSourceCode);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: "accessing",
- fn: function (aSelector){
- var self=this,$self=this;
- $self.selector=aSelector;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSelector"],
- source: "selector: aSelector\x0a\x09selector := aSelector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLMethodSourceCode);
- $core.addMethod(
- $core.method({
- selector: "sourceCode",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.sourceCode;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "sourceCode\x0a\x09^ sourceCode",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLMethodSourceCode);
- $core.addMethod(
- $core.method({
- selector: "sourceCode:",
- protocol: "accessing",
- fn: function (aString){
- var self=this,$self=this;
- $self.sourceCode=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "sourceCode: aString\x0a\x09sourceCode := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLMethodSourceCode);
- $core.addClass("HLPackageCommitErrorHelper", $globals.Object, ["model"], "Helios-Helpers");
- $core.addMethod(
- $core.method({
- selector: "commitPackage",
- protocol: "actions",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($globals.HLCommitPackageCommand)._for_($self._model()))._execute();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitPackage",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commitPackage\x0a\x09(HLCommitPackageCommand for: self model)\x0a\x09\x09execute",
- referencedClasses: ["HLCommitPackageCommand"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["execute", "for:", "model"]
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "commitToPath:",
- protocol: "actions",
- fn: function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($self._package())._transport())._setPath_(aString);
- $self._commitPackage();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitToPath:",{aString:aString})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "commitToPath: aString\x0a\x09\x22We only take AMD package transport into account for now\x22\x0a\x09\x0a\x09self package transport setPath: aString.\x0a\x09\x0a\x09self commitPackage",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["setPath:", "transport", "package", "commitPackage"]
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "model",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.model;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "model\x0a\x09^ model",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "model:",
- protocol: "accessing",
- fn: function (aToolModel){
- var self=this,$self=this;
- $self.model=aToolModel;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aToolModel"],
- source: "model: aToolModel\x0a\x09model := aToolModel",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._model())._packageToCommit();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"package",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09^ self model packageToCommit",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["packageToCommit", "model"]
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "showHelp",
- protocol: "actions",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv($globals.HLConfirmationWidget)._new();
- $2=$recv("Commit failed for namespace \x22".__comma($recv($recv($self._package())._transport())._namespace())).__comma("\x22. Do you want to commit to another path?");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv($1)._confirmationString_($2);
- $recv($1)._actionBlock_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._showNewCommitPath();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv($1)._cancelButtonLabel_("Abandon");
- $recv($1)._confirmButtonLabel_("Set path");
- $recv($1)._show();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"showHelp",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "showHelp\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: 'Commit failed for namespace \x22', self package transport namespace, '\x22. Do you want to commit to another path?';\x0a\x09\x09actionBlock: [ self showNewCommitPath ];\x0a\x09\x09cancelButtonLabel: 'Abandon';\x0a\x09\x09confirmButtonLabel: 'Set path';\x0a\x09\x09show",
- referencedClasses: ["HLConfirmationWidget"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["confirmationString:", "new", ",", "namespace", "transport", "package", "actionBlock:", "showNewCommitPath", "cancelButtonLabel:", "confirmButtonLabel:", "show"]
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "showNewCommitPath",
- protocol: "actions",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($globals.HLRequestWidget)._new();
- $recv($1)._beSingleline();
- $recv($1)._confirmationString_("Set commit path");
- $recv($1)._actionBlock_((function(url){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._commitToPath_(url);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({url:url},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv($1)._confirmButtonLabel_("Commit with new path");
- $recv($1)._value_("/src");
- $recv($1)._show();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"showNewCommitPath",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "showNewCommitPath\x0a\x09HLRequestWidget new\x0a\x09\x09beSingleline;\x0a\x09\x09confirmationString: 'Set commit path';\x0a\x09\x09actionBlock: [ :url | self commitToPath: url ];\x0a\x09\x09confirmButtonLabel: 'Commit with new path';\x0a\x09\x09value: '/src';\x0a\x09\x09show",
- referencedClasses: ["HLRequestWidget"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["beSingleline", "new", "confirmationString:", "actionBlock:", "commitToPath:", "confirmButtonLabel:", "value:", "show"]
- }),
- $globals.HLPackageCommitErrorHelper);
- $core.addMethod(
- $core.method({
- selector: "on:",
- protocol: "instance creation",
- fn: function (aToolModel){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._new();
- $recv($1)._model_(aToolModel);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"on:",{aToolModel:aToolModel})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aToolModel"],
- source: "on: aToolModel\x0a\x09^ self new\x0a\x09\x09model: aToolModel;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["model:", "new", "yourself"]
- }),
- $globals.HLPackageCommitErrorHelper.a$cls);
- });
|