summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-12-31 13:13:35 (GMT)
committerGuido van Rossum <guido@python.org>1991-12-31 13:13:35 (GMT)
commita9df32ab2aaafe4eb7181916737caf5cb35eed8e (patch)
tree784b15f842de4ea20acfead9db1ff78013ea6e43 /Python/compile.c
parent6cf1273faa0891f1cec88283c5b8b9810638559c (diff)
downloadcpython-a9df32ab2aaafe4eb7181916737caf5cb35eed8e.zip
cpython-a9df32ab2aaafe4eb7181916737caf5cb35eed8e.tar.gz
cpython-a9df32ab2aaafe4eb7181916737caf5cb35eed8e.tar.bz2
Minor changes.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 08785a7..e69ae6e 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -329,7 +329,7 @@ com_backpatch(c, anchor)
}
}
-/* Handle constants and names uniformly */
+/* Handle literals and names uniformly */
static int
com_add(c, list, v)
@@ -423,7 +423,7 @@ parsenumber(s)
if (*end == '\0') {
if (errno != 0) {
err_setstr(OverflowError,
- "integer constant too large");
+ "integer literal too large");
return NULL;
}
return newintobject(x);
@@ -431,10 +431,15 @@ parsenumber(s)
errno = 0;
xx = strtod(s, &end);
if (*end == '\0') {
+#ifndef BROKEN_STRTOD
+ /* Some strtod() versions (e.g., in older SunOS systems)
+ set errno incorrectly; better to ignore overflows
+ than not to be able to use float literals at all! */
if (errno != 0) {
- err_setstr(OverflowError, "float constant too large");
+ err_setstr(OverflowError, "float literal too large");
return NULL;
}
+#endif
return newfloatobject(xx);
}
err_setstr(SystemError, "bad number syntax?!?!");
@@ -1258,7 +1263,7 @@ com_assign(c, n, assigning)
return;
default:
err_setstr(TypeError,
- "can't assign to constant");
+ "can't assign to literal");
c->c_errors++;
return;
}
@@ -1938,7 +1943,7 @@ com_fplist(c, n)
struct compiling *c;
node *n;
{
- REQ(n, fplist); /* fplist: fpdef (',' fpdef)* */
+ REQ(n, fplist); /* fplist: fpdef (',' fpdef)* [','] */
if (NCH(n) == 1) {
com_fpdef(c, CHILD(n, 0));
}