Compiler-Semantic.deploy.js 45 KB

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