diff misc/Error.d @ 36:ce17bea8e9bd new_gen

Switch statements support Can only switch on IntegerLit's but multiple values per case and the default are supported. An error is emitted if a value is used multiple times or if theres is more than one default block
author Anders Halager <halager@gmail.com>
date Sun, 20 Apr 2008 22:39:07 +0200
parents 084c2c147c4f
children 4ae365eff712
line wrap: on
line diff
--- a/misc/Error.d	Sun Apr 20 21:33:50 2008 +0200
+++ b/misc/Error.d	Sun Apr 20 22:39:07 2008 +0200
@@ -71,7 +71,8 @@
     Error arg(char[][] s)
     {
         char[] res = s[0 .. $ - 1].join(", ");
-        res ~= " and ";
+        if (s.length > 1)
+            res ~= " and ";
         res ~= s[$ - 1];
         return arg(res);
     }