Compiler-Semantic.deploy.js 45 KB

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