2
0

Compiler-Semantic.deploy.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302
  1. smalltalk.addPackage('Compiler-Semantic', {});
  2. smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
  3. smalltalk.addMethod(
  4. "_addArg_",
  5. smalltalk.method({
  6. selector: "addArg:",
  7. fn: function (aString){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { _st(_st(self)._args())._at_put_(aString,_st((smalltalk.ArgVar || ArgVar))._on_(aString));
  10. _st(_st(_st(self)._args())._at_(aString))._scope_(self);
  11. return self}, function($ctx1) {$ctx1.fill(self,"addArg:",{aString:aString}, smalltalk.LexicalScope)})}
  12. }),
  13. smalltalk.LexicalScope);
  14. smalltalk.addMethod(
  15. "_addTemp_",
  16. smalltalk.method({
  17. selector: "addTemp:",
  18. fn: function (aString){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) { _st(_st(self)._temps())._at_put_(aString,_st((smalltalk.TempVar || TempVar))._on_(aString));
  21. _st(_st(_st(self)._temps())._at_(aString))._scope_(self);
  22. return self}, function($ctx1) {$ctx1.fill(self,"addTemp:",{aString:aString}, smalltalk.LexicalScope)})}
  23. }),
  24. smalltalk.LexicalScope);
  25. smalltalk.addMethod(
  26. "_alias",
  27. smalltalk.method({
  28. selector: "alias",
  29. fn: function (){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx1) { var $1;
  32. $1=_st("$ctx").__comma(_st(_st(self)._scopeLevel())._asString());
  33. return $1;
  34. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.LexicalScope)})}
  35. }),
  36. smalltalk.LexicalScope);
  37. smalltalk.addMethod(
  38. "_allVariableNames",
  39. smalltalk.method({
  40. selector: "allVariableNames",
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) { var $1;
  44. $1=_st(_st(_st(self)._args())._keys()).__comma(_st(_st(self)._temps())._keys());
  45. return $1;
  46. }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.LexicalScope)})}
  47. }),
  48. smalltalk.LexicalScope);
  49. smalltalk.addMethod(
  50. "_args",
  51. smalltalk.method({
  52. selector: "args",
  53. fn: function (){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) { var $2,$1;
  56. $2=self["@args"];
  57. if(($receiver = $2) == nil || $receiver == undefined){
  58. self["@args"]=_st((smalltalk.Dictionary || Dictionary))._new();
  59. $1=self["@args"];
  60. } else {
  61. $1=$2;
  62. };
  63. return $1;
  64. }, function($ctx1) {$ctx1.fill(self,"args",{}, smalltalk.LexicalScope)})}
  65. }),
  66. smalltalk.LexicalScope);
  67. smalltalk.addMethod(
  68. "_bindingFor_",
  69. smalltalk.method({
  70. selector: "bindingFor:",
  71. fn: function (aStringOrNode){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) { var $1;
  74. $1=_st(_st(self)._pseudoVars())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  75. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._args())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  76. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  77. return smalltalk.withContext(function($ctx4) { return nil;
  78. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  79. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  80. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  81. return $1;
  82. }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aStringOrNode:aStringOrNode}, smalltalk.LexicalScope)})}
  83. }),
  84. smalltalk.LexicalScope);
  85. smalltalk.addMethod(
  86. "_canInlineNonLocalReturns",
  87. smalltalk.method({
  88. selector: "canInlineNonLocalReturns",
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) { var $1;
  92. $1=_st(_st(self)._isInlined())._and_((function(){
  93. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._outerScope())._canInlineNonLocalReturns();
  94. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  95. return $1;
  96. }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.LexicalScope)})}
  97. }),
  98. smalltalk.LexicalScope);
  99. smalltalk.addMethod(
  100. "_instruction",
  101. smalltalk.method({
  102. selector: "instruction",
  103. fn: function (){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) { var $1;
  106. $1=self["@instruction"];
  107. return $1;
  108. }, function($ctx1) {$ctx1.fill(self,"instruction",{}, smalltalk.LexicalScope)})}
  109. }),
  110. smalltalk.LexicalScope);
  111. smalltalk.addMethod(
  112. "_instruction_",
  113. smalltalk.method({
  114. selector: "instruction:",
  115. fn: function (anIRInstruction){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) { self["@instruction"]=anIRInstruction;
  118. return self}, function($ctx1) {$ctx1.fill(self,"instruction:",{anIRInstruction:anIRInstruction}, smalltalk.LexicalScope)})}
  119. }),
  120. smalltalk.LexicalScope);
  121. smalltalk.addMethod(
  122. "_isBlockScope",
  123. smalltalk.method({
  124. selector: "isBlockScope",
  125. fn: function (){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) { var $1;
  128. $1=_st(_st(self)._isMethodScope())._not();
  129. return $1;
  130. }, function($ctx1) {$ctx1.fill(self,"isBlockScope",{}, smalltalk.LexicalScope)})}
  131. }),
  132. smalltalk.LexicalScope);
  133. smalltalk.addMethod(
  134. "_isInlined",
  135. smalltalk.method({
  136. selector: "isInlined",
  137. fn: function (){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) { var $1;
  140. $1=_st(_st(_st(self)._instruction())._notNil())._and_((function(){
  141. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._instruction())._isInlined();
  142. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  143. return $1;
  144. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.LexicalScope)})}
  145. }),
  146. smalltalk.LexicalScope);
  147. smalltalk.addMethod(
  148. "_isMethodScope",
  149. smalltalk.method({
  150. selector: "isMethodScope",
  151. fn: function (){
  152. var self=this;
  153. return smalltalk.withContext(function($ctx1) { return false;
  154. }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.LexicalScope)})}
  155. }),
  156. smalltalk.LexicalScope);
  157. smalltalk.addMethod(
  158. "_lookupVariable_",
  159. smalltalk.method({
  160. selector: "lookupVariable:",
  161. fn: function (aNode){
  162. var self=this;
  163. var lookup;
  164. return smalltalk.withContext(function($ctx1) { var $1,$3,$2,$4;
  165. lookup=_st(self)._bindingFor_(aNode);
  166. $1=lookup;
  167. $2=(function(){
  168. return smalltalk.withContext(function($ctx2) { $3=_st(self)._outerScope();
  169. if(($receiver = $3) == nil || $receiver == undefined){
  170. lookup=$3;
  171. } else {
  172. lookup=_st(_st(self)._outerScope())._lookupVariable_(aNode);
  173. };
  174. return lookup;
  175. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  176. _st($1)._ifNil_($2);
  177. $4=lookup;
  178. return $4;
  179. }, function($ctx1) {$ctx1.fill(self,"lookupVariable:",{aNode:aNode,lookup:lookup}, smalltalk.LexicalScope)})}
  180. }),
  181. smalltalk.LexicalScope);
  182. smalltalk.addMethod(
  183. "_methodScope",
  184. smalltalk.method({
  185. selector: "methodScope",
  186. fn: function (){
  187. var self=this;
  188. return smalltalk.withContext(function($ctx1) { var $2,$1;
  189. $2=_st(self)._outerScope();
  190. if(($receiver = $2) == nil || $receiver == undefined){
  191. $1=$2;
  192. } else {
  193. $1=_st(_st(self)._outerScope())._methodScope();
  194. };
  195. return $1;
  196. }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.LexicalScope)})}
  197. }),
  198. smalltalk.LexicalScope);
  199. smalltalk.addMethod(
  200. "_node",
  201. smalltalk.method({
  202. selector: "node",
  203. fn: function (){
  204. var self=this;
  205. return smalltalk.withContext(function($ctx1) { var $1;
  206. $1=self["@node"];
  207. return $1;
  208. }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.LexicalScope)})}
  209. }),
  210. smalltalk.LexicalScope);
  211. smalltalk.addMethod(
  212. "_node_",
  213. smalltalk.method({
  214. selector: "node:",
  215. fn: function (aNode){
  216. var self=this;
  217. return smalltalk.withContext(function($ctx1) { self["@node"]=aNode;
  218. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.LexicalScope)})}
  219. }),
  220. smalltalk.LexicalScope);
  221. smalltalk.addMethod(
  222. "_outerScope",
  223. smalltalk.method({
  224. selector: "outerScope",
  225. fn: function (){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) { var $1;
  228. $1=self["@outerScope"];
  229. return $1;
  230. }, function($ctx1) {$ctx1.fill(self,"outerScope",{}, smalltalk.LexicalScope)})}
  231. }),
  232. smalltalk.LexicalScope);
  233. smalltalk.addMethod(
  234. "_outerScope_",
  235. smalltalk.method({
  236. selector: "outerScope:",
  237. fn: function (aLexicalScope){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx1) { self["@outerScope"]=aLexicalScope;
  240. return self}, function($ctx1) {$ctx1.fill(self,"outerScope:",{aLexicalScope:aLexicalScope}, smalltalk.LexicalScope)})}
  241. }),
  242. smalltalk.LexicalScope);
  243. smalltalk.addMethod(
  244. "_pseudoVars",
  245. smalltalk.method({
  246. selector: "pseudoVars",
  247. fn: function (){
  248. var self=this;
  249. return smalltalk.withContext(function($ctx1) { var $1;
  250. $1=_st(_st(self)._methodScope())._pseudoVars();
  251. return $1;
  252. }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.LexicalScope)})}
  253. }),
  254. smalltalk.LexicalScope);
  255. smalltalk.addMethod(
  256. "_scopeLevel",
  257. smalltalk.method({
  258. selector: "scopeLevel",
  259. fn: function (){
  260. var self=this;
  261. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  262. $1=_st(self)._outerScope();
  263. if(($receiver = $1) == nil || $receiver == undefined){
  264. return (1);
  265. } else {
  266. $1;
  267. };
  268. $2=_st(self)._isInlined();
  269. if(smalltalk.assert($2)){
  270. $3=_st(_st(self)._outerScope())._scopeLevel();
  271. return $3;
  272. };
  273. $4=_st(_st(_st(self)._outerScope())._scopeLevel()).__plus((1));
  274. return $4;
  275. }, function($ctx1) {$ctx1.fill(self,"scopeLevel",{}, smalltalk.LexicalScope)})}
  276. }),
  277. smalltalk.LexicalScope);
  278. smalltalk.addMethod(
  279. "_temps",
  280. smalltalk.method({
  281. selector: "temps",
  282. fn: function (){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx1) { var $2,$1;
  285. $2=self["@temps"];
  286. if(($receiver = $2) == nil || $receiver == undefined){
  287. self["@temps"]=_st((smalltalk.Dictionary || Dictionary))._new();
  288. $1=self["@temps"];
  289. } else {
  290. $1=$2;
  291. };
  292. return $1;
  293. }, function($ctx1) {$ctx1.fill(self,"temps",{}, smalltalk.LexicalScope)})}
  294. }),
  295. smalltalk.LexicalScope);
  296. smalltalk.addClass('MethodLexicalScope', smalltalk.LexicalScope, ['iVars', 'pseudoVars', 'unknownVariables', 'localReturn', 'nonLocalReturns'], 'Compiler-Semantic');
  297. smalltalk.addMethod(
  298. "_addIVar_",
  299. smalltalk.method({
  300. selector: "addIVar:",
  301. fn: function (aString){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) { _st(_st(self)._iVars())._at_put_(aString,_st((smalltalk.InstanceVar || InstanceVar))._on_(aString));
  304. _st(_st(_st(self)._iVars())._at_(aString))._scope_(self);
  305. return self}, function($ctx1) {$ctx1.fill(self,"addIVar:",{aString:aString}, smalltalk.MethodLexicalScope)})}
  306. }),
  307. smalltalk.MethodLexicalScope);
  308. smalltalk.addMethod(
  309. "_addNonLocalReturn_",
  310. smalltalk.method({
  311. selector: "addNonLocalReturn:",
  312. fn: function (aScope){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) { _st(_st(self)._nonLocalReturns())._add_(aScope);
  315. return self}, function($ctx1) {$ctx1.fill(self,"addNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})}
  316. }),
  317. smalltalk.MethodLexicalScope);
  318. smalltalk.addMethod(
  319. "_allVariableNames",
  320. smalltalk.method({
  321. selector: "allVariableNames",
  322. fn: function (){
  323. var self=this;
  324. return smalltalk.withContext(function($ctx1) { var $1;
  325. $1=_st(smalltalk.LexicalScope.fn.prototype._allVariableNames.apply(_st(self), [])).__comma(_st(_st(self)._iVars())._keys());
  326. return $1;
  327. }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.MethodLexicalScope)})}
  328. }),
  329. smalltalk.MethodLexicalScope);
  330. smalltalk.addMethod(
  331. "_bindingFor_",
  332. smalltalk.method({
  333. selector: "bindingFor:",
  334. fn: function (aNode){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) { var $2,$1;
  337. $2=smalltalk.LexicalScope.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
  338. if(($receiver = $2) == nil || $receiver == undefined){
  339. $1=_st(_st(self)._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
  340. return smalltalk.withContext(function($ctx2) { return nil;
  341. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  342. } else {
  343. $1=$2;
  344. };
  345. return $1;
  346. }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aNode:aNode}, smalltalk.MethodLexicalScope)})}
  347. }),
  348. smalltalk.MethodLexicalScope);
  349. smalltalk.addMethod(
  350. "_canInlineNonLocalReturns",
  351. smalltalk.method({
  352. selector: "canInlineNonLocalReturns",
  353. fn: function (){
  354. var self=this;
  355. return smalltalk.withContext(function($ctx1) { return true;
  356. }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.MethodLexicalScope)})}
  357. }),
  358. smalltalk.MethodLexicalScope);
  359. smalltalk.addMethod(
  360. "_hasLocalReturn",
  361. smalltalk.method({
  362. selector: "hasLocalReturn",
  363. fn: function (){
  364. var self=this;
  365. return smalltalk.withContext(function($ctx1) { var $1;
  366. $1=_st(self)._localReturn();
  367. return $1;
  368. }, function($ctx1) {$ctx1.fill(self,"hasLocalReturn",{}, smalltalk.MethodLexicalScope)})}
  369. }),
  370. smalltalk.MethodLexicalScope);
  371. smalltalk.addMethod(
  372. "_hasNonLocalReturn",
  373. smalltalk.method({
  374. selector: "hasNonLocalReturn",
  375. fn: function (){
  376. var self=this;
  377. return smalltalk.withContext(function($ctx1) { var $1;
  378. $1=_st(_st(self)._nonLocalReturns())._notEmpty();
  379. return $1;
  380. }, function($ctx1) {$ctx1.fill(self,"hasNonLocalReturn",{}, smalltalk.MethodLexicalScope)})}
  381. }),
  382. smalltalk.MethodLexicalScope);
  383. smalltalk.addMethod(
  384. "_iVars",
  385. smalltalk.method({
  386. selector: "iVars",
  387. fn: function (){
  388. var self=this;
  389. return smalltalk.withContext(function($ctx1) { var $2,$1;
  390. $2=self["@iVars"];
  391. if(($receiver = $2) == nil || $receiver == undefined){
  392. self["@iVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  393. $1=self["@iVars"];
  394. } else {
  395. $1=$2;
  396. };
  397. return $1;
  398. }, function($ctx1) {$ctx1.fill(self,"iVars",{}, smalltalk.MethodLexicalScope)})}
  399. }),
  400. smalltalk.MethodLexicalScope);
  401. smalltalk.addMethod(
  402. "_isMethodScope",
  403. smalltalk.method({
  404. selector: "isMethodScope",
  405. fn: function (){
  406. var self=this;
  407. return smalltalk.withContext(function($ctx1) { return true;
  408. }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.MethodLexicalScope)})}
  409. }),
  410. smalltalk.MethodLexicalScope);
  411. smalltalk.addMethod(
  412. "_localReturn",
  413. smalltalk.method({
  414. selector: "localReturn",
  415. fn: function (){
  416. var self=this;
  417. return smalltalk.withContext(function($ctx1) { var $2,$1;
  418. $2=self["@localReturn"];
  419. if(($receiver = $2) == nil || $receiver == undefined){
  420. $1=false;
  421. } else {
  422. $1=$2;
  423. };
  424. return $1;
  425. }, function($ctx1) {$ctx1.fill(self,"localReturn",{}, smalltalk.MethodLexicalScope)})}
  426. }),
  427. smalltalk.MethodLexicalScope);
  428. smalltalk.addMethod(
  429. "_localReturn_",
  430. smalltalk.method({
  431. selector: "localReturn:",
  432. fn: function (aBoolean){
  433. var self=this;
  434. return smalltalk.withContext(function($ctx1) { self["@localReturn"]=aBoolean;
  435. return self}, function($ctx1) {$ctx1.fill(self,"localReturn:",{aBoolean:aBoolean}, smalltalk.MethodLexicalScope)})}
  436. }),
  437. smalltalk.MethodLexicalScope);
  438. smalltalk.addMethod(
  439. "_methodScope",
  440. smalltalk.method({
  441. selector: "methodScope",
  442. fn: function (){
  443. var self=this;
  444. return smalltalk.withContext(function($ctx1) { var $1;
  445. $1=self;
  446. return $1;
  447. }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.MethodLexicalScope)})}
  448. }),
  449. smalltalk.MethodLexicalScope);
  450. smalltalk.addMethod(
  451. "_nonLocalReturns",
  452. smalltalk.method({
  453. selector: "nonLocalReturns",
  454. fn: function (){
  455. var self=this;
  456. return smalltalk.withContext(function($ctx1) { var $2,$1;
  457. $2=self["@nonLocalReturns"];
  458. if(($receiver = $2) == nil || $receiver == undefined){
  459. self["@nonLocalReturns"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  460. $1=self["@nonLocalReturns"];
  461. } else {
  462. $1=$2;
  463. };
  464. return $1;
  465. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturns",{}, smalltalk.MethodLexicalScope)})}
  466. }),
  467. smalltalk.MethodLexicalScope);
  468. smalltalk.addMethod(
  469. "_pseudoVars",
  470. smalltalk.method({
  471. selector: "pseudoVars",
  472. fn: function (){
  473. var self=this;
  474. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  475. $1=self["@pseudoVars"];
  476. if(($receiver = $1) == nil || $receiver == undefined){
  477. self["@pseudoVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  478. self["@pseudoVars"];
  479. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._pseudoVariableNames())._do_((function(each){
  480. return smalltalk.withContext(function($ctx2) { $2=_st((smalltalk.PseudoVar || PseudoVar))._on_(each);
  481. _st($2)._scope_(_st(self)._methodScope());
  482. $3=_st($2)._yourself();
  483. return _st(self["@pseudoVars"])._at_put_(each,$3);
  484. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  485. } else {
  486. $1;
  487. };
  488. $4=self["@pseudoVars"];
  489. return $4;
  490. }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.MethodLexicalScope)})}
  491. }),
  492. smalltalk.MethodLexicalScope);
  493. smalltalk.addMethod(
  494. "_removeNonLocalReturn_",
  495. smalltalk.method({
  496. selector: "removeNonLocalReturn:",
  497. fn: function (aScope){
  498. var self=this;
  499. return smalltalk.withContext(function($ctx1) { _st(_st(self)._nonLocalReturns())._remove_ifAbsent_(aScope,(function(){
  500. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  501. return self}, function($ctx1) {$ctx1.fill(self,"removeNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})}
  502. }),
  503. smalltalk.MethodLexicalScope);
  504. smalltalk.addMethod(
  505. "_unknownVariables",
  506. smalltalk.method({
  507. selector: "unknownVariables",
  508. fn: function (){
  509. var self=this;
  510. return smalltalk.withContext(function($ctx1) { var $2,$1;
  511. $2=self["@unknownVariables"];
  512. if(($receiver = $2) == nil || $receiver == undefined){
  513. self["@unknownVariables"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  514. $1=self["@unknownVariables"];
  515. } else {
  516. $1=$2;
  517. };
  518. return $1;
  519. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.MethodLexicalScope)})}
  520. }),
  521. smalltalk.MethodLexicalScope);
  522. smalltalk.addClass('ScopeVar', smalltalk.Object, ['scope', 'name'], 'Compiler-Semantic');
  523. smalltalk.addMethod(
  524. "_alias",
  525. smalltalk.method({
  526. selector: "alias",
  527. fn: function (){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) { var $1;
  530. $1=_st(_st(self)._name())._asVariableName();
  531. return $1;
  532. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ScopeVar)})}
  533. }),
  534. smalltalk.ScopeVar);
  535. smalltalk.addMethod(
  536. "_isArgVar",
  537. smalltalk.method({
  538. selector: "isArgVar",
  539. fn: function (){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) { return false;
  542. }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ScopeVar)})}
  543. }),
  544. smalltalk.ScopeVar);
  545. smalltalk.addMethod(
  546. "_isClassRefVar",
  547. smalltalk.method({
  548. selector: "isClassRefVar",
  549. fn: function (){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) { return false;
  552. }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ScopeVar)})}
  553. }),
  554. smalltalk.ScopeVar);
  555. smalltalk.addMethod(
  556. "_isInstanceVar",
  557. smalltalk.method({
  558. selector: "isInstanceVar",
  559. fn: function (){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) { return false;
  562. }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.ScopeVar)})}
  563. }),
  564. smalltalk.ScopeVar);
  565. smalltalk.addMethod(
  566. "_isPseudoVar",
  567. smalltalk.method({
  568. selector: "isPseudoVar",
  569. fn: function (){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) { return false;
  572. }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.ScopeVar)})}
  573. }),
  574. smalltalk.ScopeVar);
  575. smalltalk.addMethod(
  576. "_isTempVar",
  577. smalltalk.method({
  578. selector: "isTempVar",
  579. fn: function (){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) { return false;
  582. }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.ScopeVar)})}
  583. }),
  584. smalltalk.ScopeVar);
  585. smalltalk.addMethod(
  586. "_isUnknownVar",
  587. smalltalk.method({
  588. selector: "isUnknownVar",
  589. fn: function (){
  590. var self=this;
  591. return smalltalk.withContext(function($ctx1) { return false;
  592. }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.ScopeVar)})}
  593. }),
  594. smalltalk.ScopeVar);
  595. smalltalk.addMethod(
  596. "_name",
  597. smalltalk.method({
  598. selector: "name",
  599. fn: function (){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) { var $1;
  602. $1=self["@name"];
  603. return $1;
  604. }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.ScopeVar)})}
  605. }),
  606. smalltalk.ScopeVar);
  607. smalltalk.addMethod(
  608. "_name_",
  609. smalltalk.method({
  610. selector: "name:",
  611. fn: function (aString){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  614. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.ScopeVar)})}
  615. }),
  616. smalltalk.ScopeVar);
  617. smalltalk.addMethod(
  618. "_scope",
  619. smalltalk.method({
  620. selector: "scope",
  621. fn: function (){
  622. var self=this;
  623. return smalltalk.withContext(function($ctx1) { var $1;
  624. $1=self["@scope"];
  625. return $1;
  626. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.ScopeVar)})}
  627. }),
  628. smalltalk.ScopeVar);
  629. smalltalk.addMethod(
  630. "_scope_",
  631. smalltalk.method({
  632. selector: "scope:",
  633. fn: function (aScope){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  636. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.ScopeVar)})}
  637. }),
  638. smalltalk.ScopeVar);
  639. smalltalk.addMethod(
  640. "_validateAssignment",
  641. smalltalk.method({
  642. selector: "validateAssignment",
  643. fn: function (){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  646. $1=_st(_st(self)._isArgVar())._or_((function(){
  647. return smalltalk.withContext(function($ctx2) { return _st(self)._isPseudoVar();
  648. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  649. if(smalltalk.assert($1)){
  650. $2=_st((smalltalk.InvalidAssignmentError || InvalidAssignmentError))._new();
  651. _st($2)._variableName_(_st(self)._name());
  652. $3=_st($2)._signal();
  653. $3;
  654. };
  655. return self}, function($ctx1) {$ctx1.fill(self,"validateAssignment",{}, smalltalk.ScopeVar)})}
  656. }),
  657. smalltalk.ScopeVar);
  658. smalltalk.addMethod(
  659. "_on_",
  660. smalltalk.method({
  661. selector: "on:",
  662. fn: function (aString){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  665. $2=_st(self)._new();
  666. _st($2)._name_(aString);
  667. $3=_st($2)._yourself();
  668. $1=$3;
  669. return $1;
  670. }, function($ctx1) {$ctx1.fill(self,"on:",{aString:aString}, smalltalk.ScopeVar.klass)})}
  671. }),
  672. smalltalk.ScopeVar.klass);
  673. smalltalk.addClass('AliasVar', smalltalk.ScopeVar, ['node'], 'Compiler-Semantic');
  674. smalltalk.addMethod(
  675. "_node",
  676. smalltalk.method({
  677. selector: "node",
  678. fn: function (){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) { var $1;
  681. $1=self["@node"];
  682. return $1;
  683. }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.AliasVar)})}
  684. }),
  685. smalltalk.AliasVar);
  686. smalltalk.addMethod(
  687. "_node_",
  688. smalltalk.method({
  689. selector: "node:",
  690. fn: function (aNode){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) { self["@node"]=aNode;
  693. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.AliasVar)})}
  694. }),
  695. smalltalk.AliasVar);
  696. smalltalk.addClass('ArgVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  697. smalltalk.addMethod(
  698. "_isArgVar",
  699. smalltalk.method({
  700. selector: "isArgVar",
  701. fn: function (){
  702. var self=this;
  703. return smalltalk.withContext(function($ctx1) { return true;
  704. }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ArgVar)})}
  705. }),
  706. smalltalk.ArgVar);
  707. smalltalk.addClass('ClassRefVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  708. smalltalk.addMethod(
  709. "_alias",
  710. smalltalk.method({
  711. selector: "alias",
  712. fn: function (){
  713. var self=this;
  714. return smalltalk.withContext(function($ctx1) { var $1;
  715. $1=_st(_st(_st(_st("(smalltalk.").__comma(_st(self)._name())).__comma(" || ")).__comma(_st(self)._name())).__comma(")");
  716. return $1;
  717. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ClassRefVar)})}
  718. }),
  719. smalltalk.ClassRefVar);
  720. smalltalk.addMethod(
  721. "_isClassRefVar",
  722. smalltalk.method({
  723. selector: "isClassRefVar",
  724. fn: function (){
  725. var self=this;
  726. return smalltalk.withContext(function($ctx1) { return true;
  727. }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ClassRefVar)})}
  728. }),
  729. smalltalk.ClassRefVar);
  730. smalltalk.addClass('InstanceVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  731. smalltalk.addMethod(
  732. "_alias",
  733. smalltalk.method({
  734. selector: "alias",
  735. fn: function (){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) { var $1;
  738. $1=_st(_st("self[\x22@").__comma(_st(self)._name())).__comma("\x22]");
  739. return $1;
  740. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.InstanceVar)})}
  741. }),
  742. smalltalk.InstanceVar);
  743. smalltalk.addMethod(
  744. "_isInstanceVar",
  745. smalltalk.method({
  746. selector: "isInstanceVar",
  747. fn: function (){
  748. var self=this;
  749. return smalltalk.withContext(function($ctx1) { return true;
  750. }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.InstanceVar)})}
  751. }),
  752. smalltalk.InstanceVar);
  753. smalltalk.addClass('PseudoVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  754. smalltalk.addMethod(
  755. "_alias",
  756. smalltalk.method({
  757. selector: "alias",
  758. fn: function (){
  759. var self=this;
  760. return smalltalk.withContext(function($ctx1) { var $1;
  761. $1=_st(self)._name();
  762. return $1;
  763. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.PseudoVar)})}
  764. }),
  765. smalltalk.PseudoVar);
  766. smalltalk.addMethod(
  767. "_isPseudoVar",
  768. smalltalk.method({
  769. selector: "isPseudoVar",
  770. fn: function (){
  771. var self=this;
  772. return smalltalk.withContext(function($ctx1) { return true;
  773. }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.PseudoVar)})}
  774. }),
  775. smalltalk.PseudoVar);
  776. smalltalk.addClass('TempVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  777. smalltalk.addMethod(
  778. "_isTempVar",
  779. smalltalk.method({
  780. selector: "isTempVar",
  781. fn: function (){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) { return true;
  784. }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.TempVar)})}
  785. }),
  786. smalltalk.TempVar);
  787. smalltalk.addClass('UnknownVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  788. smalltalk.addMethod(
  789. "_isUnknownVar",
  790. smalltalk.method({
  791. selector: "isUnknownVar",
  792. fn: function (){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) { return true;
  795. }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.UnknownVar)})}
  796. }),
  797. smalltalk.UnknownVar);
  798. smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends', 'superSends'], 'Compiler-Semantic');
  799. smalltalk.addMethod(
  800. "_classReferences",
  801. smalltalk.method({
  802. selector: "classReferences",
  803. fn: function (){
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) { var $2,$1;
  806. $2=self["@classReferences"];
  807. if(($receiver = $2) == nil || $receiver == undefined){
  808. self["@classReferences"]=_st((smalltalk.Set || Set))._new();
  809. $1=self["@classReferences"];
  810. } else {
  811. $1=$2;
  812. };
  813. return $1;
  814. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.SemanticAnalyzer)})}
  815. }),
  816. smalltalk.SemanticAnalyzer);
  817. smalltalk.addMethod(
  818. "_errorShadowingVariable_",
  819. smalltalk.method({
  820. selector: "errorShadowingVariable:",
  821. fn: function (aString){
  822. var self=this;
  823. return smalltalk.withContext(function($ctx1) { var $1,$2;
  824. $1=_st((smalltalk.ShadowingVariableError || ShadowingVariableError))._new();
  825. _st($1)._variableName_(aString);
  826. $2=_st($1)._signal();
  827. return self}, function($ctx1) {$ctx1.fill(self,"errorShadowingVariable:",{aString:aString}, smalltalk.SemanticAnalyzer)})}
  828. }),
  829. smalltalk.SemanticAnalyzer);
  830. smalltalk.addMethod(
  831. "_errorUnknownVariable_",
  832. smalltalk.method({
  833. selector: "errorUnknownVariable:",
  834. fn: function (aNode){
  835. var self=this;
  836. var identifier;
  837. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  838. identifier=_st(aNode)._value();
  839. $1=_st(_st(_st(["jQuery", "window", "process", "global"])._includes_(identifier))._not())._and_((function(){
  840. return smalltalk.withContext(function($ctx2) { return _st(self)._isVariableGloballyUndefined_(identifier);
  841. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  842. if(smalltalk.assert($1)){
  843. $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
  844. _st($2)._variableName_(_st(aNode)._value());
  845. $3=_st($2)._signal();
  846. $3;
  847. } else {
  848. _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
  849. };
  850. return self}, function($ctx1) {$ctx1.fill(self,"errorUnknownVariable:",{aNode:aNode,identifier:identifier}, smalltalk.SemanticAnalyzer)})}
  851. }),
  852. smalltalk.SemanticAnalyzer);
  853. smalltalk.addMethod(
  854. "_isVariableGloballyUndefined_",
  855. smalltalk.method({
  856. selector: "isVariableGloballyUndefined:",
  857. fn: function (aString){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) { return eval('typeof ' + aString + ' == "undefined"');
  860. return self}, function($ctx1) {$ctx1.fill(self,"isVariableGloballyUndefined:",{aString:aString}, smalltalk.SemanticAnalyzer)})}
  861. }),
  862. smalltalk.SemanticAnalyzer);
  863. smalltalk.addMethod(
  864. "_messageSends",
  865. smalltalk.method({
  866. selector: "messageSends",
  867. fn: function (){
  868. var self=this;
  869. return smalltalk.withContext(function($ctx1) { var $2,$1;
  870. $2=self["@messageSends"];
  871. if(($receiver = $2) == nil || $receiver == undefined){
  872. self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  873. $1=self["@messageSends"];
  874. } else {
  875. $1=$2;
  876. };
  877. return $1;
  878. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.SemanticAnalyzer)})}
  879. }),
  880. smalltalk.SemanticAnalyzer);
  881. smalltalk.addMethod(
  882. "_newBlockScope",
  883. smalltalk.method({
  884. selector: "newBlockScope",
  885. fn: function (){
  886. var self=this;
  887. return smalltalk.withContext(function($ctx1) { var $1;
  888. $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
  889. return $1;
  890. }, function($ctx1) {$ctx1.fill(self,"newBlockScope",{}, smalltalk.SemanticAnalyzer)})}
  891. }),
  892. smalltalk.SemanticAnalyzer);
  893. smalltalk.addMethod(
  894. "_newMethodScope",
  895. smalltalk.method({
  896. selector: "newMethodScope",
  897. fn: function (){
  898. var self=this;
  899. return smalltalk.withContext(function($ctx1) { var $1;
  900. $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
  901. return $1;
  902. }, function($ctx1) {$ctx1.fill(self,"newMethodScope",{}, smalltalk.SemanticAnalyzer)})}
  903. }),
  904. smalltalk.SemanticAnalyzer);
  905. smalltalk.addMethod(
  906. "_newScopeOfClass_",
  907. smalltalk.method({
  908. selector: "newScopeOfClass:",
  909. fn: function (aLexicalScopeClass){
  910. var self=this;
  911. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  912. $2=_st(aLexicalScopeClass)._new();
  913. _st($2)._outerScope_(self["@currentScope"]);
  914. $3=_st($2)._yourself();
  915. $1=$3;
  916. return $1;
  917. }, function($ctx1) {$ctx1.fill(self,"newScopeOfClass:",{aLexicalScopeClass:aLexicalScopeClass}, smalltalk.SemanticAnalyzer)})}
  918. }),
  919. smalltalk.SemanticAnalyzer);
  920. smalltalk.addMethod(
  921. "_popScope",
  922. smalltalk.method({
  923. selector: "popScope",
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) { var $1;
  927. $1=self["@currentScope"];
  928. if(($receiver = $1) == nil || $receiver == undefined){
  929. $1;
  930. } else {
  931. self["@currentScope"]=_st(self["@currentScope"])._outerScope();
  932. self["@currentScope"];
  933. };
  934. return self}, function($ctx1) {$ctx1.fill(self,"popScope",{}, smalltalk.SemanticAnalyzer)})}
  935. }),
  936. smalltalk.SemanticAnalyzer);
  937. smalltalk.addMethod(
  938. "_pushScope_",
  939. smalltalk.method({
  940. selector: "pushScope:",
  941. fn: function (aScope){
  942. var self=this;
  943. return smalltalk.withContext(function($ctx1) { _st(aScope)._outerScope_(self["@currentScope"]);
  944. self["@currentScope"]=aScope;
  945. return self}, function($ctx1) {$ctx1.fill(self,"pushScope:",{aScope:aScope}, smalltalk.SemanticAnalyzer)})}
  946. }),
  947. smalltalk.SemanticAnalyzer);
  948. smalltalk.addMethod(
  949. "_superSends",
  950. smalltalk.method({
  951. selector: "superSends",
  952. fn: function (){
  953. var self=this;
  954. return smalltalk.withContext(function($ctx1) { var $2,$1;
  955. $2=self["@superSends"];
  956. if(($receiver = $2) == nil || $receiver == undefined){
  957. self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  958. $1=self["@superSends"];
  959. } else {
  960. $1=$2;
  961. };
  962. return $1;
  963. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.SemanticAnalyzer)})}
  964. }),
  965. smalltalk.SemanticAnalyzer);
  966. smalltalk.addMethod(
  967. "_theClass",
  968. smalltalk.method({
  969. selector: "theClass",
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) { var $1;
  973. $1=self["@theClass"];
  974. return $1;
  975. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.SemanticAnalyzer)})}
  976. }),
  977. smalltalk.SemanticAnalyzer);
  978. smalltalk.addMethod(
  979. "_theClass_",
  980. smalltalk.method({
  981. selector: "theClass:",
  982. fn: function (aClass){
  983. var self=this;
  984. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  985. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.SemanticAnalyzer)})}
  986. }),
  987. smalltalk.SemanticAnalyzer);
  988. smalltalk.addMethod(
  989. "_validateVariableScope_",
  990. smalltalk.method({
  991. selector: "validateVariableScope:",
  992. fn: function (aString){
  993. var self=this;
  994. return smalltalk.withContext(function($ctx1) { var $1;
  995. $1=_st(self["@currentScope"])._lookupVariable_(aString);
  996. if(($receiver = $1) == nil || $receiver == undefined){
  997. $1;
  998. } else {
  999. _st(self)._errorShadowingVariable_(aString);
  1000. };
  1001. return self}, function($ctx1) {$ctx1.fill(self,"validateVariableScope:",{aString:aString}, smalltalk.SemanticAnalyzer)})}
  1002. }),
  1003. smalltalk.SemanticAnalyzer);
  1004. smalltalk.addMethod(
  1005. "_visitAssignmentNode_",
  1006. smalltalk.method({
  1007. selector: "visitAssignmentNode:",
  1008. fn: function (aNode){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) { smalltalk.NodeVisitor.fn.prototype._visitAssignmentNode_.apply(_st(self), [aNode]);
  1011. _st(_st(aNode)._left())._beAssigned();
  1012. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1013. }),
  1014. smalltalk.SemanticAnalyzer);
  1015. smalltalk.addMethod(
  1016. "_visitBlockNode_",
  1017. smalltalk.method({
  1018. selector: "visitBlockNode:",
  1019. fn: function (aNode){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) { _st(self)._pushScope_(_st(self)._newBlockScope());
  1022. _st(aNode)._scope_(self["@currentScope"]);
  1023. _st(self["@currentScope"])._node_(aNode);
  1024. _st(_st(aNode)._parameters())._do_((function(each){
  1025. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  1026. return _st(self["@currentScope"])._addArg_(each);
  1027. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1028. smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  1029. _st(self)._popScope();
  1030. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1031. }),
  1032. smalltalk.SemanticAnalyzer);
  1033. smalltalk.addMethod(
  1034. "_visitCascadeNode_",
  1035. smalltalk.method({
  1036. selector: "visitCascadeNode:",
  1037. fn: function (aNode){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) { var $1;
  1040. _st(_st(aNode)._nodes())._do_((function(each){
  1041. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(aNode)._receiver());
  1042. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1043. smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
  1044. $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
  1045. if(smalltalk.assert($1)){
  1046. _st(_st(aNode)._nodes())._do_((function(each){
  1047. return smalltalk.withContext(function($ctx2) { return _st(each)._superSend_(true);
  1048. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1049. };
  1050. return self}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1051. }),
  1052. smalltalk.SemanticAnalyzer);
  1053. smalltalk.addMethod(
  1054. "_visitClassReferenceNode_",
  1055. smalltalk.method({
  1056. selector: "visitClassReferenceNode:",
  1057. fn: function (aNode){
  1058. var self=this;
  1059. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1060. _st(_st(self)._classReferences())._add_(_st(aNode)._value());
  1061. $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
  1062. _st($1)._name_(_st(aNode)._value());
  1063. $2=_st($1)._yourself();
  1064. _st(aNode)._binding_($2);
  1065. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1066. }),
  1067. smalltalk.SemanticAnalyzer);
  1068. smalltalk.addMethod(
  1069. "_visitMethodNode_",
  1070. smalltalk.method({
  1071. selector: "visitMethodNode:",
  1072. fn: function (aNode){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1075. _st(self)._pushScope_(_st(self)._newMethodScope());
  1076. _st(aNode)._scope_(self["@currentScope"]);
  1077. _st(self["@currentScope"])._node_(aNode);
  1078. _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
  1079. return smalltalk.withContext(function($ctx2) { return _st(self["@currentScope"])._addIVar_(each);
  1080. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1081. _st(_st(aNode)._arguments())._do_((function(each){
  1082. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  1083. return _st(self["@currentScope"])._addArg_(each);
  1084. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1085. smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
  1086. $1=aNode;
  1087. _st($1)._classReferences_(_st(self)._classReferences());
  1088. _st($1)._messageSends_(_st(_st(self)._messageSends())._keys());
  1089. $2=_st($1)._superSends_(_st(_st(self)._superSends())._keys());
  1090. _st(self)._popScope();
  1091. return self}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1092. }),
  1093. smalltalk.SemanticAnalyzer);
  1094. smalltalk.addMethod(
  1095. "_visitReturnNode_",
  1096. smalltalk.method({
  1097. selector: "visitReturnNode:",
  1098. fn: function (aNode){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) { var $1;
  1101. _st(aNode)._scope_(self["@currentScope"]);
  1102. $1=_st(self["@currentScope"])._isMethodScope();
  1103. if(smalltalk.assert($1)){
  1104. _st(self["@currentScope"])._localReturn_(true);
  1105. } else {
  1106. _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
  1107. };
  1108. smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
  1109. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1110. }),
  1111. smalltalk.SemanticAnalyzer);
  1112. smalltalk.addMethod(
  1113. "_visitSendNode_",
  1114. smalltalk.method({
  1115. selector: "visitSendNode:",
  1116. fn: function (aNode){
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3;
  1119. $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
  1120. $2=(function(){
  1121. return smalltalk.withContext(function($ctx2) { _st(aNode)._superSend_(true);
  1122. _st(_st(aNode)._receiver())._value_("self");
  1123. _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1124. return smalltalk.withContext(function($ctx3) { return _st((smalltalk.Set || Set))._new();
  1125. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1126. return _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1127. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1128. $3=(function(){
  1129. return smalltalk.withContext(function($ctx2) { $4=_st(_st((smalltalk.IRSendInliner || IRSendInliner))._inlinedSelectors())._includes_(_st(aNode)._selector());
  1130. if(smalltalk.assert($4)){
  1131. _st(aNode)._shouldBeInlined_(true);
  1132. return _st(_st(aNode)._receiver())._shouldBeAliased_(true);
  1133. };
  1134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1135. _st($1)._ifTrue_ifFalse_($2,$3);
  1136. _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1137. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.Set || Set))._new();
  1138. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1139. _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1140. _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
  1141. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1142. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1143. }),
  1144. smalltalk.SemanticAnalyzer);
  1145. smalltalk.addMethod(
  1146. "_visitSequenceNode_",
  1147. smalltalk.method({
  1148. selector: "visitSequenceNode:",
  1149. fn: function (aNode){
  1150. var self=this;
  1151. return smalltalk.withContext(function($ctx1) { _st(_st(aNode)._temps())._do_((function(each){
  1152. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  1153. return _st(self["@currentScope"])._addTemp_(each);
  1154. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1155. smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
  1156. return self}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1157. }),
  1158. smalltalk.SemanticAnalyzer);
  1159. smalltalk.addMethod(
  1160. "_visitVariableNode_",
  1161. smalltalk.method({
  1162. selector: "visitVariableNode:",
  1163. fn: function (aNode){
  1164. var self=this;
  1165. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$2;
  1166. $1=aNode;
  1167. $3=_st(self["@currentScope"])._lookupVariable_(aNode);
  1168. if(($receiver = $3) == nil || $receiver == undefined){
  1169. _st(self)._errorUnknownVariable_(aNode);
  1170. $4=_st((smalltalk.UnknownVar || UnknownVar))._new();
  1171. _st($4)._name_(_st(aNode)._value());
  1172. $5=_st($4)._yourself();
  1173. $2=$5;
  1174. } else {
  1175. $2=$3;
  1176. };
  1177. _st($1)._binding_($2);
  1178. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})}
  1179. }),
  1180. smalltalk.SemanticAnalyzer);
  1181. smalltalk.addMethod(
  1182. "_on_",
  1183. smalltalk.method({
  1184. selector: "on:",
  1185. fn: function (aClass){
  1186. var self=this;
  1187. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1188. $2=_st(self)._new();
  1189. _st($2)._theClass_(aClass);
  1190. $3=_st($2)._yourself();
  1191. $1=$3;
  1192. return $1;
  1193. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass}, smalltalk.SemanticAnalyzer.klass)})}
  1194. }),
  1195. smalltalk.SemanticAnalyzer.klass);