summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-02-26 19:04:49 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-02-26 19:04:49 (GMT)
commit3591bbe4534d05631ace7b7e7b076c0cc52e7f13 (patch)
tree47b9189f1ffd59ace41a3fd091536a703c204255
parenta44f3a3e0bb6f829373976475479efb260f09ed0 (diff)
downloadcpython-3591bbe4534d05631ace7b7e7b076c0cc52e7f13.zip
cpython-3591bbe4534d05631ace7b7e7b076c0cc52e7f13.tar.gz
cpython-3591bbe4534d05631ace7b7e7b076c0cc52e7f13.tar.bz2
bool is no longer required, it was only used for the print statement
-rw-r--r--Parser/Python.asdl2
-rwxr-xr-xParser/asdl_c.py9
2 files changed, 3 insertions, 8 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index fc1a6da..c5b64a9 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -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$"
{
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 4877853..325a2b6 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -15,7 +15,7 @@ def get_c_type(name):
"""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 @@ class FunctionVisitor(PrototypeVisitor):
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 @@ static PyObject* ast2obj_object(void *o)
}
#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)
{