Compiler-AST.js 82 KB

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