[patch] Minor C++ cleanup [1/4]: Simplify cp_lexer_next_token_is_keyword

Volker Reichelt reichelt@igpm.rwth-aachen.de
Thu Jan 19 20:23:00 GMT 2006


The following patch simplifies cp_lexer_next_token_is_keyword
a little bit so that it looks just like cp_lexer_next_token_is
a couple of lines above.

Bootstrapped and regtested on x86_64-unknown-linux-gnu.
Ok for mainline?

Regards,
Volker


:ADDPATCH C++:


2006-01-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* parser.c (cp_lexer_next_token_is_keyword): Simplify.

====================================================================
--- gcc/gcc/cp/parser.c	2006-01-06 19:40:37 +0100
+++ gcc/gcc/cp/parser.c	2006-01-06 19:40:46 +0100
@@ -496,12 +496,7 @@ cp_lexer_next_token_is_not (cp_lexer* le
 static inline bool
 cp_lexer_next_token_is_keyword (cp_lexer* lexer, enum rid keyword)
 {
-  cp_token *token;
-
-  /* Peek at the next token.  */
-  token = cp_lexer_peek_token (lexer);
-  /* Check to see if it is the indicated keyword.  */
-  return token->keyword == keyword;
+  return cp_lexer_peek_token (lexer)->keyword == keyword;
 }
 
 /* Return a pointer to the Nth token in the token stream.  If N is 1,
====================================================================




More information about the Gcc-patches mailing list