Compiler-AST.js 99 KB

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