}
static PyObject *
-parsenumber(struct compiling *co, char *s)
+parsenumber(struct compiling *c, char *s)
{
char *end;
long x;
double dx;
#ifndef WITHOUT_COMPLEX
- Py_complex c;
int imflag;
#endif
"hex/oct constants > sys.maxint "
"will return positive values "
"in Python 2.4 and up",
- co->c_filename,
- co->c_lineno,
+ c->c_filename,
+ c->c_lineno,
NULL,
NULL) < 0)
return NULL;
/* XXX Huge floats may silently fail */
#ifndef WITHOUT_COMPLEX
if (imflag) {
- c.real = 0.;
+ Py_complex z;
+ z.real = 0.;
PyFPE_START_PROTECT("atof", return 0)
- c.imag = atof(s);
- PyFPE_END_PROTECT(c)
- return PyComplex_FromCComplex(c);
+ z.imag = atof(s);
+ PyFPE_END_PROTECT(z)
+ return PyComplex_FromCComplex(z);
}
else
#endif
}
static PyObject *
-parsestr(struct compiling *com, char *s)
+parsestr(struct compiling *c, char *s)
{
PyObject *v;
size_t len;
char *end;
int quote = *s;
int rawmode = 0;
- char* encoding = ((com == NULL) ? NULL : com->c_encoding);
+ char* encoding = ((c == NULL) ? NULL : c->c_encoding);
int need_encoding;
int unicode = 0;
s++;
len = strlen(s);
if (len > INT_MAX) {
- com_error(com, PyExc_OverflowError,
+ com_error(c, PyExc_OverflowError,
"string to parse is too long");
return NULL;
}
v = PyUnicode_DecodeUnicodeEscape(buf, len, NULL);
Py_XDECREF(u);
if (v == NULL)
- PyErr_SyntaxLocation(com->c_filename, com->c_lineno);
+ PyErr_SyntaxLocation(c->c_filename, c->c_lineno);
return v;
}
v = PyString_DecodeEscape(s, len, NULL, unicode,
need_encoding ? encoding : NULL);
if (v == NULL)
- PyErr_SyntaxLocation(com->c_filename, com->c_lineno);
+ PyErr_SyntaxLocation(c->c_filename, c->c_lineno);
return v;
}