Simplify MAYBE macros.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Jun 2012 13:56:15 +0000 (15:56 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Jun 2012 19:52:08 +0000 (21:52 +0200)
preprocessor.c

index ca874c9..67b2a24 100644 (file)
@@ -835,29 +835,23 @@ end_number:
        pp_token.literal.string = sym_make_string(STRING_ENCODING_CHAR);
 }
 
+#define MAYBE_PROLOG \
+       next_char(); \
+       switch (input.c) {
 
-#define MAYBE_PROLOG                                       \
-                       next_char();                                   \
-                       while (true) {                                 \
-                               switch (input.c) {
-
-#define MAYBE(ch, set_type)                                \
-                               case ch:                                   \
-                                       next_char();                           \
-                                       pp_token.kind = set_type;              \
-                                       return;
-
-#define ELSE_CODE(code)                                    \
-                               default:                                   \
-                                       code                                   \
-                                       return;                                \
-                               }                                          \
-                       }
+#define MAYBE(ch, kind) \
+       case ch: \
+               next_char(); \
+               pp_token.kind = kind; \
+               return;
 
-#define ELSE(set_type)                                     \
-               ELSE_CODE(                                         \
-                       pp_token.kind = set_type;                      \
-               )
+#define ELSE_CODE(code) \
+       default: \
+               code \
+               return; \
+       }
+
+#define ELSE(kind) ELSE_CODE(pp_token.kind = kind;)
 
 static void next_preprocessing_token(void)
 {