Compiler-AST.js 93 KB

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