ZenScript main repository
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

classes.zs 1.2KB

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