Compiler-AST.js 91 KB

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