/*
* This file is part of cparser.
- * Copyright (C) 2007-2008 Matthias Braun <matze@braunis.de>
+ * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
lexer_token.type = set_type; \
return;
+/* must use this as last thing */
+#define MAYBE_MODE(ch, set_type, mode) \
+ case ch: \
+ if (c_mode & mode) { \
+ next_char(); \
+ lexer_token.type = set_type; \
+ return; \
+ } \
+ /* fallthrough */
+
#define ELSE_CODE(code) \
default: \
code \
case ':':
MAYBE_PROLOG
MAYBE('>', ']')
+ MAYBE_MODE(':', T_COLONCOLON, _CXX)
ELSE(':')
case '=':
MAYBE_PROLOG