]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/enum.qc
Make it a function
[xonotic/gmqcc.git] / tests / enum.qc
index 521863357694f66e77f3edcdb06576b1353b786b..42853d85ffc3886218c3d24319484c8daea3d890 100644 (file)
@@ -1,4 +1,4 @@
-void(string, ...)   print  = #1;enum {
+enum {
     // this behaviour is confusing, but I like that
     // we support it.
     __ = (__ - 1),
@@ -27,8 +27,20 @@ enum {
     N
 };
 
-void (string, ...) print = #1;
-string (float)  ftos = #2;
+enum : flag {
+    F1, /* = 1 << 1 */
+    F2, /* = 1 << 2 */
+    F3  /* = 1 << 3 */
+};
+
+/* reversed enumeration */
+enum : reverse {
+    R1, // 3
+    R2, // 2
+    R3, // 1
+    R4  // 0
+};
+
 void main() {
     print(ftos(A), "\n");
     print(ftos(B), "\n");
@@ -44,4 +56,13 @@ void main() {
     print(ftos(L), "\n");
     print(ftos(M), "\n");
     print(ftos(N), "\n");
+
+    print(ftos(F1), "\n");
+    print(ftos(F2), "\n");
+    print(ftos(F3), "\n");
+
+    print(ftos(R1), "\n");
+    print(ftos(R2), "\n");
+    print(ftos(R3), "\n");
+    print(ftos(R4), "\n");
 };