Compiler-Semantic.deploy.js 43 KB

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