Compiler-AST.js 85 KB

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