ZenScript main repository
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

classes.zs 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. public class myTestClass {
  2. var nonFinalInt as int = 10;
  3. val finalInt as int = 20;
  4. static var staticNonFinalInt as int = 10;
  5. public this() {
  6. }
  7. public this(nonfinalInt as int) {
  8. this.nonFinalInt = nonfinalInt;
  9. println(nonfinalInt);
  10. }
  11. public test() as string {
  12. return "TEST";
  13. }
  14. }
  15. val tt = new myTestClass(666);
  16. println(tt.test());
  17. public interface myTestInterface {
  18. test() as string;
  19. }
  20. public enum myTestEnum {
  21. ADD(6),
  22. SUB(6),
  23. MUL(7),
  24. DIV(7),
  25. MOD(7),
  26. CAT(6),
  27. OR(4),
  28. AND(4),
  29. XOR(4),
  30. NEG(8),
  31. NOT(8),
  32. INVERT(8),
  33. CONTAINS(5),
  34. COMPARE(5),
  35. ASSIGN(0),
  36. ADDASSIGN(0),
  37. SUBASSIGN(0),
  38. MULASSIGN(0),
  39. DIVASSIGN(0),
  40. MODASSIGN(0),
  41. CATASSIGN(0),
  42. ORASSIGN(0),
  43. ANDASSIGN(0),
  44. XORASSIGN(0),
  45. ANDAND(3),
  46. OROR(2),
  47. TERNARY(1),
  48. COALESCE(2),
  49. INCREMENT(8),
  50. DECREMENT(8),
  51. MEMBER(9),
  52. RANGE(9),
  53. INDEX(9),
  54. CALL(9),
  55. CAST(9),
  56. PRIMARY(10);
  57. private val priority as int;
  58. private val isCommutative as bool;
  59. public static val test as int = 10;
  60. this(i as int) {
  61. this(i, false);
  62. }
  63. this(i as int, isCommutative as bool) {
  64. this.priority = i;
  65. this.isCommutative = isCommutative;
  66. }
  67. }