Compiler-AST.js 81 KB

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