diff dmd/Lexer.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents e28b18c23469
children af1bebfd96a4
line wrap: on
line diff
--- a/dmd/Lexer.d	Sun Sep 05 15:32:22 2010 +0400
+++ b/dmd/Lexer.d	Thu Sep 09 22:51:44 2010 +0100
@@ -497,7 +497,9 @@
 		Token.tochars[TOK.TOKorass]		= "|=";
 		Token.tochars[TOK.TOKidentifier]	= "identifier";
 		Token.tochars[TOK.TOKat]		= "@";
-
+        Token.tochars[TOK.TOKpow]		= "^^";
+        //Token.tochars[TOK.TOKpowass]		= "^^=";
+        
 		 // For debugging
 		Token.tochars[TOKerror]		= "error";
 		Token.tochars[TOK.TOKdotexp]		= "dotexp";
@@ -1258,6 +1260,30 @@
 				else
 					t.value = TOK.TOKtilde;		// ~
 				return;
+                
+version(DMDV2) {
+	    case '^':
+		p++;
+		if (*p == '^')
+		{   p++;
+//static if (false) {
+//		    if (*p == '=')
+//		    {   p++;
+//			t.value = TOKpowass;  // ^^=
+//		    }
+//		    else
+//}
+			t.value = TOKpow;     // ^^
+		}
+		else if (*p == '=')
+		{   p++;
+		    t.value = TOKxorass;    // ^=
+		}
+		else
+		    t.value = TOKxor;       // ^
+		return;
+}
+
 /*
 		#define SINGLE(c,tok) case c: p++; t.value = tok; return;
 
@@ -1289,8 +1315,9 @@
 
 				DOUBLE('*', TOKmul, '=', TOKmulass)
 				DOUBLE('%', TOKmod, '=', TOKmodass)
+#if DMDV1
 				DOUBLE('^', TOKxor, '=', TOKxorass)
-
+#endif
 		#undef DOUBLE
 */
 
@@ -1326,7 +1353,7 @@
 						t.value = TOK.TOKmod;
 					}
 					return;
-					
+version(DMDV1) {
 				case '^':
 					p++;
 					if (*p == '=') {
@@ -1336,7 +1363,7 @@
 						t.value = TOK.TOKxor;
 					}
 					return;
-
+}
 				case '#':
 				p++;
 				pragma_();