Compiler-Exceptions.deploy.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. "_messageText",
  9. smalltalk.method({
  10. selector: "messageText",
  11. fn: function (){
  12. var self=this;
  13. var $1;
  14. $1=smalltalk.send(" Invalid assignment to variable: ","__comma",[smalltalk.send(self,"_variableName",[])]);
  15. return $1;
  16. }
  17. }),
  18. smalltalk.InvalidAssignmentError);
  19. smalltalk.addMethod(
  20. "_variableName",
  21. smalltalk.method({
  22. selector: "variableName",
  23. fn: function (){
  24. var self=this;
  25. return self["@variableName"];
  26. }
  27. }),
  28. smalltalk.InvalidAssignmentError);
  29. smalltalk.addMethod(
  30. "_variableName_",
  31. smalltalk.method({
  32. selector: "variableName:",
  33. fn: function (aString){
  34. var self=this;
  35. self["@variableName"]=aString;
  36. return self}
  37. }),
  38. smalltalk.InvalidAssignmentError);
  39. smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  40. smalltalk.addMethod(
  41. "_messageText",
  42. smalltalk.method({
  43. selector: "messageText",
  44. fn: function (){
  45. var self=this;
  46. var $1;
  47. $1=smalltalk.send(smalltalk.send("Variable shadowing error: ","__comma",[smalltalk.send(self,"_variableName",[])]),"__comma",[" is already defined"]);
  48. return $1;
  49. }
  50. }),
  51. smalltalk.ShadowingVariableError);
  52. smalltalk.addMethod(
  53. "_variableName",
  54. smalltalk.method({
  55. selector: "variableName",
  56. fn: function (){
  57. var self=this;
  58. return self["@variableName"];
  59. }
  60. }),
  61. smalltalk.ShadowingVariableError);
  62. smalltalk.addMethod(
  63. "_variableName_",
  64. smalltalk.method({
  65. selector: "variableName:",
  66. fn: function (aString){
  67. var self=this;
  68. self["@variableName"]=aString;
  69. return self}
  70. }),
  71. smalltalk.ShadowingVariableError);
  72. smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  73. smalltalk.addMethod(
  74. "_variableName",
  75. smalltalk.method({
  76. selector: "variableName",
  77. fn: function (){
  78. var self=this;
  79. return self["@variableName"];
  80. }
  81. }),
  82. smalltalk.UnknownVariableError);
  83. smalltalk.addMethod(
  84. "_variableName_",
  85. smalltalk.method({
  86. selector: "variableName:",
  87. fn: function (aString){
  88. var self=this;
  89. self["@variableName"]=aString;
  90. return self}
  91. }),
  92. smalltalk.UnknownVariableError);