[前][次][番号順一覧][スレッド一覧]

ruby-changes:13427

From: nobu <ko1@a...>
Date: Sat, 3 Oct 2009 02:59:43 +0900 (JST)
Subject: [ruby-changes:13427] Ruby:r25198 (trunk): * parse.y (assignable_gen): get rid of macro collision.

nobu	2009-10-03 02:59:25 +0900 (Sat, 03 Oct 2009)

  New Revision: 25198

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25198

  Log:
    * parse.y (assignable_gen): get rid of macro collision.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25197)
+++ ChangeLog	(revision 25198)
@@ -1,3 +1,7 @@
+Sat Oct  3 02:59:21 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (assignable_gen): get rid of macro collision.
+
 Sat Oct  3 02:49:50 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (ary_make_shared): should count frozen array itself.
Index: parse.y
===================================================================
--- parse.y	(revision 25197)
+++ parse.y	(revision 25198)
@@ -8013,77 +8013,76 @@
 {
 #ifdef RIPPER
     ID id = get_id(lhs);
-# define RETURN(x) return get_value(lhs)
-# define ERROR(x) dispatch1(assign_error, lhs)
+# define assignable_result(x) get_value(lhs)
+# define parser_yyerror(x) dispatch1(assign_error, lhs)
 #else
-# define RETURN(x) return x
-# define ERROR(x) yyerror(x)
+# define assignable_result(x) x
 #endif
-    if (!id) RETURN(0);
+    if (!id) return assignable_result(0);
     if (id == keyword_self) {
-	ERROR("Can't change the value of self");
+	yyerror("Can't change the value of self");
     }
     else if (id == keyword_nil) {
-	ERROR("Can't assign to nil");
+	yyerror("Can't assign to nil");
     }
     else if (id == keyword_true) {
-	ERROR("Can't assign to true");
+	yyerror("Can't assign to true");
     }
     else if (id == keyword_false) {
-	ERROR("Can't assign to false");
+	yyerror("Can't assign to false");
     }
     else if (id == keyword__FILE__) {
-	ERROR("Can't assign to __FILE__");
+	yyerror("Can't assign to __FILE__");
     }
     else if (id == keyword__LINE__) {
-	ERROR("Can't assign to __LINE__");
+	yyerror("Can't assign to __LINE__");
     }
     else if (id == keyword__ENCODING__) {
-	ERROR("Can't assign to __ENCODING__");
+	yyerror("Can't assign to __ENCODING__");
     }
     else if (is_local_id(id)) {
 	if (dyna_in_block()) {
 	    if (dvar_curr(id)) {
-		RETURN(NEW_DASGN_CURR(id, val));
+		return assignable_result(NEW_DASGN_CURR(id, val));
 	    }
 	    else if (dvar_defined(id)) {
-		RETURN(NEW_DASGN(id, val));
+		return assignable_result(NEW_DASGN(id, val));
 	    }
 	    else if (local_id(id)) {
-		RETURN(NEW_LASGN(id, val));
+		return assignable_result(NEW_LASGN(id, val));
 	    }
 	    else {
 		dyna_var(id);
-		RETURN(NEW_DASGN_CURR(id, val));
+		return assignable_result(NEW_DASGN_CURR(id, val));
 	    }
 	}
 	else {
 	    if (!local_id(id)) {
 		local_var(id);
 	    }
-	    RETURN(NEW_LASGN(id, val));
+	    return assignable_result(NEW_LASGN(id, val));
 	}
     }
     else if (is_global_id(id)) {
-	RETURN(NEW_GASGN(id, val));
+	return assignable_result(NEW_GASGN(id, val));
     }
     else if (is_instance_id(id)) {
-	RETURN(NEW_IASGN(id, val));
+	return assignable_result(NEW_IASGN(id, val));
     }
     else if (is_const_id(id)) {
 	if (!in_def && !in_single)
-	    RETURN(NEW_CDECL(id, val, 0));
-	ERROR("dynamic constant assignment");
+	    return assignable_result(NEW_CDECL(id, val, 0));
+	yyerror("dynamic constant assignment");
     }
     else if (is_class_id(id)) {
-	RETURN(NEW_CVASGN(id, val));
+	return assignable_result(NEW_CVASGN(id, val));
     }
     else {
 	compile_error(PARSER_ARG "identifier %s is not valid to set", rb_id2name(id));
     }
-    RETURN(0);
-#undef RETURN
-#undef ERROR
+    return assignable_result(0);
+#undef assignable_result
+#undef parser_yyerror
 }
 
 static ID

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]