@@ -329,7 +329,7 @@ com_backpatch(c, anchor)
329329 }
330330}
331331
332- /* Handle constants and names uniformly */
332+ /* Handle literals and names uniformly */
333333
334334static int
335335com_add (c , list , v )
@@ -423,18 +423,23 @@ parsenumber(s)
423423 if (* end == '\0' ) {
424424 if (errno != 0 ) {
425425 err_setstr (OverflowError ,
426- "integer constant too large" );
426+ "integer literal too large" );
427427 return NULL ;
428428 }
429429 return newintobject (x );
430430 }
431431 errno = 0 ;
432432 xx = strtod (s , & end );
433433 if (* end == '\0' ) {
434+ #ifndef BROKEN_STRTOD
435+ /* Some strtod() versions (e.g., in older SunOS systems)
436+ set errno incorrectly; better to ignore overflows
437+ than not to be able to use float literals at all! */
434438 if (errno != 0 ) {
435- err_setstr (OverflowError , "float constant too large" );
439+ err_setstr (OverflowError , "float literal too large" );
436440 return NULL ;
437441 }
442+ #endif
438443 return newfloatobject (xx );
439444 }
440445 err_setstr (SystemError , "bad number syntax?!?!" );
@@ -1258,7 +1263,7 @@ com_assign(c, n, assigning)
12581263 return ;
12591264 default :
12601265 err_setstr (TypeError ,
1261- "can't assign to constant " );
1266+ "can't assign to literal " );
12621267 c -> c_errors ++ ;
12631268 return ;
12641269 }
@@ -1938,7 +1943,7 @@ com_fplist(c, n)
19381943 struct compiling * c ;
19391944 node * n ;
19401945{
1941- REQ (n , fplist ); /* fplist: fpdef (',' fpdef)* */
1946+ REQ (n , fplist ); /* fplist: fpdef (',' fpdef)* [','] */
19421947 if (NCH (n ) == 1 ) {
19431948 com_fpdef (c , CHILD (n , 0 ));
19441949 }
0 commit comments