Compiler-Semantic.deploy.js 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  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:", "on:", "args", "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:", "on:", "temps", "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", "temps", "args"]}),
  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:", "value", "temps", "args", "pseudoVars"]}),
  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:", "canInlineNonLocalReturns", "outerScope", "isInlined"]}),
  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:", "isInlined", "instruction", "notNil"]}),
  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:", "lookupVariable:", "outerScope"]}),
  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:", "methodScope", "outerScope"]}),
  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:", "scopeLevel", "isInlined", "+"]}),
  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:", "on:", "iVars", "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: [",", "keys", "iVars", "allVariableNames"]}),
  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:", "at:ifAbsent:", "value", "iVars", "bindingFor:"]}),
  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 $PseudoVar(){return smalltalk.PseudoVar||(typeof PseudoVar=="undefined"?nil:PseudoVar)}
  489. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  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:", "at:put:", "scope:", "methodScope", "on:", "yourself", "pseudoVariableNames", "current"]}),
  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:", "variableName:", "name", "new", "signal", "or:", "isPseudoVar", "isArgVar"]}),
  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:", "variableName:", "new", "signal", "add:", "unknownVariables", "methodScope", "and:", "isVariableGloballyUndefined:", "not", "includes:"]}),
  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:", "errorShadowingVariable:", "lookupVariable:"]}),
  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:", "validateVariableScope:", "addArg:", "parameters", "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. _st(_st(aNode)._nodes())._do_((function(each){
  1072. return smalltalk.withContext(function($ctx2) {
  1073. return _st(each)._receiver_(_st(aNode)._receiver());
  1074. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1075. smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
  1076. $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
  1077. if(smalltalk.assert($1)){
  1078. _st(_st(aNode)._nodes())._do_((function(each){
  1079. return smalltalk.withContext(function($ctx2) {
  1080. return _st(each)._superSend_(true);
  1081. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1082. };
  1083. return self}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1084. messageSends: ["do:", "receiver:", "receiver", "nodes", "visitCascadeNode:", "ifTrue:", "superSend:", "superSend", "first"]}),
  1085. smalltalk.SemanticAnalyzer);
  1086. smalltalk.addMethod(
  1087. smalltalk.method({
  1088. selector: "visitClassReferenceNode:",
  1089. fn: function (aNode){
  1090. var self=this;
  1091. function $ClassRefVar(){return smalltalk.ClassRefVar||(typeof ClassRefVar=="undefined"?nil:ClassRefVar)}
  1092. return smalltalk.withContext(function($ctx1) {
  1093. var $1,$2;
  1094. _st(self._classReferences())._add_(_st(aNode)._value());
  1095. $1=_st($ClassRefVar())._new();
  1096. _st($1)._name_(_st(aNode)._value());
  1097. $2=_st($1)._yourself();
  1098. _st(aNode)._binding_($2);
  1099. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1100. messageSends: ["add:", "value", "classReferences", "binding:", "name:", "new", "yourself"]}),
  1101. smalltalk.SemanticAnalyzer);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "visitMethodNode:",
  1105. fn: function (aNode){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) {
  1108. var $1,$2;
  1109. self._pushScope_(self._newMethodScope());
  1110. _st(aNode)._scope_(self["@currentScope"]);
  1111. _st(self["@currentScope"])._node_(aNode);
  1112. _st(_st(self._theClass())._allInstanceVariableNames())._do_((function(each){
  1113. return smalltalk.withContext(function($ctx2) {
  1114. return _st(self["@currentScope"])._addIVar_(each);
  1115. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1116. _st(_st(aNode)._arguments())._do_((function(each){
  1117. return smalltalk.withContext(function($ctx2) {
  1118. self._validateVariableScope_(each);
  1119. return _st(self["@currentScope"])._addArg_(each);
  1120. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1121. smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
  1122. $1=aNode;
  1123. _st($1)._classReferences_(self._classReferences());
  1124. _st($1)._messageSends_(_st(self._messageSends())._keys());
  1125. $2=_st($1)._superSends_(_st(self._superSends())._keys());
  1126. self._popScope();
  1127. return self}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1128. messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "addIVar:", "allInstanceVariableNames", "theClass", "validateVariableScope:", "addArg:", "arguments", "visitMethodNode:", "classReferences:", "classReferences", "messageSends:", "keys", "messageSends", "superSends:", "superSends", "popScope"]}),
  1129. smalltalk.SemanticAnalyzer);
  1130. smalltalk.addMethod(
  1131. smalltalk.method({
  1132. selector: "visitReturnNode:",
  1133. fn: function (aNode){
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) {
  1136. var $1;
  1137. _st(aNode)._scope_(self["@currentScope"]);
  1138. $1=_st(self["@currentScope"])._isMethodScope();
  1139. if(smalltalk.assert($1)){
  1140. _st(self["@currentScope"])._localReturn_(true);
  1141. } else {
  1142. _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
  1143. };
  1144. smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
  1145. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1146. messageSends: ["scope:", "ifTrue:ifFalse:", "localReturn:", "addNonLocalReturn:", "methodScope", "isMethodScope", "visitReturnNode:"]}),
  1147. smalltalk.SemanticAnalyzer);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "visitSendNode:",
  1151. fn: function (aNode){
  1152. var self=this;
  1153. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  1154. function $IRSendInliner(){return smalltalk.IRSendInliner||(typeof IRSendInliner=="undefined"?nil:IRSendInliner)}
  1155. return smalltalk.withContext(function($ctx1) {
  1156. var $1,$2;
  1157. $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
  1158. if(smalltalk.assert($1)){
  1159. _st(aNode)._superSend_(true);
  1160. _st(_st(aNode)._receiver())._value_("self");
  1161. _st(self._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1162. return smalltalk.withContext(function($ctx2) {
  1163. return _st($Set())._new();
  1164. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1165. _st(_st(self._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1166. } else {
  1167. $2=_st(_st($IRSendInliner())._inlinedSelectors())._includes_(_st(aNode)._selector());
  1168. if(smalltalk.assert($2)){
  1169. _st(aNode)._shouldBeInlined_(true);
  1170. _st(_st(aNode)._receiver())._shouldBeAliased_(true);
  1171. };
  1172. };
  1173. _st(self._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1174. return smalltalk.withContext(function($ctx2) {
  1175. return _st($Set())._new();
  1176. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1177. _st(_st(self._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1178. _st(aNode)._index_(_st(_st(self._messageSends())._at_(_st(aNode)._selector()))._size());
  1179. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1180. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1181. messageSends: ["ifTrue:ifFalse:", "superSend:", "value:", "receiver", "at:ifAbsentPut:", "selector", "new", "superSends", "add:", "at:", "ifTrue:", "shouldBeInlined:", "shouldBeAliased:", "includes:", "inlinedSelectors", "=", "value", "messageSends", "index:", "size", "visitSendNode:"]}),
  1182. smalltalk.SemanticAnalyzer);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "visitSequenceNode:",
  1186. fn: function (aNode){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. _st(_st(aNode)._temps())._do_((function(each){
  1190. return smalltalk.withContext(function($ctx2) {
  1191. self._validateVariableScope_(each);
  1192. return _st(self["@currentScope"])._addTemp_(each);
  1193. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1194. smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
  1195. return self}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1196. messageSends: ["do:", "validateVariableScope:", "addTemp:", "temps", "visitSequenceNode:"]}),
  1197. smalltalk.SemanticAnalyzer);
  1198. smalltalk.addMethod(
  1199. smalltalk.method({
  1200. selector: "visitVariableNode:",
  1201. fn: function (aNode){
  1202. var self=this;
  1203. function $UnknownVar(){return smalltalk.UnknownVar||(typeof UnknownVar=="undefined"?nil:UnknownVar)}
  1204. return smalltalk.withContext(function($ctx1) {
  1205. var $1,$3,$4,$5,$2;
  1206. $1=aNode;
  1207. $3=_st(self["@currentScope"])._lookupVariable_(aNode);
  1208. if(($receiver = $3) == nil || $receiver == undefined){
  1209. self._errorUnknownVariable_(aNode);
  1210. $4=_st($UnknownVar())._new();
  1211. _st($4)._name_(_st(aNode)._value());
  1212. $5=_st($4)._yourself();
  1213. $2=$5;
  1214. } else {
  1215. $2=$3;
  1216. };
  1217. _st($1)._binding_($2);
  1218. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
  1219. messageSends: ["binding:", "ifNil:", "errorUnknownVariable:", "name:", "value", "new", "yourself", "lookupVariable:"]}),
  1220. smalltalk.SemanticAnalyzer);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "on:",
  1224. fn: function (aClass){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) {
  1227. var $2,$3,$1;
  1228. $2=self._new();
  1229. _st($2)._theClass_(aClass);
  1230. $3=_st($2)._yourself();
  1231. $1=$3;
  1232. return $1;
  1233. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass},smalltalk.SemanticAnalyzer.klass)})},
  1234. messageSends: ["theClass:", "new", "yourself"]}),
  1235. smalltalk.SemanticAnalyzer.klass);