shithub: scc

Download patch

ref: bc40f94fdda9ad39a8cc71a9b5a4c80eebe210a8
parent: 712fa062baee56baf1c9e7c33c46937bb95064a0
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Jun 29 06:42:12 EDT 2012

Renamed -> token from PTR to INDIR

There was a name conflict with the type operator PTR, and PTR was not a good
name for this token, because could be misunderstand with * operator.

--- a/expr.c
+++ b/expr.c
@@ -62,10 +62,10 @@
 			expect(')');
 			gen_call();
 			continue;
-		case '.': fp = gen_field; goto expect_iden;
-		case PTR: fp = gen_ptr; goto expect_iden;
-		case INC: fp = gen_postinc; goto next;
-		case DEC: fp = gen_postdec; goto next;
+		case '.':   fp = gen_field; goto expect_iden;
+		case INDIR: fp = gen_ptr; goto expect_iden;
+		case INC:   fp = gen_postinc; goto next;
+		case DEC:   fp = gen_postdec; goto next;
 		default:
 			fputs("leaving static void postfix(void)", stderr);
 			return;
--- a/lex.c
+++ b/lex.c
@@ -120,7 +120,7 @@
 
 	switch (c = getc(yyin)) {
 	case '-': return DEC;
-	case '>': return PTR;
+	case '>': return INDIR;
 	case '=': return SUB_EQ;
 	default:
 		ungetc(c, yyin);
--- a/tokens.h
+++ b/tokens.h
@@ -18,7 +18,7 @@
 	UNSIGNED, SIGNED,
 	/* other tokens */
 	IDEN = 128, CONSTANT, SIZEOF,
-	PTR, INC, DEC, SHL, SHR,
+	INDIR, INC, DEC, SHL, SHR,
 	LE, GE, EQ, NE, AND, OR,
 	MUL_EQ, DIV_EQ, MOD_EQ, ADD_EQ, SUB_EQ, AND_EQ,
 	XOR_EQ, OR_EQ, SHL_EQ, SHR_EQ,