Compiler-AST.js 98 KB

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