[Python-checkins] python/dist/src/Python graminit.c, 2.33.2.2, 2.33.2.3 ast.c, 1.1.2.59, 1.1.2.60

nascheme at users.sourceforge.net nascheme at users.sourceforge.net
Fri Apr 15 04:18:27 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7321/Python

Modified Files:
      Tag: ast-branch
	graminit.c ast.c 
Log Message:
Implement the new 'class foo(): pass' syntax.  Tweak the grammar.mak file so
graminit.c can be built on Windows machines.  Closes SF patch #1176019.


Index: graminit.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/graminit.c,v
retrieving revision 2.33.2.2
retrieving revision 2.33.2.3
diff -u -d -r2.33.2.2 -r2.33.2.3
--- graminit.c	7 Jan 2005 07:04:39 -0000	2.33.2.2
+++ graminit.c	15 Apr 2005 02:18:23 -0000	2.33.2.3
@@ -1426,26 +1426,27 @@
 	{13, 3},
 	{21, 4},
 };
-static arc arcs_67_3[1] = {
+static arc arcs_67_3[2] = {
 	{9, 5},
+	{15, 6},
 };
 static arc arcs_67_4[1] = {
-	{22, 6},
+	{22, 7},
 };
 static arc arcs_67_5[1] = {
-	{15, 7},
+	{15, 6},
 };
 static arc arcs_67_6[1] = {
-	{0, 6},
+	{21, 4},
 };
 static arc arcs_67_7[1] = {
-	{21, 4},
+	{0, 7},
 };
 static state states_67[8] = {
 	{1, arcs_67_0},
 	{1, arcs_67_1},
 	{2, arcs_67_2},
-	{1, arcs_67_3},
+	{2, arcs_67_3},
 	{1, arcs_67_4},
 	{1, arcs_67_5},
 	{1, arcs_67_6},

Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.59
retrieving revision 1.1.2.60
diff -u -d -r1.1.2.59 -r1.1.2.60
--- ast.c	13 Apr 2005 19:44:37 -0000	1.1.2.59
+++ ast.c	15 Apr 2005 02:18:24 -0000	1.1.2.60
@@ -2576,6 +2576,13 @@
             return NULL;
 	return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, s, LINENO(n));
     }
+	/* check for empty base list */
+	if (TYPE(CHILD(n,3)) == RPAR) {
+		s = ast_for_suite(c, CHILD(n,5));
+		if (!s)
+			return NULL;
+		return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)),NULL,s,LINENO(n));
+	}
     /* else handle the base class list */
     _bases = ast_for_testlist(c, CHILD(n, 3));
     if (!_bases)



More information about the Python-checkins mailing list