1
0

Compiler-Exceptions.deploy.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. smalltalk.addPackage('Compiler-Exceptions');
  2. smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
  3. smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  4. smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  5. smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler-Exceptions');
  6. smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  7. smalltalk.addMethod(
  8. smalltalk.method({
  9. selector: "messageText",
  10. fn: function (){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. var $1;
  14. $1=" Invalid assignment to variable: ".__comma(self._variableName());
  15. return $1;
  16. }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.InvalidAssignmentError)})},
  17. messageSends: [",", "variableName"]}),
  18. smalltalk.InvalidAssignmentError);
  19. smalltalk.addMethod(
  20. smalltalk.method({
  21. selector: "variableName",
  22. fn: function (){
  23. var self=this;
  24. return smalltalk.withContext(function($ctx1) {
  25. var $1;
  26. $1=self["@variableName"];
  27. return $1;
  28. }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.InvalidAssignmentError)})},
  29. messageSends: []}),
  30. smalltalk.InvalidAssignmentError);
  31. smalltalk.addMethod(
  32. smalltalk.method({
  33. selector: "variableName:",
  34. fn: function (aString){
  35. var self=this;
  36. return smalltalk.withContext(function($ctx1) {
  37. self["@variableName"]=aString;
  38. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.InvalidAssignmentError)})},
  39. messageSends: []}),
  40. smalltalk.InvalidAssignmentError);
  41. smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  42. smalltalk.addMethod(
  43. smalltalk.method({
  44. selector: "messageText",
  45. fn: function (){
  46. var self=this;
  47. return smalltalk.withContext(function($ctx1) {
  48. var $1;
  49. $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
  50. return $1;
  51. }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.ShadowingVariableError)})},
  52. messageSends: [",", "variableName"]}),
  53. smalltalk.ShadowingVariableError);
  54. smalltalk.addMethod(
  55. smalltalk.method({
  56. selector: "variableName",
  57. fn: function (){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) {
  60. var $1;
  61. $1=self["@variableName"];
  62. return $1;
  63. }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.ShadowingVariableError)})},
  64. messageSends: []}),
  65. smalltalk.ShadowingVariableError);
  66. smalltalk.addMethod(
  67. smalltalk.method({
  68. selector: "variableName:",
  69. fn: function (aString){
  70. var self=this;
  71. return smalltalk.withContext(function($ctx1) {
  72. self["@variableName"]=aString;
  73. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.ShadowingVariableError)})},
  74. messageSends: []}),
  75. smalltalk.ShadowingVariableError);
  76. smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  77. smalltalk.addMethod(
  78. smalltalk.method({
  79. selector: "messageText",
  80. fn: function (){
  81. var self=this;
  82. return smalltalk.withContext(function($ctx1) {
  83. var $1;
  84. $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
  85. return $1;
  86. }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.UnknownVariableError)})},
  87. messageSends: [",", "variableName"]}),
  88. smalltalk.UnknownVariableError);
  89. smalltalk.addMethod(
  90. smalltalk.method({
  91. selector: "variableName",
  92. fn: function (){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) {
  95. var $1;
  96. $1=self["@variableName"];
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.UnknownVariableError)})},
  99. messageSends: []}),
  100. smalltalk.UnknownVariableError);
  101. smalltalk.addMethod(
  102. smalltalk.method({
  103. selector: "variableName:",
  104. fn: function (aString){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. self["@variableName"]=aString;
  108. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.UnknownVariableError)})},
  109. messageSends: []}),
  110. smalltalk.UnknownVariableError);
  111. smalltalk.addClass('RethrowErrorHandler', smalltalk.ErrorHandler, [], 'Compiler-Exceptions');
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "basicSignal:",
  115. fn: function (anError){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) {
  118. throw anError;
  119. return self}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError},smalltalk.RethrowErrorHandler)})},
  120. messageSends: []}),
  121. smalltalk.RethrowErrorHandler);
  122. smalltalk.addMethod(
  123. smalltalk.method({
  124. selector: "handleError:",
  125. fn: function (anError){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) {
  128. smalltalk.RethrowErrorHandler.superclass.fn.prototype._handleError_.apply(_st(self), [anError]);
  129. self._basicSignal_(anError);
  130. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.RethrowErrorHandler)})},
  131. messageSends: ["handleError:", "basicSignal:"]}),
  132. smalltalk.RethrowErrorHandler);