Compiler-Semantic.deploy.js 44 KB

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