This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa] rename p-exp.y's TRUE/FALSE


In p-exp.y there are tokens TRUE and FALSE; a recent change to bfd.h
also created defines named TRUE and FALSE.  This might cause silent
problems and one user has reported that this causes actual compilation
problems (it depends on which order the defines happen in).

This patch renames the tokens to TRUEKEYWORD and FALSEKEYWORD,
following the lead of c-exp.y.

Okay to commit?

David Carlton
carlton@math.stanford.edu

2002-12-09  David Carlton  <carlton@math.stanford.edu>

	* p-exp.y: Rename TRUE and FALSE to TRUEKEYWORD and FALSEKEYWORD.

Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.20
diff -u -p -r1.20 p-exp.y
--- p-exp.y	30 Nov 2002 16:33:55 -0000	1.20
+++ p-exp.y	9 Dec 2002 20:12:22 -0000
@@ -205,7 +205,7 @@ static int search_field;
 
 /* Object pascal */
 %token THIS
-%token <lval> TRUE FALSE
+%token <lval> TRUEKEYWORD FALSEKEYWORD
 
 %left ','
 %left ABOVE_COMMA
@@ -434,13 +434,13 @@ exp	:	exp ASSIGN exp
 			{ write_exp_elt_opcode (BINOP_ASSIGN); }
 	;
 
-exp	:	TRUE
+exp	:	TRUEKEYWORD
 			{ write_exp_elt_opcode (OP_BOOL);
 			  write_exp_elt_longcst ((LONGEST) $1);
 			  write_exp_elt_opcode (OP_BOOL); }
 	;
 
-exp	:	FALSE
+exp	:	FALSEKEYWORD
 			{ write_exp_elt_opcode (OP_BOOL);
 			  write_exp_elt_longcst ((LONGEST) $1);
 			  write_exp_elt_opcode (OP_BOOL); }
@@ -1379,14 +1379,14 @@ yylex ()
       if (STREQ (uptokstart, "FALSE"))
 	{
           yylval.lval = 0;
-          return FALSE;
+          return FALSEKEYWORD;
         }
       break;
     case 4:
       if (STREQ (uptokstart, "TRUE"))
 	{
           yylval.lval = 1;
-  	  return TRUE;
+  	  return TRUEKEYWORD;
         }
       if (STREQ (uptokstart, "SELF"))
         {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]