Compiler-AST.js 87 KB

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