Compiler-Semantic.deploy.js 43 KB

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