char string_end;
char *value;
+static const char *yyfilename;
static void extendbuf(char **what, const char *arg)
{
}
}
<rstring>\\\n /* ignore */
+<rstring>\n {
+ fprintf(stderr,
+ "%s:%d: string continues past the end of the line\n",
+ yyfilename, yylineno);
+ free(value);
+ value = NULL;
+ BEGIN(INITIAL);
+ return STRING;
+ }
<rstring>\\. extend(yytext);
-<rstring>[^\\\"\']+ extend(yytext);
+<rstring>[^\\\"\'\n]+ extend(yytext);
"DEFUN" value = strdup(yytext); return DEFUNNY;
"DEFUN_NOSH" value = strdup(yytext); return DEFUNNY;
if (tval[0] == ')')
depth--;
}
+ if (!tval)
+ return PyErr_Format(PyExc_ValueError,
+ "%s:%d: invalid token in DEFPY parameters",
+ filename, lineno);
if (!pyArg)
pyArg = PyList_New(0);
PyList_Append(pyArg, PyUnicode_FromString(tval));
int token;
yyin = fd;
value = NULL;
+ yyfilename = filename;
PyObject *pyCont = PyDict_New();
PyObject *pyObj = PyList_New(0);
if (!pyArgs) {
free(tval);
Py_DECREF(pyCont);
+ yyfilename = NULL;
return NULL;
}
pyItem = PyDict_New();
}
def_yylex_destroy();
fclose(fd);
+ yyfilename = NULL;
return pyCont;
}