[Python-3000-checkins] r53956 - python/branches/p3yk/Parser/Python.asdl python/branches/p3yk/Parser/asdl_c.py

neal.norwitz python-3000-checkins at python.org
Mon Feb 26 20:04:53 CET 2007


Author: neal.norwitz
Date: Mon Feb 26 20:04:49 2007
New Revision: 53956

Modified:
   python/branches/p3yk/Parser/Python.asdl
   python/branches/p3yk/Parser/asdl_c.py
Log:
bool is no longer required, it was only used for the print statement

Modified: python/branches/p3yk/Parser/Python.asdl
==============================================================================
--- python/branches/p3yk/Parser/Python.asdl	(original)
+++ python/branches/p3yk/Parser/Python.asdl	Mon Feb 26 20:04:49 2007
@@ -1,4 +1,4 @@
--- ASDL's five builtin types are identifier, int, string, object, bool
+-- ASDL's five builtin types are identifier, int, string, object
 
 module Python version "$Revision$"
 {

Modified: python/branches/p3yk/Parser/asdl_c.py
==============================================================================
--- python/branches/p3yk/Parser/asdl_c.py	(original)
+++ python/branches/p3yk/Parser/asdl_c.py	Mon Feb 26 20:04:49 2007
@@ -15,7 +15,7 @@
     """Return a string for the C name of the type.
 
     This function special cases the default types provided by asdl:
-    identifier, string, int, bool.
+    identifier, string, int.
     """
     # XXX ack!  need to figure out where Id is useful and where string
     if isinstance(name, asdl.Id):
@@ -288,8 +288,7 @@
         emit("{")
         emit("%s p;" % ctype, 1)
         for argtype, argname, opt in args:
-            # XXX hack alert: false is allowed for a bool
-            if not opt and not (argtype == "bool" or argtype == "int"):
+            if not opt and argtype != "int":
                 emit("if (!%s) {" % argname, 1)
                 emit("PyErr_SetString(PyExc_ValueError,", 2)
                 msg = "field %s is required for %s" % (argname, name)
@@ -467,10 +466,6 @@
 }
 #define ast2obj_identifier ast2obj_object
 #define ast2obj_string ast2obj_object
-static PyObject* ast2obj_bool(bool b)
-{
-    return PyBool_FromLong(b);
-}
 
 static PyObject* ast2obj_int(long b)
 {


More information about the Python-3000-checkins mailing list