Compiler-AST.js 91 KB

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