diff lexer/Keyword.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 e331e4e816e4
children 858b9805843d
line wrap: on
line diff
--- a/lexer/Keyword.d	Sun Apr 20 21:33:50 2008 +0200
+++ b/lexer/Keyword.d	Sun Apr 20 22:39:07 2008 +0200
@@ -8,6 +8,7 @@
 {
     keywords =
     [
+        // types
         "byte"[]    : Tok.Byte,
         "ubyte"     : Tok.Ubyte,
         "short"     : Tok.Short,
@@ -22,10 +23,16 @@
         "float"     : Tok.Float,
         "double"    : Tok.Double,
 
+        // type related
+        "struct"    : Tok.Struct,
+
+        // control flow
         "if"        : Tok.If,
         "else"      : Tok.Else,
         "while"     : Tok.While,
-        "return"    : Tok.Return,
-        "struct"    : Tok.Struct
+        "switch"    : Tok.Switch,
+        "case"      : Tok.Case,
+        "default"   : Tok.Default,
+        "return"    : Tok.Return
     ];
 }