diff options
author | Guido van Rossum <guido@python.org> | 2007-05-22 18:11:13 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-22 18:11:13 (GMT) |
commit | d59da4b4325d189b93f1d46405b97f2435094699 (patch) | |
tree | d71bd85e141d8d88384b0cfa5866c8f05a1487e9 /Python | |
parent | dc19f0966195c711407cb710225cab55ba1f4be9 (diff) | |
download | cpython-d59da4b4325d189b93f1d46405b97f2435094699.zip cpython-d59da4b4325d189b93f1d46405b97f2435094699.tar.gz cpython-d59da4b4325d189b93f1d46405b97f2435094699.tar.bz2 |
Merged revisions 55407-55513 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk
................
r55413 | fred.drake | 2007-05-17 12:30:10 -0700 (Thu, 17 May 2007) | 1 line
fix argument name in documentation; match the implementation
................
r55430 | jack.diederich | 2007-05-18 06:39:59 -0700 (Fri, 18 May 2007) | 1 line
Implements class decorators, PEP 3129.
................
r55432 | guido.van.rossum | 2007-05-18 08:09:41 -0700 (Fri, 18 May 2007) | 2 lines
obsubmit.
................
r55434 | guido.van.rossum | 2007-05-18 09:39:10 -0700 (Fri, 18 May 2007) | 3 lines
Fix bug in test_inspect. (I presume this is how it should be fixed;
Jack Diedrich, please verify.)
................
r55460 | brett.cannon | 2007-05-20 00:31:57 -0700 (Sun, 20 May 2007) | 4 lines
Remove the imageop module. With imgfile already removed in Python 3.0 and
rgbimg gone in Python 2.6 the unit tests themselves were made worthless. Plus
third-party libraries perform the same function much better.
................
r55469 | neal.norwitz | 2007-05-20 11:28:20 -0700 (Sun, 20 May 2007) | 118 lines
Merged revisions 55324-55467 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r55348 | georg.brandl | 2007-05-15 13:19:34 -0700 (Tue, 15 May 2007) | 4 lines
HTML-escape the plain traceback in cgitb's HTML output, to prevent
the traceback inadvertently or maliciously closing the comment and
injecting HTML into the error page.
........
r55372 | neal.norwitz | 2007-05-15 21:33:50 -0700 (Tue, 15 May 2007) | 6 lines
Port rev 55353 from Guido:
Add what looks like a necessary call to PyErr_NoMemory() when PyMem_MALLOC()
fails.
Will backport.
........
r55377 | neal.norwitz | 2007-05-15 22:06:33 -0700 (Tue, 15 May 2007) | 1 line
Mention removal of some directories for obsolete platforms
........
r55380 | brett.cannon | 2007-05-15 22:50:03 -0700 (Tue, 15 May 2007) | 2 lines
Change the maintainer of the BeOS port.
........
r55383 | georg.brandl | 2007-05-16 06:44:18 -0700 (Wed, 16 May 2007) | 2 lines
Bug #1719995: don't use deprecated method in sets example.
........
r55386 | neal.norwitz | 2007-05-16 13:05:11 -0700 (Wed, 16 May 2007) | 5 lines
Fix bug in marshal where bad data would cause a segfault due to
lack of an infinite recursion check.
Contributed by Damien Miller at Google.
........
r55389 | brett.cannon | 2007-05-16 15:42:29 -0700 (Wed, 16 May 2007) | 6 lines
Remove the gopherlib module. It has been raising a DeprecationWarning since
Python 2.5.
Also remove gopher support from urllib/urllib2. As both imported gopherlib the
usage of the support would have raised a DeprecationWarning.
........
r55394 | raymond.hettinger | 2007-05-16 18:08:04 -0700 (Wed, 16 May 2007) | 1 line
calendar.py gets no benefit from xrange() instead of range()
........
r55395 | brett.cannon | 2007-05-16 19:02:56 -0700 (Wed, 16 May 2007) | 3 lines
Complete deprecation of BaseException.message. Some subclasses were directly
accessing the message attribute instead of using the descriptor.
........
r55396 | neal.norwitz | 2007-05-16 23:11:36 -0700 (Wed, 16 May 2007) | 4 lines
Reduce the max stack depth to see if this fixes the segfaults on
Windows and some other boxes. If this is successful, this rev should
be backported. I'm not sure how close to the limit we should push this.
........
r55397 | neal.norwitz | 2007-05-16 23:23:50 -0700 (Wed, 16 May 2007) | 4 lines
Set the depth to something very small to try to determine if the
crashes on Windows are really due to the stack size or possibly
some other problem.
........
r55398 | neal.norwitz | 2007-05-17 00:04:46 -0700 (Thu, 17 May 2007) | 4 lines
Last try for tweaking the max stack depth. 5000 was the original value,
4000 didn't work either. 1000 does work on Windows. If 2000 works,
that will hopefully be a reasonable balance.
........
r55412 | fred.drake | 2007-05-17 12:29:58 -0700 (Thu, 17 May 2007) | 1 line
fix argument name in documentation; match the implementation
........
r55427 | neal.norwitz | 2007-05-17 22:47:16 -0700 (Thu, 17 May 2007) | 1 line
Verify neither dumps or loads overflow the stack and segfault.
........
r55446 | collin.winter | 2007-05-18 16:11:24 -0700 (Fri, 18 May 2007) | 1 line
Backport PEP 3110's new 'except' syntax to 2.6.
........
r55448 | raymond.hettinger | 2007-05-18 18:11:16 -0700 (Fri, 18 May 2007) | 1 line
Improvements to NamedTuple's implementation, tests, and documentation
........
r55449 | raymond.hettinger | 2007-05-18 18:50:11 -0700 (Fri, 18 May 2007) | 1 line
Fix beginner mistake -- don't mix spaces and tabs.
........
r55450 | neal.norwitz | 2007-05-18 20:48:47 -0700 (Fri, 18 May 2007) | 1 line
Clear data so random memory does not get freed. Will backport.
........
r55452 | neal.norwitz | 2007-05-18 21:34:55 -0700 (Fri, 18 May 2007) | 3 lines
Whoops, need to pay attention to those test failures.
Move the clear to *before* the first use, not after.
........
r55453 | neal.norwitz | 2007-05-18 21:35:52 -0700 (Fri, 18 May 2007) | 1 line
Give some clue as to what happened if the test fails.
........
r55455 | georg.brandl | 2007-05-19 11:09:26 -0700 (Sat, 19 May 2007) | 2 lines
Fix docstring for add_package in site.py.
........
r55458 | brett.cannon | 2007-05-20 00:09:50 -0700 (Sun, 20 May 2007) | 2 lines
Remove the rgbimg module. It has been deprecated since Python 2.5.
........
r55465 | nick.coghlan | 2007-05-20 04:12:49 -0700 (Sun, 20 May 2007) | 1 line
Fix typo in example (should be backported, but my maintenance branch is woefully out of date)
........
................
r55472 | brett.cannon | 2007-05-20 12:06:18 -0700 (Sun, 20 May 2007) | 2 lines
Remove imageop from the Windows build process.
................
r55486 | neal.norwitz | 2007-05-20 23:59:52 -0700 (Sun, 20 May 2007) | 1 line
Remove callable() builtin
................
r55506 | neal.norwitz | 2007-05-22 00:43:29 -0700 (Tue, 22 May 2007) | 78 lines
Merged revisions 55468-55505 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r55468 | neal.norwitz | 2007-05-20 11:06:27 -0700 (Sun, 20 May 2007) | 1 line
rotor is long gone.
........
r55470 | neal.norwitz | 2007-05-20 11:43:00 -0700 (Sun, 20 May 2007) | 1 line
Update directories/files at the top-level.
........
r55471 | brett.cannon | 2007-05-20 12:05:06 -0700 (Sun, 20 May 2007) | 2 lines
Try to remove rgbimg from Windows builds.
........
r55474 | brett.cannon | 2007-05-20 16:17:38 -0700 (Sun, 20 May 2007) | 4 lines
Remove the macfs module. This led to the deprecation of macostools.touched();
it completely relied on macfs and is a no-op on OS X according to code
comments.
........
r55476 | brett.cannon | 2007-05-20 16:56:18 -0700 (Sun, 20 May 2007) | 3 lines
Move imgfile import to the global namespace to trigger an import error ASAP to
prevent creation of a test file.
........
r55477 | brett.cannon | 2007-05-20 16:57:38 -0700 (Sun, 20 May 2007) | 3 lines
Cause posixfile to raise a DeprecationWarning. Documented as deprecated since
Ptyhon 1.5.
........
r55479 | andrew.kuchling | 2007-05-20 17:03:15 -0700 (Sun, 20 May 2007) | 1 line
Note removed modules
........
r55481 | martin.v.loewis | 2007-05-20 21:35:47 -0700 (Sun, 20 May 2007) | 2 lines
Add Alexandre Vassalotti.
........
r55482 | george.yoshida | 2007-05-20 21:41:21 -0700 (Sun, 20 May 2007) | 4 lines
fix against r55474 [Remove the macfs module]
Remove "libmacfs.tex" from Makefile.deps and mac/mac.tex.
........
r55487 | raymond.hettinger | 2007-05-21 01:13:35 -0700 (Mon, 21 May 2007) | 1 line
Replace assertion with straight error-checking.
........
r55489 | raymond.hettinger | 2007-05-21 09:40:10 -0700 (Mon, 21 May 2007) | 1 line
Allow all alphanumeric and underscores in type and field names.
........
r55490 | facundo.batista | 2007-05-21 10:32:32 -0700 (Mon, 21 May 2007) | 5 lines
Added timeout support to HTTPSConnection, through the
socket.create_connection function. Also added a small
test for this, and updated NEWS file.
........
r55495 | georg.brandl | 2007-05-21 13:34:16 -0700 (Mon, 21 May 2007) | 2 lines
Patch #1686487: you can now pass any mapping after '**' in function calls.
........
r55502 | neal.norwitz | 2007-05-21 23:03:36 -0700 (Mon, 21 May 2007) | 1 line
Document new params to HTTPSConnection
........
r55504 | neal.norwitz | 2007-05-22 00:16:10 -0700 (Tue, 22 May 2007) | 1 line
Stop using METH_OLDARGS
........
r55505 | neal.norwitz | 2007-05-22 00:16:44 -0700 (Tue, 22 May 2007) | 1 line
Stop using METH_OLDARGS implicitly
........
................
Diffstat (limited to 'Python')
-rw-r--r-- | Python/Python-ast.c | 35 | ||||
-rw-r--r-- | Python/ast.c | 60 | ||||
-rw-r--r-- | Python/bltinmodule.c | 14 | ||||
-rw-r--r-- | Python/ceval.c | 39 | ||||
-rw-r--r-- | Python/compile.c | 16 | ||||
-rw-r--r-- | Python/graminit.c | 2244 | ||||
-rw-r--r-- | Python/marshal.c | 223 | ||||
-rw-r--r-- | Python/symtable.c | 6 |
8 files changed, 1390 insertions, 1247 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 070c2db..fefa5c9 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -2,7 +2,7 @@ /* - __version__ 55343. + __version__ 55430. This module must be committed separately after each AST grammar change; The __version__ number is set to the revision number of the commit @@ -42,7 +42,7 @@ static char *FunctionDef_fields[]={ "name", "args", "body", - "decorators", + "decorator_list", "returns", }; static PyTypeObject *ClassDef_type; @@ -53,6 +53,7 @@ static char *ClassDef_fields[]={ "starargs", "kwargs", "body", + "decorator_list", }; static PyTypeObject *Return_type; static char *Return_fields[]={ @@ -485,7 +486,7 @@ static int init_types(void) FunctionDef_type = make_type("FunctionDef", stmt_type, FunctionDef_fields, 5); if (!FunctionDef_type) return 0; - ClassDef_type = make_type("ClassDef", stmt_type, ClassDef_fields, 6); + ClassDef_type = make_type("ClassDef", stmt_type, ClassDef_fields, 7); if (!ClassDef_type) return 0; Return_type = make_type("Return", stmt_type, Return_fields, 1); if (!Return_type) return 0; @@ -812,8 +813,8 @@ Suite(asdl_seq * body, PyArena *arena) stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * - decorators, expr_ty returns, int lineno, int col_offset, PyArena - *arena) + decorator_list, expr_ty returns, int lineno, int col_offset, + PyArena *arena) { stmt_ty p; if (!name) { @@ -833,7 +834,7 @@ FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * p->v.FunctionDef.name = name; p->v.FunctionDef.args = args; p->v.FunctionDef.body = body; - p->v.FunctionDef.decorators = decorators; + p->v.FunctionDef.decorator_list = decorator_list; p->v.FunctionDef.returns = returns; p->lineno = lineno; p->col_offset = col_offset; @@ -842,8 +843,8 @@ FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, expr_ty - starargs, expr_ty kwargs, asdl_seq * body, int lineno, int col_offset, - PyArena *arena) + starargs, expr_ty kwargs, asdl_seq * body, asdl_seq * decorator_list, + int lineno, int col_offset, PyArena *arena) { stmt_ty p; if (!name) { @@ -861,6 +862,7 @@ ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, expr_ty p->v.ClassDef.starargs = starargs; p->v.ClassDef.kwargs = kwargs; p->v.ClassDef.body = body; + p->v.ClassDef.decorator_list = decorator_list; p->lineno = lineno; p->col_offset = col_offset; return p; @@ -1994,9 +1996,11 @@ ast2obj_stmt(void* _o) if (PyObject_SetAttrString(result, "body", value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.FunctionDef.decorators, ast2obj_expr); + value = ast2obj_list(o->v.FunctionDef.decorator_list, + ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttrString(result, "decorators", value) == -1) + if (PyObject_SetAttrString(result, "decorator_list", value) == + -1) goto failed; Py_DECREF(value); value = ast2obj_expr(o->v.FunctionDef.returns); @@ -2038,6 +2042,13 @@ ast2obj_stmt(void* _o) if (PyObject_SetAttrString(result, "body", value) == -1) goto failed; Py_DECREF(value); + value = ast2obj_list(o->v.ClassDef.decorator_list, + ast2obj_expr); + if (!value) goto failed; + if (PyObject_SetAttrString(result, "decorator_list", value) == + -1) + goto failed; + Py_DECREF(value); break; case Return_kind: result = PyType_GenericNew(Return_type, NULL, NULL); @@ -3113,7 +3124,7 @@ init_ast(void) if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return; if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0) return; - if (PyModule_AddStringConstant(m, "__version__", "55343") < 0) + if (PyModule_AddStringConstant(m, "__version__", "55430") < 0) return; if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return; if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) @@ -3269,5 +3280,3 @@ PyObject* PyAST_mod2obj(mod_ty t) init_types(); return ast2obj_mod(t); } - - diff --git a/Python/ast.c b/Python/ast.c index aff3403..65527ba 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -28,6 +28,7 @@ static asdl_seq *ast_for_suite(struct compiling *, const node *); static asdl_seq *ast_for_exprlist(struct compiling *, const node *, expr_context_ty); static expr_ty ast_for_testlist(struct compiling *, const node *); +static stmt_ty ast_for_classdef(struct compiling *, const node *, asdl_seq *); /* Note different signature for ast_for_call */ static expr_ty ast_for_call(struct compiling *, const node *, expr_ty); @@ -931,28 +932,17 @@ ast_for_decorators(struct compiling *c, const node *n) } static stmt_ty -ast_for_funcdef(struct compiling *c, const node *n) +ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { - /* funcdef: 'def' [decorators] NAME parameters ['->' test] ':' suite */ + /* funcdef: 'def' NAME parameters ['->' test] ':' suite */ identifier name; arguments_ty args; asdl_seq *body; - asdl_seq *decorator_seq = NULL; expr_ty returns = NULL; - int name_i; + int name_i = 1; REQ(n, funcdef); - if (NCH(n) == 6 || NCH(n) == 8) { /* decorators are present */ - decorator_seq = ast_for_decorators(c, CHILD(n, 0)); - if (!decorator_seq) - return NULL; - name_i = 2; - } - else { - name_i = 1; - } - name = NEW_IDENTIFIER(CHILD(n, name_i)); if (!name) return NULL; @@ -977,6 +967,30 @@ ast_for_funcdef(struct compiling *c, const node *n) n->n_col_offset, c->c_arena); } +static stmt_ty +ast_for_decorated(struct compiling *c, const node *n) +{ + /* decorated: decorators (classdef | funcdef) */ + stmt_ty thing = NULL; + asdl_seq *decorator_seq = NULL; + + REQ(n, decorated); + + decorator_seq = ast_for_decorators(c, CHILD(n, 0)); + if (!decorator_seq) + return NULL; + + assert(TYPE(CHILD(n, 1)) == funcdef || + TYPE(CHILD(n, 1)) == classdef); + + if (TYPE(CHILD(n, 1)) == funcdef) { + thing = ast_for_funcdef(c, CHILD(n, 1), decorator_seq); + } else if (TYPE(CHILD(n, 1)) == classdef) { + thing = ast_for_classdef(c, CHILD(n, 1), decorator_seq); + } + return thing; +} + static expr_ty ast_for_lambdef(struct compiling *c, const node *n) { @@ -2693,7 +2707,7 @@ ast_for_for_stmt(struct compiling *c, const node *n) static excepthandler_ty ast_for_except_clause(struct compiling *c, const node *exc, node *body) { - /* except_clause: 'except' [test [',' test]] */ + /* except_clause: 'except' [test ['as' test]] */ REQ(exc, except_clause); REQ(body, suite); @@ -2858,7 +2872,7 @@ ast_for_with_stmt(struct compiling *c, const node *n) } static stmt_ty -ast_for_classdef(struct compiling *c, const node *n) +ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* classdef: 'class' NAME ['(' arglist ')'] ':' suite */ asdl_seq *s; @@ -2876,7 +2890,7 @@ ast_for_classdef(struct compiling *c, const node *n) if (!s) return NULL; return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, NULL, NULL, NULL, s, - LINENO(n), n->n_col_offset, c->c_arena); + decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } if (TYPE(CHILD(n, 3)) == RPAR) { /* class NAME '(' ')' ':' suite */ @@ -2884,7 +2898,7 @@ ast_for_classdef(struct compiling *c, const node *n) if (!s) return NULL; return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), NULL, NULL, NULL, NULL, s, - LINENO(n), n->n_col_offset, c->c_arena); + decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } /* class NAME '(' arglist ')' ':' suite */ @@ -2900,7 +2914,7 @@ ast_for_classdef(struct compiling *c, const node *n) return ClassDef(NEW_IDENTIFIER(CHILD(n, 1)), call->v.Call.args, call->v.Call.keywords, call->v.Call.starargs, call->v.Call.kwargs, s, - LINENO(n), n->n_col_offset, c->c_arena); + decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } static stmt_ty @@ -2946,7 +2960,7 @@ ast_for_stmt(struct compiling *c, const node *n) } else { /* compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt - | funcdef | classdef + | funcdef | classdef | decorated */ node *ch = CHILD(n, 0); REQ(n, compound_stmt); @@ -2962,9 +2976,11 @@ ast_for_stmt(struct compiling *c, const node *n) case with_stmt: return ast_for_with_stmt(c, ch); case funcdef: - return ast_for_funcdef(c, ch); + return ast_for_funcdef(c, ch, NULL); case classdef: - return ast_for_classdef(c, ch); + return ast_for_classdef(c, ch, NULL); + case decorated: + return ast_for_decorated(c, ch); default: PyErr_Format(PyExc_SystemError, "unhandled small_stmt: TYPE=%d NCH=%d\n", diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 1587e06..770023d 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -245,19 +245,6 @@ Return True if bool(x) is True for any x in the iterable."); static PyObject * -builtin_callable(PyObject *self, PyObject *v) -{ - return PyBool_FromLong((long)PyCallable_Check(v)); -} - -PyDoc_STRVAR(callable_doc, -"callable(object) -> bool\n\ -\n\ -Return whether the object is callable (i.e., some kind of function).\n\ -Note that classes are callable, as are instances with a __call__() method."); - - -static PyObject * builtin_filter(PyObject *self, PyObject *args) { PyObject *func, *seq, *result, *it, *arg; @@ -1948,7 +1935,6 @@ static PyMethodDef builtin_methods[] = { {"abs", builtin_abs, METH_O, abs_doc}, {"all", builtin_all, METH_O, all_doc}, {"any", builtin_any, METH_O, any_doc}, - {"callable", builtin_callable, METH_O, callable_doc}, {"chr", builtin_unichr, METH_VARARGS, unichr_doc}, {"chr8", builtin_chr, METH_VARARGS, chr_doc}, {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, diff --git a/Python/ceval.c b/Python/ceval.c index df3fa79..d777a3a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3779,13 +3779,31 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk) if (flags & CALL_FLAG_KW) { kwdict = EXT_POP(*pp_stack); - if (!(kwdict && PyDict_Check(kwdict))) { - PyErr_Format(PyExc_TypeError, - "%s%s argument after ** " - "must be a dictionary", - PyEval_GetFuncName(func), - PyEval_GetFuncDesc(func)); - goto ext_call_fail; + if (!PyDict_Check(kwdict)) { + PyObject *d; + d = PyDict_New(); + if (d == NULL) + goto ext_call_fail; + if (PyDict_Update(d, kwdict) != 0) { + Py_DECREF(d); + /* PyDict_Update raises attribute + * error (percolated from an attempt + * to get 'keys' attribute) instead of + * a type error if its second argument + * is not a mapping. + */ + if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_TypeError, + "%.200s%.200s argument after ** " + "must be a mapping, not %.200s", + PyEval_GetFuncName(func), + PyEval_GetFuncDesc(func), + kwdict->ob_type->tp_name); + } + goto ext_call_fail; + } + Py_DECREF(kwdict); + kwdict = d; } } if (flags & CALL_FLAG_VAR) { @@ -3796,10 +3814,11 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk) if (t == NULL) { if (PyErr_ExceptionMatches(PyExc_TypeError)) { PyErr_Format(PyExc_TypeError, - "%s%s argument after * " - "must be a sequence", + "%.200s%.200s argument after * " + "must be a sequence, not %200s", PyEval_GetFuncName(func), - PyEval_GetFuncDesc(func)); + PyEval_GetFuncDesc(func), + stararg->ob_type->tp_name); } goto ext_call_fail; } diff --git a/Python/compile.c b/Python/compile.c index fb8fb52..ffca830 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1408,7 +1408,7 @@ compiler_function(struct compiler *c, stmt_ty s) PyObject *first_const = Py_None; arguments_ty args = s->v.FunctionDef.args; expr_ty returns = s->v.FunctionDef.returns; - asdl_seq* decos = s->v.FunctionDef.decorators; + asdl_seq* decos = s->v.FunctionDef.decorator_list; stmt_ty st; int i, n, docstring, kw_default_count = 0, arglength; int num_annotations; @@ -1479,7 +1479,12 @@ compiler_class(struct compiler *c, stmt_ty s) PyCodeObject *co; PyObject *str; PySTEntryObject *ste; - int err; + int err, i; + asdl_seq* decos = s->v.ClassDef.decorator_list; + + if (!compiler_decorators(c, decos)) + return 0; + /* initialize statics */ if (build_class == NULL) { @@ -1577,7 +1582,12 @@ compiler_class(struct compiler *c, stmt_ty s) s->v.ClassDef.kwargs)) return 0; - /* 6. store into <name> */ + /* 6. apply decorators */ + for (i = 0; i < asdl_seq_LEN(decos); i++) { + ADDOP_I(c, CALL_FUNCTION, 1); + } + + /* 7. store into <name> */ if (!compiler_nameop(c, s->v.ClassDef.name, Store)) return 0; return 1; diff --git a/Python/graminit.c b/Python/graminit.c index d2f22d3..ba2686f 100644 --- a/Python/graminit.c +++ b/Python/graminit.c @@ -86,304 +86,312 @@ static state states_4[2] = { {1, arcs_4_0}, {2, arcs_4_1}, }; -static arc arcs_5_0[2] = { +static arc arcs_5_0[1] = { {16, 1}, - {18, 2}, }; -static arc arcs_5_1[1] = { +static arc arcs_5_1[2] = { {18, 2}, + {19, 2}, }; static arc arcs_5_2[1] = { - {19, 3}, + {0, 2}, }; -static arc arcs_5_3[1] = { - {20, 4}, +static state states_5[3] = { + {1, arcs_5_0}, + {2, arcs_5_1}, + {1, arcs_5_2}, }; -static arc arcs_5_4[2] = { - {21, 5}, - {23, 6}, +static arc arcs_6_0[1] = { + {20, 1}, }; -static arc arcs_5_5[1] = { - {22, 7}, +static arc arcs_6_1[1] = { + {21, 2}, }; -static arc arcs_5_6[1] = { - {24, 8}, +static arc arcs_6_2[1] = { + {22, 3}, }; -static arc arcs_5_7[1] = { - {23, 6}, +static arc arcs_6_3[2] = { + {23, 4}, + {25, 5}, }; -static arc arcs_5_8[1] = { - {0, 8}, +static arc arcs_6_4[1] = { + {24, 6}, }; -static state states_5[9] = { - {2, arcs_5_0}, - {1, arcs_5_1}, - {1, arcs_5_2}, - {1, arcs_5_3}, - {2, arcs_5_4}, - {1, arcs_5_5}, - {1, arcs_5_6}, - {1, arcs_5_7}, - {1, arcs_5_8}, +static arc arcs_6_5[1] = { + {26, 7}, }; -static arc arcs_6_0[1] = { +static arc arcs_6_6[1] = { + {25, 5}, +}; +static arc arcs_6_7[1] = { + {0, 7}, +}; +static state states_6[8] = { + {1, arcs_6_0}, + {1, arcs_6_1}, + {1, arcs_6_2}, + {2, arcs_6_3}, + {1, arcs_6_4}, + {1, arcs_6_5}, + {1, arcs_6_6}, + {1, arcs_6_7}, +}; +static arc arcs_7_0[1] = { {13, 1}, }; -static arc arcs_6_1[2] = { - {25, 2}, +static arc arcs_7_1[2] = { + {27, 2}, {15, 3}, }; -static arc arcs_6_2[1] = { +static arc arcs_7_2[1] = { {15, 3}, }; -static arc arcs_6_3[1] = { +static arc arcs_7_3[1] = { {0, 3}, }; -static state states_6[4] = { - {1, arcs_6_0}, - {2, arcs_6_1}, - {1, arcs_6_2}, - {1, arcs_6_3}, +static state states_7[4] = { + {1, arcs_7_0}, + {2, arcs_7_1}, + {1, arcs_7_2}, + {1, arcs_7_3}, }; -static arc arcs_7_0[3] = { - {26, 1}, - {29, 2}, - {30, 3}, +static arc arcs_8_0[3] = { + {28, 1}, + {31, 2}, + {32, 3}, }; -static arc arcs_7_1[3] = { - {27, 4}, - {28, 5}, +static arc arcs_8_1[3] = { + {29, 4}, + {30, 5}, {0, 1}, }; -static arc arcs_7_2[3] = { - {26, 6}, - {28, 7}, +static arc arcs_8_2[3] = { + {28, 6}, + {30, 7}, {0, 2}, }; -static arc arcs_7_3[1] = { - {26, 8}, +static arc arcs_8_3[1] = { + {28, 8}, }; -static arc arcs_7_4[1] = { - {22, 9}, +static arc arcs_8_4[1] = { + {24, 9}, }; -static arc arcs_7_5[4] = { - {26, 1}, - {29, 2}, - {30, 3}, +static arc arcs_8_5[4] = { + {28, 1}, + {31, 2}, + {32, 3}, {0, 5}, }; -static arc arcs_7_6[2] = { - {28, 7}, +static arc arcs_8_6[2] = { + {30, 7}, {0, 6}, }; -static arc arcs_7_7[2] = { - {26, 10}, - {30, 3}, +static arc arcs_8_7[2] = { + {28, 10}, + {32, 3}, }; -static arc arcs_7_8[1] = { +static arc arcs_8_8[1] = { {0, 8}, }; -static arc arcs_7_9[2] = { - {28, 5}, +static arc arcs_8_9[2] = { + {30, 5}, {0, 9}, }; -static arc arcs_7_10[3] = { - {28, 7}, - {27, 11}, +static arc arcs_8_10[3] = { + {30, 7}, + {29, 11}, {0, 10}, }; -static arc arcs_7_11[1] = { - {22, 6}, -}; -static state states_7[12] = { - {3, arcs_7_0}, - {3, arcs_7_1}, - {3, arcs_7_2}, - {1, arcs_7_3}, - {1, arcs_7_4}, - {4, arcs_7_5}, - {2, arcs_7_6}, - {2, arcs_7_7}, - {1, arcs_7_8}, - {2, arcs_7_9}, - {3, arcs_7_10}, - {1, arcs_7_11}, -}; -static arc arcs_8_0[1] = { - {19, 1}, +static arc arcs_8_11[1] = { + {24, 6}, }; -static arc arcs_8_1[2] = { - {23, 2}, +static state states_8[12] = { + {3, arcs_8_0}, + {3, arcs_8_1}, + {3, arcs_8_2}, + {1, arcs_8_3}, + {1, arcs_8_4}, + {4, arcs_8_5}, + {2, arcs_8_6}, + {2, arcs_8_7}, + {1, arcs_8_8}, + {2, arcs_8_9}, + {3, arcs_8_10}, + {1, arcs_8_11}, +}; +static arc arcs_9_0[1] = { + {21, 1}, +}; +static arc arcs_9_1[2] = { + {25, 2}, {0, 1}, }; -static arc arcs_8_2[1] = { - {22, 3}, +static arc arcs_9_2[1] = { + {24, 3}, }; -static arc arcs_8_3[1] = { +static arc arcs_9_3[1] = { {0, 3}, }; -static state states_8[4] = { - {1, arcs_8_0}, - {2, arcs_8_1}, - {1, arcs_8_2}, - {1, arcs_8_3}, +static state states_9[4] = { + {1, arcs_9_0}, + {2, arcs_9_1}, + {1, arcs_9_2}, + {1, arcs_9_3}, }; -static arc arcs_9_0[3] = { - {32, 1}, - {29, 2}, - {30, 3}, +static arc arcs_10_0[3] = { + {34, 1}, + {31, 2}, + {32, 3}, }; -static arc arcs_9_1[3] = { - {27, 4}, - {28, 5}, +static arc arcs_10_1[3] = { + {29, 4}, + {30, 5}, {0, 1}, }; -static arc arcs_9_2[3] = { - {32, 6}, - {28, 7}, +static arc arcs_10_2[3] = { + {34, 6}, + {30, 7}, {0, 2}, }; -static arc arcs_9_3[1] = { - {32, 8}, +static arc arcs_10_3[1] = { + {34, 8}, }; -static arc arcs_9_4[1] = { - {22, 9}, +static arc arcs_10_4[1] = { + {24, 9}, }; -static arc arcs_9_5[4] = { - {32, 1}, - {29, 2}, - {30, 3}, +static arc arcs_10_5[4] = { + {34, 1}, + {31, 2}, + {32, 3}, {0, 5}, }; -static arc arcs_9_6[2] = { - {28, 7}, +static arc arcs_10_6[2] = { + {30, 7}, {0, 6}, }; -static arc arcs_9_7[2] = { - {32, 10}, - {30, 3}, +static arc arcs_10_7[2] = { + {34, 10}, + {32, 3}, }; -static arc arcs_9_8[1] = { +static arc arcs_10_8[1] = { {0, 8}, }; -static arc arcs_9_9[2] = { - {28, 5}, +static arc arcs_10_9[2] = { + {30, 5}, {0, 9}, }; -static arc arcs_9_10[3] = { - {28, 7}, - {27, 11}, +static arc arcs_10_10[3] = { + {30, 7}, + {29, 11}, {0, 10}, }; -static arc arcs_9_11[1] = { - {22, 6}, +static arc arcs_10_11[1] = { + {24, 6}, }; -static state states_9[12] = { - {3, arcs_9_0}, - {3, arcs_9_1}, - {3, arcs_9_2}, - {1, arcs_9_3}, - {1, arcs_9_4}, - {4, arcs_9_5}, - {2, arcs_9_6}, - {2, arcs_9_7}, - {1, arcs_9_8}, - {2, arcs_9_9}, - {3, arcs_9_10}, - {1, arcs_9_11}, -}; -static arc arcs_10_0[1] = { - {19, 1}, +static state states_10[12] = { + {3, arcs_10_0}, + {3, arcs_10_1}, + {3, arcs_10_2}, + {1, arcs_10_3}, + {1, arcs_10_4}, + {4, arcs_10_5}, + {2, arcs_10_6}, + {2, arcs_10_7}, + {1, arcs_10_8}, + {2, arcs_10_9}, + {3, arcs_10_10}, + {1, arcs_10_11}, +}; +static arc arcs_11_0[1] = { + {21, 1}, }; -static arc arcs_10_1[1] = { +static arc arcs_11_1[1] = { {0, 1}, }; -static state states_10[2] = { - {1, arcs_10_0}, - {1, arcs_10_1}, +static state states_11[2] = { + {1, arcs_11_0}, + {1, arcs_11_1}, }; -static arc arcs_11_0[2] = { +static arc arcs_12_0[2] = { {3, 1}, {4, 1}, }; -static arc arcs_11_1[1] = { +static arc arcs_12_1[1] = { {0, 1}, }; -static state states_11[2] = { - {2, arcs_11_0}, - {1, arcs_11_1}, +static state states_12[2] = { + {2, arcs_12_0}, + {1, arcs_12_1}, }; -static arc arcs_12_0[1] = { - {33, 1}, +static arc arcs_13_0[1] = { + {35, 1}, }; -static arc arcs_12_1[2] = { - {34, 2}, +static arc arcs_13_1[2] = { + {36, 2}, {2, 3}, }; -static arc arcs_12_2[2] = { - {33, 1}, +static arc arcs_13_2[2] = { + {35, 1}, {2, 3}, }; -static arc arcs_12_3[1] = { +static arc arcs_13_3[1] = { {0, 3}, }; -static state states_12[4] = { - {1, arcs_12_0}, - {2, arcs_12_1}, - {2, arcs_12_2}, - {1, arcs_12_3}, +static state states_13[4] = { + {1, arcs_13_0}, + {2, arcs_13_1}, + {2, arcs_13_2}, + {1, arcs_13_3}, }; -static arc arcs_13_0[8] = { - {35, 1}, - {36, 1}, +static arc arcs_14_0[8] = { {37, 1}, {38, 1}, {39, 1}, {40, 1}, {41, 1}, {42, 1}, + {43, 1}, + {44, 1}, }; -static arc arcs_13_1[1] = { +static arc arcs_14_1[1] = { {0, 1}, }; -static state states_13[2] = { - {8, arcs_13_0}, - {1, arcs_13_1}, +static state states_14[2] = { + {8, arcs_14_0}, + {1, arcs_14_1}, }; -static arc arcs_14_0[1] = { +static arc arcs_15_0[1] = { {9, 1}, }; -static arc arcs_14_1[3] = { - {43, 2}, - {27, 3}, +static arc arcs_15_1[3] = { + {45, 2}, + {29, 3}, {0, 1}, }; -static arc arcs_14_2[2] = { - {44, 4}, +static arc arcs_15_2[2] = { + {46, 4}, {9, 4}, }; -static arc arcs_14_3[2] = { - {44, 5}, +static arc arcs_15_3[2] = { + {46, 5}, {9, 5}, }; -static arc arcs_14_4[1] = { +static arc arcs_15_4[1] = { {0, 4}, }; -static arc arcs_14_5[2] = { - {27, 3}, +static arc arcs_15_5[2] = { + {29, 3}, {0, 5}, }; -static state states_14[6] = { - {1, arcs_14_0}, - {3, arcs_14_1}, - {2, arcs_14_2}, - {2, arcs_14_3}, - {1, arcs_14_4}, - {2, arcs_14_5}, +static state states_15[6] = { + {1, arcs_15_0}, + {3, arcs_15_1}, + {2, arcs_15_2}, + {2, arcs_15_3}, + {1, arcs_15_4}, + {2, arcs_15_5}, }; -static arc arcs_15_0[12] = { - {45, 1}, - {46, 1}, +static arc arcs_16_0[12] = { {47, 1}, {48, 1}, {49, 1}, @@ -394,64 +402,56 @@ static arc arcs_15_0[12] = { {54, 1}, {55, 1}, {56, 1}, -}; -static arc arcs_15_1[1] = { - {0, 1}, -}; -static state states_15[2] = { - {12, arcs_15_0}, - {1, arcs_15_1}, -}; -static arc arcs_16_0[1] = { {57, 1}, + {58, 1}, }; static arc arcs_16_1[1] = { - {58, 2}, -}; -static arc arcs_16_2[1] = { - {0, 2}, + {0, 1}, }; -static state states_16[3] = { - {1, arcs_16_0}, +static state states_16[2] = { + {12, arcs_16_0}, {1, arcs_16_1}, - {1, arcs_16_2}, }; static arc arcs_17_0[1] = { {59, 1}, }; static arc arcs_17_1[1] = { - {0, 1}, + {60, 2}, +}; +static arc arcs_17_2[1] = { + {0, 2}, }; -static state states_17[2] = { +static state states_17[3] = { {1, arcs_17_0}, {1, arcs_17_1}, + {1, arcs_17_2}, }; -static arc arcs_18_0[5] = { - {60, 1}, +static arc arcs_18_0[1] = { {61, 1}, - {62, 1}, - {63, 1}, - {64, 1}, }; static arc arcs_18_1[1] = { {0, 1}, }; static state states_18[2] = { - {5, arcs_18_0}, + {1, arcs_18_0}, {1, arcs_18_1}, }; -static arc arcs_19_0[1] = { +static arc arcs_19_0[5] = { + {62, 1}, + {63, 1}, + {64, 1}, {65, 1}, + {66, 1}, }; static arc arcs_19_1[1] = { {0, 1}, }; static state states_19[2] = { - {1, arcs_19_0}, + {5, arcs_19_0}, {1, arcs_19_1}, }; static arc arcs_20_0[1] = { - {66, 1}, + {67, 1}, }; static arc arcs_20_1[1] = { {0, 1}, @@ -461,157 +461,148 @@ static state states_20[2] = { {1, arcs_20_1}, }; static arc arcs_21_0[1] = { - {67, 1}, + {68, 1}, }; -static arc arcs_21_1[2] = { - {9, 2}, +static arc arcs_21_1[1] = { {0, 1}, }; -static arc arcs_21_2[1] = { - {0, 2}, -}; -static state states_21[3] = { +static state states_21[2] = { {1, arcs_21_0}, - {2, arcs_21_1}, - {1, arcs_21_2}, + {1, arcs_21_1}, }; static arc arcs_22_0[1] = { - {44, 1}, + {69, 1}, }; -static arc arcs_22_1[1] = { +static arc arcs_22_1[2] = { + {9, 2}, {0, 1}, }; -static state states_22[2] = { +static arc arcs_22_2[1] = { + {0, 2}, +}; +static state states_22[3] = { {1, arcs_22_0}, - {1, arcs_22_1}, + {2, arcs_22_1}, + {1, arcs_22_2}, }; static arc arcs_23_0[1] = { - {68, 1}, + {46, 1}, +}; +static arc arcs_23_1[1] = { + {0, 1}, +}; +static state states_23[2] = { + {1, arcs_23_0}, + {1, arcs_23_1}, }; -static arc arcs_23_1[2] = { - {22, 2}, +static arc arcs_24_0[1] = { + {70, 1}, +}; +static arc arcs_24_1[2] = { + {24, 2}, {0, 1}, }; -static arc arcs_23_2[2] = { - {28, 3}, +static arc arcs_24_2[2] = { + {30, 3}, {0, 2}, }; -static arc arcs_23_3[1] = { - {22, 4}, +static arc arcs_24_3[1] = { + {24, 4}, }; -static arc arcs_23_4[2] = { - {28, 5}, +static arc arcs_24_4[2] = { + {30, 5}, {0, 4}, }; -static arc arcs_23_5[1] = { - {22, 6}, +static arc arcs_24_5[1] = { + {24, 6}, }; -static arc arcs_23_6[1] = { +static arc arcs_24_6[1] = { {0, 6}, }; -static state states_23[7] = { - {1, arcs_23_0}, - {2, arcs_23_1}, - {2, arcs_23_2}, - {1, arcs_23_3}, - {2, arcs_23_4}, - {1, arcs_23_5}, - {1, arcs_23_6}, -}; -static arc arcs_24_0[2] = { - {69, 1}, - {70, 1}, -}; -static arc arcs_24_1[1] = { - {0, 1}, -}; -static state states_24[2] = { - {2, arcs_24_0}, - {1, arcs_24_1}, +static state states_24[7] = { + {1, arcs_24_0}, + {2, arcs_24_1}, + {2, arcs_24_2}, + {1, arcs_24_3}, + {2, arcs_24_4}, + {1, arcs_24_5}, + {1, arcs_24_6}, }; -static arc arcs_25_0[1] = { +static arc arcs_25_0[2] = { {71, 1}, + {72, 1}, }; static arc arcs_25_1[1] = { - {72, 2}, -}; -static arc arcs_25_2[1] = { - {0, 2}, + {0, 1}, }; -static state states_25[3] = { - {1, arcs_25_0}, +static state states_25[2] = { + {2, arcs_25_0}, {1, arcs_25_1}, - {1, arcs_25_2}, }; static arc arcs_26_0[1] = { {73, 1}, }; -static arc arcs_26_1[3] = { +static arc arcs_26_1[1] = { {74, 2}, - {75, 2}, +}; +static arc arcs_26_2[1] = { + {0, 2}, +}; +static state states_26[3] = { + {1, arcs_26_0}, + {1, arcs_26_1}, + {1, arcs_26_2}, +}; +static arc arcs_27_0[1] = { + {75, 1}, +}; +static arc arcs_27_1[3] = { + {76, 2}, + {77, 2}, {12, 3}, }; -static arc arcs_26_2[4] = { - {74, 2}, - {75, 2}, +static arc arcs_27_2[4] = { + {76, 2}, + {77, 2}, {12, 3}, - {71, 4}, + {73, 4}, }; -static arc arcs_26_3[1] = { - {71, 4}, +static arc arcs_27_3[1] = { + {73, 4}, }; -static arc arcs_26_4[3] = { - {29, 5}, +static arc arcs_27_4[3] = { + {31, 5}, {13, 6}, - {76, 5}, + {78, 5}, }; -static arc arcs_26_5[1] = { +static arc arcs_27_5[1] = { {0, 5}, }; -static arc arcs_26_6[1] = { - {76, 7}, +static arc arcs_27_6[1] = { + {78, 7}, }; -static arc arcs_26_7[1] = { +static arc arcs_27_7[1] = { {15, 5}, }; -static state states_26[8] = { - {1, arcs_26_0}, - {3, arcs_26_1}, - {4, arcs_26_2}, - {1, arcs_26_3}, - {3, arcs_26_4}, - {1, arcs_26_5}, - {1, arcs_26_6}, - {1, arcs_26_7}, -}; -static arc arcs_27_0[1] = { - {19, 1}, -}; -static arc arcs_27_1[2] = { - {78, 2}, - {0, 1}, -}; -static arc arcs_27_2[1] = { - {19, 3}, -}; -static arc arcs_27_3[1] = { - {0, 3}, -}; -static state states_27[4] = { +static state states_27[8] = { {1, arcs_27_0}, - {2, arcs_27_1}, - {1, arcs_27_2}, + {3, arcs_27_1}, + {4, arcs_27_2}, {1, arcs_27_3}, + {3, arcs_27_4}, + {1, arcs_27_5}, + {1, arcs_27_6}, + {1, arcs_27_7}, }; static arc arcs_28_0[1] = { - {12, 1}, + {21, 1}, }; static arc arcs_28_1[2] = { - {78, 2}, + {80, 2}, {0, 1}, }; static arc arcs_28_2[1] = { - {19, 3}, + {21, 3}, }; static arc arcs_28_3[1] = { {0, 3}, @@ -623,37 +614,45 @@ static state states_28[4] = { {1, arcs_28_3}, }; static arc arcs_29_0[1] = { - {77, 1}, + {12, 1}, }; static arc arcs_29_1[2] = { - {28, 2}, + {80, 2}, {0, 1}, }; -static arc arcs_29_2[2] = { - {77, 1}, - {0, 2}, +static arc arcs_29_2[1] = { + {21, 3}, }; -static state states_29[3] = { +static arc arcs_29_3[1] = { + {0, 3}, +}; +static state states_29[4] = { {1, arcs_29_0}, {2, arcs_29_1}, - {2, arcs_29_2}, + {1, arcs_29_2}, + {1, arcs_29_3}, }; static arc arcs_30_0[1] = { {79, 1}, }; static arc arcs_30_1[2] = { - {28, 0}, + {30, 2}, {0, 1}, }; -static state states_30[2] = { +static arc arcs_30_2[2] = { + {79, 1}, + {0, 2}, +}; +static state states_30[3] = { {1, arcs_30_0}, {2, arcs_30_1}, + {2, arcs_30_2}, }; static arc arcs_31_0[1] = { - {19, 1}, + {81, 1}, }; static arc arcs_31_1[2] = { - {74, 0}, + {30, 0}, {0, 1}, }; static state states_31[2] = { @@ -661,28 +660,24 @@ static state states_31[2] = { {2, arcs_31_1}, }; static arc arcs_32_0[1] = { - {80, 1}, + {21, 1}, }; -static arc arcs_32_1[1] = { - {19, 2}, -}; -static arc arcs_32_2[2] = { - {28, 1}, - {0, 2}, +static arc arcs_32_1[2] = { + {76, 0}, + {0, 1}, }; -static state states_32[3] = { +static state states_32[2] = { {1, arcs_32_0}, - {1, arcs_32_1}, - {2, arcs_32_2}, + {2, arcs_32_1}, }; static arc arcs_33_0[1] = { - {81, 1}, + {82, 1}, }; static arc arcs_33_1[1] = { - {19, 2}, + {21, 2}, }; static arc arcs_33_2[2] = { - {28, 1}, + {30, 1}, {0, 2}, }; static state states_33[3] = { @@ -691,101 +686,82 @@ static state states_33[3] = { {2, arcs_33_2}, }; static arc arcs_34_0[1] = { - {82, 1}, + {83, 1}, }; static arc arcs_34_1[1] = { - {22, 2}, + {21, 2}, }; static arc arcs_34_2[2] = { - {28, 3}, + {30, 1}, {0, 2}, }; -static arc arcs_34_3[1] = { - {22, 4}, -}; -static arc arcs_34_4[1] = { - {0, 4}, -}; -static state states_34[5] = { +static state states_34[3] = { {1, arcs_34_0}, {1, arcs_34_1}, {2, arcs_34_2}, - {1, arcs_34_3}, - {1, arcs_34_4}, }; -static arc arcs_35_0[7] = { - {83, 1}, +static arc arcs_35_0[1] = { {84, 1}, - {85, 1}, - {86, 1}, - {87, 1}, - {17, 1}, - {88, 1}, }; static arc arcs_35_1[1] = { - {0, 1}, -}; -static state states_35[2] = { - {7, arcs_35_0}, - {1, arcs_35_1}, + {24, 2}, }; -static arc arcs_36_0[1] = { - {89, 1}, -}; -static arc arcs_36_1[1] = { - {22, 2}, -}; -static arc arcs_36_2[1] = { - {23, 3}, +static arc arcs_35_2[2] = { + {30, 3}, + {0, 2}, }; -static arc arcs_36_3[1] = { +static arc arcs_35_3[1] = { {24, 4}, }; -static arc arcs_36_4[3] = { - {90, 1}, - {91, 5}, +static arc arcs_35_4[1] = { {0, 4}, }; -static arc arcs_36_5[1] = { - {23, 6}, +static state states_35[5] = { + {1, arcs_35_0}, + {1, arcs_35_1}, + {2, arcs_35_2}, + {1, arcs_35_3}, + {1, arcs_35_4}, }; -static arc arcs_36_6[1] = { - {24, 7}, +static arc arcs_36_0[8] = { + {85, 1}, + {86, 1}, + {87, 1}, + {88, 1}, + {89, 1}, + {19, 1}, + {18, 1}, + {17, 1}, }; -static arc arcs_36_7[1] = { - {0, 7}, +static arc arcs_36_1[1] = { + {0, 1}, }; -static state states_36[8] = { - {1, arcs_36_0}, +static state states_36[2] = { + {8, arcs_36_0}, {1, arcs_36_1}, - {1, arcs_36_2}, - {1, arcs_36_3}, - {3, arcs_36_4}, - {1, arcs_36_5}, - {1, arcs_36_6}, - {1, arcs_36_7}, }; static arc arcs_37_0[1] = { - {92, 1}, + {90, 1}, }; static arc arcs_37_1[1] = { - {22, 2}, + {24, 2}, }; static arc arcs_37_2[1] = { - {23, 3}, + {25, 3}, }; static arc arcs_37_3[1] = { - {24, 4}, + {26, 4}, }; -static arc arcs_37_4[2] = { - {91, 5}, +static arc arcs_37_4[3] = { + {91, 1}, + {92, 5}, {0, 4}, }; static arc arcs_37_5[1] = { - {23, 6}, + {25, 6}, }; static arc arcs_37_6[1] = { - {24, 7}, + {26, 7}, }; static arc arcs_37_7[1] = { {0, 7}, @@ -795,7 +771,7 @@ static state states_37[8] = { {1, arcs_37_1}, {1, arcs_37_2}, {1, arcs_37_3}, - {2, arcs_37_4}, + {3, arcs_37_4}, {1, arcs_37_5}, {1, arcs_37_6}, {1, arcs_37_7}, @@ -804,267 +780,279 @@ static arc arcs_38_0[1] = { {93, 1}, }; static arc arcs_38_1[1] = { - {58, 2}, + {24, 2}, }; static arc arcs_38_2[1] = { - {94, 3}, + {25, 3}, }; static arc arcs_38_3[1] = { - {9, 4}, + {26, 4}, }; -static arc arcs_38_4[1] = { - {23, 5}, +static arc arcs_38_4[2] = { + {92, 5}, + {0, 4}, }; static arc arcs_38_5[1] = { - {24, 6}, + {25, 6}, }; -static arc arcs_38_6[2] = { - {91, 7}, - {0, 6}, +static arc arcs_38_6[1] = { + {26, 7}, }; static arc arcs_38_7[1] = { - {23, 8}, -}; -static arc arcs_38_8[1] = { - {24, 9}, -}; -static arc arcs_38_9[1] = { - {0, 9}, + {0, 7}, }; -static state states_38[10] = { +static state states_38[8] = { {1, arcs_38_0}, {1, arcs_38_1}, {1, arcs_38_2}, {1, arcs_38_3}, - {1, arcs_38_4}, + {2, arcs_38_4}, {1, arcs_38_5}, - {2, arcs_38_6}, + {1, arcs_38_6}, {1, arcs_38_7}, - {1, arcs_38_8}, - {1, arcs_38_9}, }; static arc arcs_39_0[1] = { - {95, 1}, + {94, 1}, }; static arc arcs_39_1[1] = { - {23, 2}, + {60, 2}, }; static arc arcs_39_2[1] = { - {24, 3}, + {95, 3}, }; -static arc arcs_39_3[2] = { - {96, 4}, - {97, 5}, +static arc arcs_39_3[1] = { + {9, 4}, }; static arc arcs_39_4[1] = { - {23, 6}, + {25, 5}, }; static arc arcs_39_5[1] = { - {23, 7}, + {26, 6}, }; -static arc arcs_39_6[1] = { - {24, 8}, +static arc arcs_39_6[2] = { + {92, 7}, + {0, 6}, }; static arc arcs_39_7[1] = { - {24, 9}, + {25, 8}, }; -static arc arcs_39_8[4] = { - {96, 4}, - {91, 10}, - {97, 5}, - {0, 8}, +static arc arcs_39_8[1] = { + {26, 9}, }; static arc arcs_39_9[1] = { {0, 9}, }; -static arc arcs_39_10[1] = { - {23, 11}, -}; -static arc arcs_39_11[1] = { - {24, 12}, -}; -static arc arcs_39_12[2] = { - {97, 5}, - {0, 12}, -}; -static state states_39[13] = { +static state states_39[10] = { {1, arcs_39_0}, {1, arcs_39_1}, {1, arcs_39_2}, - {2, arcs_39_3}, + {1, arcs_39_3}, {1, arcs_39_4}, {1, arcs_39_5}, - {1, arcs_39_6}, + {2, arcs_39_6}, {1, arcs_39_7}, - {4, arcs_39_8}, + {1, arcs_39_8}, {1, arcs_39_9}, - {1, arcs_39_10}, - {1, arcs_39_11}, - {2, arcs_39_12}, }; static arc arcs_40_0[1] = { - {98, 1}, + {96, 1}, }; static arc arcs_40_1[1] = { - {22, 2}, + {25, 2}, }; -static arc arcs_40_2[2] = { - {99, 3}, - {23, 4}, +static arc arcs_40_2[1] = { + {26, 3}, }; -static arc arcs_40_3[1] = { - {23, 4}, +static arc arcs_40_3[2] = { + {97, 4}, + {98, 5}, }; static arc arcs_40_4[1] = { - {24, 5}, + {25, 6}, }; static arc arcs_40_5[1] = { - {0, 5}, + {25, 7}, +}; +static arc arcs_40_6[1] = { + {26, 8}, }; -static state states_40[6] = { +static arc arcs_40_7[1] = { + {26, 9}, +}; +static arc arcs_40_8[4] = { + {97, 4}, + {92, 10}, + {98, 5}, + {0, 8}, +}; +static arc arcs_40_9[1] = { + {0, 9}, +}; +static arc arcs_40_10[1] = { + {25, 11}, +}; +static arc arcs_40_11[1] = { + {26, 12}, +}; +static arc arcs_40_12[2] = { + {98, 5}, + {0, 12}, +}; +static state states_40[13] = { {1, arcs_40_0}, {1, arcs_40_1}, - {2, arcs_40_2}, - {1, arcs_40_3}, + {1, arcs_40_2}, + {2, arcs_40_3}, {1, arcs_40_4}, {1, arcs_40_5}, + {1, arcs_40_6}, + {1, arcs_40_7}, + {4, arcs_40_8}, + {1, arcs_40_9}, + {1, arcs_40_10}, + {1, arcs_40_11}, + {2, arcs_40_12}, }; static arc arcs_41_0[1] = { - {78, 1}, + {99, 1}, }; static arc arcs_41_1[1] = { - {100, 2}, + {24, 2}, }; -static arc arcs_41_2[1] = { - {0, 2}, +static arc arcs_41_2[2] = { + {100, 3}, + {25, 4}, +}; +static arc arcs_41_3[1] = { + {25, 4}, }; -static state states_41[3] = { +static arc arcs_41_4[1] = { + {26, 5}, +}; +static arc arcs_41_5[1] = { + {0, 5}, +}; +static state states_41[6] = { {1, arcs_41_0}, {1, arcs_41_1}, - {1, arcs_41_2}, + {2, arcs_41_2}, + {1, arcs_41_3}, + {1, arcs_41_4}, + {1, arcs_41_5}, }; static arc arcs_42_0[1] = { - {101, 1}, + {80, 1}, }; -static arc arcs_42_1[2] = { - {22, 2}, - {0, 1}, +static arc arcs_42_1[1] = { + {101, 2}, }; -static arc arcs_42_2[2] = { - {78, 3}, +static arc arcs_42_2[1] = { {0, 2}, }; -static arc arcs_42_3[1] = { - {19, 4}, -}; -static arc arcs_42_4[1] = { - {0, 4}, -}; -static state states_42[5] = { +static state states_42[3] = { {1, arcs_42_0}, - {2, arcs_42_1}, - {2, arcs_42_2}, - {1, arcs_42_3}, - {1, arcs_42_4}, + {1, arcs_42_1}, + {1, arcs_42_2}, }; -static arc arcs_43_0[2] = { - {3, 1}, - {2, 2}, +static arc arcs_43_0[1] = { + {102, 1}, }; -static arc arcs_43_1[1] = { +static arc arcs_43_1[2] = { + {24, 2}, {0, 1}, }; -static arc arcs_43_2[1] = { - {102, 3}, +static arc arcs_43_2[2] = { + {80, 3}, + {0, 2}, }; static arc arcs_43_3[1] = { - {6, 4}, + {21, 4}, }; -static arc arcs_43_4[2] = { - {6, 4}, - {103, 1}, +static arc arcs_43_4[1] = { + {0, 4}, }; static state states_43[5] = { - {2, arcs_43_0}, - {1, arcs_43_1}, - {1, arcs_43_2}, + {1, arcs_43_0}, + {2, arcs_43_1}, + {2, arcs_43_2}, {1, arcs_43_3}, - {2, arcs_43_4}, + {1, arcs_43_4}, }; static arc arcs_44_0[2] = { - {104, 1}, - {105, 2}, + {3, 1}, + {2, 2}, }; -static arc arcs_44_1[2] = { - {89, 3}, +static arc arcs_44_1[1] = { {0, 1}, }; static arc arcs_44_2[1] = { - {0, 2}, + {103, 3}, }; static arc arcs_44_3[1] = { - {104, 4}, -}; -static arc arcs_44_4[1] = { - {91, 5}, + {6, 4}, }; -static arc arcs_44_5[1] = { - {22, 2}, +static arc arcs_44_4[2] = { + {6, 4}, + {104, 1}, }; -static state states_44[6] = { +static state states_44[5] = { {2, arcs_44_0}, - {2, arcs_44_1}, + {1, arcs_44_1}, {1, arcs_44_2}, {1, arcs_44_3}, - {1, arcs_44_4}, - {1, arcs_44_5}, + {2, arcs_44_4}, }; static arc arcs_45_0[2] = { - {104, 1}, - {107, 1}, + {105, 1}, + {106, 2}, }; -static arc arcs_45_1[1] = { +static arc arcs_45_1[2] = { + {90, 3}, {0, 1}, }; -static state states_45[2] = { - {2, arcs_45_0}, - {1, arcs_45_1}, +static arc arcs_45_2[1] = { + {0, 2}, }; -static arc arcs_46_0[1] = { - {108, 1}, +static arc arcs_45_3[1] = { + {105, 4}, }; -static arc arcs_46_1[2] = { - {31, 2}, - {23, 3}, +static arc arcs_45_4[1] = { + {92, 5}, }; -static arc arcs_46_2[1] = { - {23, 3}, +static arc arcs_45_5[1] = { + {24, 2}, }; -static arc arcs_46_3[1] = { - {22, 4}, +static state states_45[6] = { + {2, arcs_45_0}, + {2, arcs_45_1}, + {1, arcs_45_2}, + {1, arcs_45_3}, + {1, arcs_45_4}, + {1, arcs_45_5}, +}; +static arc arcs_46_0[2] = { + {105, 1}, + {108, 1}, }; -static arc arcs_46_4[1] = { - {0, 4}, +static arc arcs_46_1[1] = { + {0, 1}, }; -static state states_46[5] = { - {1, arcs_46_0}, - {2, arcs_46_1}, - {1, arcs_46_2}, - {1, arcs_46_3}, - {1, arcs_46_4}, +static state states_46[2] = { + {2, arcs_46_0}, + {1, arcs_46_1}, }; static arc arcs_47_0[1] = { - {108, 1}, + {109, 1}, }; static arc arcs_47_1[2] = { - {31, 2}, - {23, 3}, + {33, 2}, + {25, 3}, }; static arc arcs_47_2[1] = { - {23, 3}, + {25, 3}, }; static arc arcs_47_3[1] = { - {106, 4}, + {24, 4}, }; static arc arcs_47_4[1] = { {0, 4}, @@ -1080,108 +1068,120 @@ static arc arcs_48_0[1] = { {109, 1}, }; static arc arcs_48_1[2] = { - {110, 0}, - {0, 1}, + {33, 2}, + {25, 3}, }; -static state states_48[2] = { +static arc arcs_48_2[1] = { + {25, 3}, +}; +static arc arcs_48_3[1] = { + {107, 4}, +}; +static arc arcs_48_4[1] = { + {0, 4}, +}; +static state states_48[5] = { {1, arcs_48_0}, {2, arcs_48_1}, + {1, arcs_48_2}, + {1, arcs_48_3}, + {1, arcs_48_4}, }; static arc arcs_49_0[1] = { - {111, 1}, + {110, 1}, }; static arc arcs_49_1[2] = { - {112, 0}, + {111, 0}, {0, 1}, }; static state states_49[2] = { {1, arcs_49_0}, {2, arcs_49_1}, }; -static arc arcs_50_0[2] = { - {113, 1}, - {114, 2}, +static arc arcs_50_0[1] = { + {112, 1}, +}; +static arc arcs_50_1[2] = { + {113, 0}, + {0, 1}, +}; +static state states_50[2] = { + {1, arcs_50_0}, + {2, arcs_50_1}, }; -static arc arcs_50_1[1] = { - {111, 2}, +static arc arcs_51_0[2] = { + {114, 1}, + {115, 2}, }; -static arc arcs_50_2[1] = { +static arc arcs_51_1[1] = { + {112, 2}, +}; +static arc arcs_51_2[1] = { {0, 2}, }; -static state states_50[3] = { - {2, arcs_50_0}, - {1, arcs_50_1}, - {1, arcs_50_2}, +static state states_51[3] = { + {2, arcs_51_0}, + {1, arcs_51_1}, + {1, arcs_51_2}, }; -static arc arcs_51_0[1] = { - {115, 1}, +static arc arcs_52_0[1] = { + {116, 1}, }; -static arc arcs_51_1[2] = { - {116, 0}, +static arc arcs_52_1[2] = { + {117, 0}, {0, 1}, }; -static state states_51[2] = { - {1, arcs_51_0}, - {2, arcs_51_1}, +static state states_52[2] = { + {1, arcs_52_0}, + {2, arcs_52_1}, }; -static arc arcs_52_0[9] = { - {117, 1}, +static arc arcs_53_0[9] = { {118, 1}, {119, 1}, {120, 1}, {121, 1}, {122, 1}, - {94, 1}, - {113, 2}, - {123, 3}, + {123, 1}, + {95, 1}, + {114, 2}, + {124, 3}, }; -static arc arcs_52_1[1] = { +static arc arcs_53_1[1] = { {0, 1}, }; -static arc arcs_52_2[1] = { - {94, 1}, +static arc arcs_53_2[1] = { + {95, 1}, }; -static arc arcs_52_3[2] = { - {113, 1}, +static arc arcs_53_3[2] = { + {114, 1}, {0, 3}, }; -static state states_52[4] = { - {9, arcs_52_0}, - {1, arcs_52_1}, - {1, arcs_52_2}, - {2, arcs_52_3}, -}; -static arc arcs_53_0[2] = { - {29, 1}, - {100, 2}, -}; -static arc arcs_53_1[1] = { - {100, 2}, -}; -static arc arcs_53_2[1] = { - {0, 2}, -}; -static state states_53[3] = { - {2, arcs_53_0}, +static state states_53[4] = { + {9, arcs_53_0}, {1, arcs_53_1}, {1, arcs_53_2}, + {2, arcs_53_3}, }; -static arc arcs_54_0[1] = { - {124, 1}, +static arc arcs_54_0[2] = { + {31, 1}, + {101, 2}, }; -static arc arcs_54_1[2] = { - {125, 0}, - {0, 1}, +static arc arcs_54_1[1] = { + {101, 2}, +}; +static arc arcs_54_2[1] = { + {0, 2}, }; -static state states_54[2] = { - {1, arcs_54_0}, - {2, arcs_54_1}, +static state states_54[3] = { + {2, arcs_54_0}, + {1, arcs_54_1}, + {1, arcs_54_2}, }; static arc arcs_55_0[1] = { - {126, 1}, + {125, 1}, }; static arc arcs_55_1[2] = { - {127, 0}, + {126, 0}, {0, 1}, }; static state states_55[2] = { @@ -1189,10 +1189,10 @@ static state states_55[2] = { {2, arcs_55_1}, }; static arc arcs_56_0[1] = { - {128, 1}, + {127, 1}, }; static arc arcs_56_1[2] = { - {129, 0}, + {128, 0}, {0, 1}, }; static state states_56[2] = { @@ -1200,23 +1200,22 @@ static state states_56[2] = { {2, arcs_56_1}, }; static arc arcs_57_0[1] = { - {130, 1}, + {129, 1}, }; -static arc arcs_57_1[3] = { - {131, 0}, - {132, 0}, +static arc arcs_57_1[2] = { + {130, 0}, {0, 1}, }; static state states_57[2] = { {1, arcs_57_0}, - {3, arcs_57_1}, + {2, arcs_57_1}, }; static arc arcs_58_0[1] = { - {133, 1}, + {131, 1}, }; static arc arcs_58_1[3] = { - {134, 0}, - {135, 0}, + {132, 0}, + {133, 0}, {0, 1}, }; static state states_58[2] = { @@ -1224,247 +1223,243 @@ static state states_58[2] = { {3, arcs_58_1}, }; static arc arcs_59_0[1] = { - {136, 1}, + {134, 1}, }; -static arc arcs_59_1[5] = { - {29, 0}, - {137, 0}, - {138, 0}, - {139, 0}, +static arc arcs_59_1[3] = { + {135, 0}, + {136, 0}, {0, 1}, }; static state states_59[2] = { {1, arcs_59_0}, - {5, arcs_59_1}, + {3, arcs_59_1}, }; -static arc arcs_60_0[4] = { - {134, 1}, +static arc arcs_60_0[1] = { + {137, 1}, +}; +static arc arcs_60_1[5] = { + {31, 0}, + {138, 0}, + {139, 0}, + {140, 0}, + {0, 1}, +}; +static state states_60[2] = { + {1, arcs_60_0}, + {5, arcs_60_1}, +}; +static arc arcs_61_0[4] = { {135, 1}, - {140, 1}, - {141, 2}, + {136, 1}, + {141, 1}, + {142, 2}, }; -static arc arcs_60_1[1] = { - {136, 2}, +static arc arcs_61_1[1] = { + {137, 2}, }; -static arc arcs_60_2[1] = { +static arc arcs_61_2[1] = { {0, 2}, }; -static state states_60[3] = { - {4, arcs_60_0}, - {1, arcs_60_1}, - {1, arcs_60_2}, -}; -static arc arcs_61_0[1] = { - {142, 1}, +static state states_61[3] = { + {4, arcs_61_0}, + {1, arcs_61_1}, + {1, arcs_61_2}, }; -static arc arcs_61_1[3] = { +static arc arcs_62_0[1] = { {143, 1}, - {30, 2}, +}; +static arc arcs_62_1[3] = { + {144, 1}, + {32, 2}, {0, 1}, }; -static arc arcs_61_2[1] = { - {136, 3}, +static arc arcs_62_2[1] = { + {137, 3}, }; -static arc arcs_61_3[1] = { +static arc arcs_62_3[1] = { {0, 3}, }; -static state states_61[4] = { - {1, arcs_61_0}, - {3, arcs_61_1}, - {1, arcs_61_2}, - {1, arcs_61_3}, +static state states_62[4] = { + {1, arcs_62_0}, + {3, arcs_62_1}, + {1, arcs_62_2}, + {1, arcs_62_3}, }; -static arc arcs_62_0[7] = { +static arc arcs_63_0[7] = { {13, 1}, - {145, 2}, - {147, 3}, - {19, 4}, - {150, 4}, - {151, 5}, - {75, 4}, + {146, 2}, + {148, 3}, + {21, 4}, + {151, 4}, + {152, 5}, + {77, 4}, }; -static arc arcs_62_1[3] = { - {44, 6}, - {144, 6}, +static arc arcs_63_1[3] = { + {46, 6}, + {145, 6}, {15, 4}, }; -static arc arcs_62_2[2] = { - {144, 7}, - {146, 4}, +static arc arcs_63_2[2] = { + {145, 7}, + {147, 4}, }; -static arc arcs_62_3[2] = { - {148, 8}, - {149, 4}, +static arc arcs_63_3[2] = { + {149, 8}, + {150, 4}, }; -static arc arcs_62_4[1] = { +static arc arcs_63_4[1] = { {0, 4}, }; -static arc arcs_62_5[2] = { - {151, 5}, +static arc arcs_63_5[2] = { + {152, 5}, {0, 5}, }; -static arc arcs_62_6[1] = { +static arc arcs_63_6[1] = { {15, 4}, }; -static arc arcs_62_7[1] = { - {146, 4}, +static arc arcs_63_7[1] = { + {147, 4}, }; -static arc arcs_62_8[1] = { - {149, 4}, +static arc arcs_63_8[1] = { + {150, 4}, }; -static state states_62[9] = { - {7, arcs_62_0}, - {3, arcs_62_1}, - {2, arcs_62_2}, - {2, arcs_62_3}, - {1, arcs_62_4}, - {2, arcs_62_5}, - {1, arcs_62_6}, - {1, arcs_62_7}, - {1, arcs_62_8}, +static state states_63[9] = { + {7, arcs_63_0}, + {3, arcs_63_1}, + {2, arcs_63_2}, + {2, arcs_63_3}, + {1, arcs_63_4}, + {2, arcs_63_5}, + {1, arcs_63_6}, + {1, arcs_63_7}, + {1, arcs_63_8}, }; -static arc arcs_63_0[1] = { - {22, 1}, +static arc arcs_64_0[1] = { + {24, 1}, }; -static arc arcs_63_1[3] = { - {152, 2}, - {28, 3}, +static arc arcs_64_1[3] = { + {153, 2}, + {30, 3}, {0, 1}, }; -static arc arcs_63_2[1] = { +static arc arcs_64_2[1] = { {0, 2}, }; -static arc arcs_63_3[2] = { - {22, 4}, +static arc arcs_64_3[2] = { + {24, 4}, {0, 3}, }; -static arc arcs_63_4[2] = { - {28, 3}, +static arc arcs_64_4[2] = { + {30, 3}, {0, 4}, }; -static state states_63[5] = { - {1, arcs_63_0}, - {3, arcs_63_1}, - {1, arcs_63_2}, - {2, arcs_63_3}, - {2, arcs_63_4}, +static state states_64[5] = { + {1, arcs_64_0}, + {3, arcs_64_1}, + {1, arcs_64_2}, + {2, arcs_64_3}, + {2, arcs_64_4}, }; -static arc arcs_64_0[3] = { +static arc arcs_65_0[3] = { {13, 1}, - {145, 2}, - {74, 3}, + {146, 2}, + {76, 3}, }; -static arc arcs_64_1[2] = { +static arc arcs_65_1[2] = { {14, 4}, {15, 5}, }; -static arc arcs_64_2[1] = { - {153, 6}, +static arc arcs_65_2[1] = { + {154, 6}, }; -static arc arcs_64_3[1] = { - {19, 5}, +static arc arcs_65_3[1] = { + {21, 5}, }; -static arc arcs_64_4[1] = { +static arc arcs_65_4[1] = { {15, 5}, }; -static arc arcs_64_5[1] = { +static arc arcs_65_5[1] = { {0, 5}, }; -static arc arcs_64_6[1] = { - {146, 5}, -}; -static state states_64[7] = { - {3, arcs_64_0}, - {2, arcs_64_1}, - {1, arcs_64_2}, - {1, arcs_64_3}, - {1, arcs_64_4}, - {1, arcs_64_5}, - {1, arcs_64_6}, -}; -static arc arcs_65_0[1] = { - {154, 1}, +static arc arcs_65_6[1] = { + {147, 5}, }; -static arc arcs_65_1[2] = { - {28, 2}, - {0, 1}, -}; -static arc arcs_65_2[2] = { - {154, 1}, - {0, 2}, -}; -static state states_65[3] = { - {1, arcs_65_0}, +static state states_65[7] = { + {3, arcs_65_0}, {2, arcs_65_1}, - {2, arcs_65_2}, + {1, arcs_65_2}, + {1, arcs_65_3}, + {1, arcs_65_4}, + {1, arcs_65_5}, + {1, arcs_65_6}, }; -static arc arcs_66_0[2] = { - {22, 1}, - {23, 2}, +static arc arcs_66_0[1] = { + {155, 1}, }; static arc arcs_66_1[2] = { - {23, 2}, + {30, 2}, {0, 1}, }; -static arc arcs_66_2[3] = { - {22, 3}, - {155, 4}, +static arc arcs_66_2[2] = { + {155, 1}, {0, 2}, }; -static arc arcs_66_3[2] = { - {155, 4}, - {0, 3}, -}; -static arc arcs_66_4[1] = { - {0, 4}, -}; -static state states_66[5] = { - {2, arcs_66_0}, +static state states_66[3] = { + {1, arcs_66_0}, {2, arcs_66_1}, - {3, arcs_66_2}, - {2, arcs_66_3}, - {1, arcs_66_4}, + {2, arcs_66_2}, }; -static arc arcs_67_0[1] = { - {23, 1}, +static arc arcs_67_0[2] = { + {24, 1}, + {25, 2}, }; static arc arcs_67_1[2] = { - {22, 2}, + {25, 2}, {0, 1}, }; -static arc arcs_67_2[1] = { +static arc arcs_67_2[3] = { + {24, 3}, + {156, 4}, {0, 2}, }; -static state states_67[3] = { - {1, arcs_67_0}, +static arc arcs_67_3[2] = { + {156, 4}, + {0, 3}, +}; +static arc arcs_67_4[1] = { + {0, 4}, +}; +static state states_67[5] = { + {2, arcs_67_0}, {2, arcs_67_1}, - {1, arcs_67_2}, + {3, arcs_67_2}, + {2, arcs_67_3}, + {1, arcs_67_4}, }; static arc arcs_68_0[1] = { - {115, 1}, + {25, 1}, }; static arc arcs_68_1[2] = { - {28, 2}, + {24, 2}, {0, 1}, }; -static arc arcs_68_2[2] = { - {115, 1}, +static arc arcs_68_2[1] = { {0, 2}, }; static state states_68[3] = { {1, arcs_68_0}, {2, arcs_68_1}, - {2, arcs_68_2}, + {1, arcs_68_2}, }; static arc arcs_69_0[1] = { - {22, 1}, + {116, 1}, }; static arc arcs_69_1[2] = { - {28, 2}, + {30, 2}, {0, 1}, }; static arc arcs_69_2[2] = { - {22, 1}, + {116, 1}, {0, 2}, }; static state states_69[3] = { @@ -1473,448 +1468,468 @@ static state states_69[3] = { {2, arcs_69_2}, }; static arc arcs_70_0[1] = { - {22, 1}, + {24, 1}, }; -static arc arcs_70_1[4] = { - {23, 2}, - {152, 3}, - {28, 4}, +static arc arcs_70_1[2] = { + {30, 2}, {0, 1}, }; -static arc arcs_70_2[1] = { - {22, 5}, +static arc arcs_70_2[2] = { + {24, 1}, + {0, 2}, +}; +static state states_70[3] = { + {1, arcs_70_0}, + {2, arcs_70_1}, + {2, arcs_70_2}, +}; +static arc arcs_71_0[1] = { + {24, 1}, }; -static arc arcs_70_3[1] = { +static arc arcs_71_1[4] = { + {25, 2}, + {153, 3}, + {30, 4}, + {0, 1}, +}; +static arc arcs_71_2[1] = { + {24, 5}, +}; +static arc arcs_71_3[1] = { {0, 3}, }; -static arc arcs_70_4[2] = { - {22, 6}, +static arc arcs_71_4[2] = { + {24, 6}, {0, 4}, }; -static arc arcs_70_5[2] = { - {28, 7}, +static arc arcs_71_5[2] = { + {30, 7}, {0, 5}, }; -static arc arcs_70_6[2] = { - {28, 4}, +static arc arcs_71_6[2] = { + {30, 4}, {0, 6}, }; -static arc arcs_70_7[2] = { - {22, 8}, +static arc arcs_71_7[2] = { + {24, 8}, {0, 7}, }; -static arc arcs_70_8[1] = { - {23, 2}, -}; -static state states_70[9] = { - {1, arcs_70_0}, - {4, arcs_70_1}, - {1, arcs_70_2}, - {1, arcs_70_3}, - {2, arcs_70_4}, - {2, arcs_70_5}, - {2, arcs_70_6}, - {2, arcs_70_7}, - {1, arcs_70_8}, +static arc arcs_71_8[1] = { + {25, 2}, }; -static arc arcs_71_0[1] = { - {156, 1}, +static state states_71[9] = { + {1, arcs_71_0}, + {4, arcs_71_1}, + {1, arcs_71_2}, + {1, arcs_71_3}, + {2, arcs_71_4}, + {2, arcs_71_5}, + {2, arcs_71_6}, + {2, arcs_71_7}, + {1, arcs_71_8}, +}; +static arc arcs_72_0[1] = { + {157, 1}, }; -static arc arcs_71_1[1] = { - {19, 2}, +static arc arcs_72_1[1] = { + {21, 2}, }; -static arc arcs_71_2[2] = { +static arc arcs_72_2[2] = { {13, 3}, - {23, 4}, + {25, 4}, }; -static arc arcs_71_3[2] = { +static arc arcs_72_3[2] = { {14, 5}, {15, 6}, }; -static arc arcs_71_4[1] = { - {24, 7}, +static arc arcs_72_4[1] = { + {26, 7}, }; -static arc arcs_71_5[1] = { +static arc arcs_72_5[1] = { {15, 6}, }; -static arc arcs_71_6[1] = { - {23, 4}, -}; -static arc arcs_71_7[1] = { - {0, 7}, -}; -static state states_71[8] = { - {1, arcs_71_0}, - {1, arcs_71_1}, - {2, arcs_71_2}, - {2, arcs_71_3}, - {1, arcs_71_4}, - {1, arcs_71_5}, - {1, arcs_71_6}, - {1, arcs_71_7}, -}; -static arc arcs_72_0[3] = { - {157, 1}, - {29, 2}, - {30, 3}, -}; -static arc arcs_72_1[2] = { - {28, 4}, - {0, 1}, -}; -static arc arcs_72_2[1] = { - {22, 5}, -}; -static arc arcs_72_3[1] = { - {22, 6}, -}; -static arc arcs_72_4[4] = { - {157, 1}, - {29, 2}, - {30, 3}, - {0, 4}, -}; -static arc arcs_72_5[2] = { - {28, 7}, - {0, 5}, -}; static arc arcs_72_6[1] = { - {0, 6}, + {25, 4}, }; static arc arcs_72_7[1] = { - {30, 3}, + {0, 7}, }; static state states_72[8] = { - {3, arcs_72_0}, - {2, arcs_72_1}, - {1, arcs_72_2}, - {1, arcs_72_3}, - {4, arcs_72_4}, - {2, arcs_72_5}, + {1, arcs_72_0}, + {1, arcs_72_1}, + {2, arcs_72_2}, + {2, arcs_72_3}, + {1, arcs_72_4}, + {1, arcs_72_5}, {1, arcs_72_6}, {1, arcs_72_7}, }; -static arc arcs_73_0[1] = { - {22, 1}, +static arc arcs_73_0[3] = { + {158, 1}, + {31, 2}, + {32, 3}, }; -static arc arcs_73_1[3] = { - {152, 2}, - {27, 3}, +static arc arcs_73_1[2] = { + {30, 4}, {0, 1}, }; static arc arcs_73_2[1] = { - {0, 2}, + {24, 5}, }; static arc arcs_73_3[1] = { - {22, 2}, + {24, 6}, +}; +static arc arcs_73_4[4] = { + {158, 1}, + {31, 2}, + {32, 3}, + {0, 4}, +}; +static arc arcs_73_5[2] = { + {30, 7}, + {0, 5}, +}; +static arc arcs_73_6[1] = { + {0, 6}, }; -static state states_73[4] = { - {1, arcs_73_0}, - {3, arcs_73_1}, +static arc arcs_73_7[1] = { + {32, 3}, +}; +static state states_73[8] = { + {3, arcs_73_0}, + {2, arcs_73_1}, {1, arcs_73_2}, {1, arcs_73_3}, + {4, arcs_73_4}, + {2, arcs_73_5}, + {1, arcs_73_6}, + {1, arcs_73_7}, }; -static arc arcs_74_0[2] = { - {152, 1}, - {159, 1}, +static arc arcs_74_0[1] = { + {24, 1}, }; -static arc arcs_74_1[1] = { +static arc arcs_74_1[3] = { + {153, 2}, + {29, 3}, {0, 1}, }; -static state states_74[2] = { - {2, arcs_74_0}, - {1, arcs_74_1}, -}; -static arc arcs_75_0[1] = { - {93, 1}, -}; -static arc arcs_75_1[1] = { - {58, 2}, +static arc arcs_74_2[1] = { + {0, 2}, }; -static arc arcs_75_2[1] = { - {94, 3}, +static arc arcs_74_3[1] = { + {24, 2}, }; -static arc arcs_75_3[1] = { - {104, 4}, +static state states_74[4] = { + {1, arcs_74_0}, + {3, arcs_74_1}, + {1, arcs_74_2}, + {1, arcs_74_3}, }; -static arc arcs_75_4[2] = { - {158, 5}, - {0, 4}, +static arc arcs_75_0[2] = { + {153, 1}, + {160, 1}, }; -static arc arcs_75_5[1] = { - {0, 5}, +static arc arcs_75_1[1] = { + {0, 1}, }; -static state states_75[6] = { - {1, arcs_75_0}, +static state states_75[2] = { + {2, arcs_75_0}, {1, arcs_75_1}, - {1, arcs_75_2}, - {1, arcs_75_3}, - {2, arcs_75_4}, - {1, arcs_75_5}, }; static arc arcs_76_0[1] = { - {89, 1}, + {94, 1}, }; static arc arcs_76_1[1] = { - {106, 2}, + {60, 2}, }; -static arc arcs_76_2[2] = { - {158, 3}, - {0, 2}, +static arc arcs_76_2[1] = { + {95, 3}, }; static arc arcs_76_3[1] = { - {0, 3}, + {105, 4}, +}; +static arc arcs_76_4[2] = { + {159, 5}, + {0, 4}, }; -static state states_76[4] = { +static arc arcs_76_5[1] = { + {0, 5}, +}; +static state states_76[6] = { {1, arcs_76_0}, {1, arcs_76_1}, - {2, arcs_76_2}, + {1, arcs_76_2}, {1, arcs_76_3}, + {2, arcs_76_4}, + {1, arcs_76_5}, }; static arc arcs_77_0[1] = { - {22, 1}, + {90, 1}, }; -static arc arcs_77_1[2] = { - {28, 0}, - {0, 1}, +static arc arcs_77_1[1] = { + {107, 2}, }; -static state states_77[2] = { +static arc arcs_77_2[2] = { + {159, 3}, + {0, 2}, +}; +static arc arcs_77_3[1] = { + {0, 3}, +}; +static state states_77[4] = { {1, arcs_77_0}, - {2, arcs_77_1}, + {1, arcs_77_1}, + {2, arcs_77_2}, + {1, arcs_77_3}, }; static arc arcs_78_0[1] = { - {19, 1}, + {24, 1}, }; -static arc arcs_78_1[1] = { +static arc arcs_78_1[2] = { + {30, 0}, {0, 1}, }; static state states_78[2] = { {1, arcs_78_0}, - {1, arcs_78_1}, + {2, arcs_78_1}, }; static arc arcs_79_0[1] = { - {162, 1}, + {21, 1}, +}; +static arc arcs_79_1[1] = { + {0, 1}, +}; +static state states_79[2] = { + {1, arcs_79_0}, + {1, arcs_79_1}, +}; +static arc arcs_80_0[1] = { + {163, 1}, }; -static arc arcs_79_1[2] = { +static arc arcs_80_1[2] = { {9, 2}, {0, 1}, }; -static arc arcs_79_2[1] = { +static arc arcs_80_2[1] = { {0, 2}, }; -static state states_79[3] = { - {1, arcs_79_0}, - {2, arcs_79_1}, - {1, arcs_79_2}, +static state states_80[3] = { + {1, arcs_80_0}, + {2, arcs_80_1}, + {1, arcs_80_2}, }; -static dfa dfas[80] = { +static dfa dfas[81] = { {256, "single_input", 0, 3, states_0, - "\004\050\014\040\000\000\000\012\236\012\007\262\004\020\002\000\300\020\312\020\004"}, + "\004\050\060\200\000\000\000\050\170\052\034\144\011\040\004\000\200\041\224\041\010"}, {257, "file_input", 0, 2, states_1, - "\204\050\014\040\000\000\000\012\236\012\007\262\004\020\002\000\300\020\312\020\004"}, + "\204\050\060\200\000\000\000\050\170\052\034\144\011\040\004\000\200\041\224\041\010"}, {258, "eval_input", 0, 3, states_2, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, {259, "decorator", 0, 7, states_3, "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {260, "decorators", 0, 2, states_4, "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {261, "funcdef", 0, 9, states_5, - "\000\010\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {262, "parameters", 0, 4, states_6, + {261, "decorated", 0, 3, states_5, + "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {262, "funcdef", 0, 8, states_6, + "\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {263, "parameters", 0, 4, states_7, "\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {263, "typedargslist", 0, 12, states_7, - "\000\000\010\140\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {264, "tfpdef", 0, 4, states_8, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {265, "varargslist", 0, 12, states_9, - "\000\000\010\140\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {266, "vfpdef", 0, 2, states_10, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {267, "stmt", 0, 2, states_11, - "\000\050\014\040\000\000\000\012\236\012\007\262\004\020\002\000\300\020\312\020\004"}, - {268, "simple_stmt", 0, 4, states_12, - "\000\040\010\040\000\000\000\012\236\012\007\000\000\020\002\000\300\020\312\000\004"}, - {269, "small_stmt", 0, 2, states_13, - "\000\040\010\040\000\000\000\012\236\012\007\000\000\020\002\000\300\020\312\000\004"}, - {270, "expr_stmt", 0, 6, states_14, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {271, "augassign", 0, 2, states_15, - "\000\000\000\000\000\340\377\001\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {272, "del_stmt", 0, 3, states_16, - "\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {273, "pass_stmt", 0, 2, states_17, + {264, "typedargslist", 0, 12, states_8, + "\000\000\040\200\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {265, "tfpdef", 0, 4, states_9, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {266, "varargslist", 0, 12, states_10, + "\000\000\040\200\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {267, "vfpdef", 0, 2, states_11, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {268, "stmt", 0, 2, states_12, + "\000\050\060\200\000\000\000\050\170\052\034\144\011\040\004\000\200\041\224\041\010"}, + {269, "simple_stmt", 0, 4, states_13, + "\000\040\040\200\000\000\000\050\170\052\034\000\000\040\004\000\200\041\224\001\010"}, + {270, "small_stmt", 0, 2, states_14, + "\000\040\040\200\000\000\000\050\170\052\034\000\000\040\004\000\200\041\224\001\010"}, + {271, "expr_stmt", 0, 6, states_15, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {272, "augassign", 0, 2, states_16, + "\000\000\000\000\000\200\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {273, "del_stmt", 0, 3, states_17, "\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {274, "flow_stmt", 0, 2, states_18, - "\000\000\000\000\000\000\000\000\036\000\000\000\000\000\000\000\000\000\000\000\004"}, - {275, "break_stmt", 0, 2, states_19, - "\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000"}, - {276, "continue_stmt", 0, 2, states_20, - "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"}, - {277, "return_stmt", 0, 3, states_21, + {274, "pass_stmt", 0, 2, states_18, + "\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {275, "flow_stmt", 0, 2, states_19, + "\000\000\000\000\000\000\000\000\170\000\000\000\000\000\000\000\000\000\000\000\010"}, + {276, "break_stmt", 0, 2, states_20, "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000"}, - {278, "yield_stmt", 0, 2, states_22, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"}, - {279, "raise_stmt", 0, 7, states_23, + {277, "continue_stmt", 0, 2, states_21, "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"}, - {280, "import_stmt", 0, 2, states_24, - "\000\000\000\000\000\000\000\000\200\002\000\000\000\000\000\000\000\000\000\000\000"}, - {281, "import_name", 0, 3, states_25, - "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000"}, - {282, "import_from", 0, 8, states_26, + {278, "return_stmt", 0, 3, states_22, + "\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"}, + {279, "yield_stmt", 0, 2, states_23, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"}, + {280, "raise_stmt", 0, 7, states_24, + "\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000\000"}, + {281, "import_stmt", 0, 2, states_25, + "\000\000\000\000\000\000\000\000\000\012\000\000\000\000\000\000\000\000\000\000\000"}, + {282, "import_name", 0, 3, states_26, "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000"}, - {283, "import_as_name", 0, 4, states_27, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {284, "dotted_as_name", 0, 4, states_28, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {285, "import_as_names", 0, 3, states_29, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {286, "dotted_as_names", 0, 2, states_30, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {287, "dotted_name", 0, 2, states_31, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {288, "global_stmt", 0, 3, states_32, - "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"}, - {289, "nonlocal_stmt", 0, 3, states_33, - "\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000"}, - {290, "assert_stmt", 0, 5, states_34, + {283, "import_from", 0, 8, states_27, + "\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000"}, + {284, "import_as_name", 0, 4, states_28, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {285, "dotted_as_name", 0, 4, states_29, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {286, "import_as_names", 0, 3, states_30, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {287, "dotted_as_names", 0, 2, states_31, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {288, "dotted_name", 0, 2, states_32, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {289, "global_stmt", 0, 3, states_33, "\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000"}, - {291, "compound_stmt", 0, 2, states_35, - "\000\010\004\000\000\000\000\000\000\000\000\262\004\000\000\000\000\000\000\020\000"}, - {292, "if_stmt", 0, 8, states_36, - "\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, - {293, "while_stmt", 0, 8, states_37, - "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"}, - {294, "for_stmt", 0, 10, states_38, - "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"}, - {295, "try_stmt", 0, 13, states_39, - "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"}, - {296, "with_stmt", 0, 6, states_40, - "\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000"}, - {297, "with_var", 0, 3, states_41, - "\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000\000"}, - {298, "except_clause", 0, 5, states_42, - "\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"}, - {299, "suite", 0, 5, states_43, - "\004\040\010\040\000\000\000\012\236\012\007\000\000\020\002\000\300\020\312\000\004"}, - {300, "test", 0, 6, states_44, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {301, "test_nocond", 0, 2, states_45, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {302, "lambdef", 0, 5, states_46, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000"}, - {303, "lambdef_nocond", 0, 5, states_47, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000"}, - {304, "or_test", 0, 2, states_48, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\002\000\300\020\312\000\000"}, - {305, "and_test", 0, 2, states_49, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\002\000\300\020\312\000\000"}, - {306, "not_test", 0, 3, states_50, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\002\000\300\020\312\000\000"}, - {307, "comparison", 0, 2, states_51, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {308, "comp_op", 0, 4, states_52, - "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\342\017\000\000\000\000\000"}, - {309, "star_expr", 0, 3, states_53, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {310, "expr", 0, 2, states_54, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {311, "xor_expr", 0, 2, states_55, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {312, "and_expr", 0, 2, states_56, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {313, "shift_expr", 0, 2, states_57, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {314, "arith_expr", 0, 2, states_58, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {315, "term", 0, 2, states_59, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {316, "factor", 0, 3, states_60, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {317, "power", 0, 4, states_61, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\312\000\000"}, - {318, "atom", 0, 9, states_62, - "\000\040\010\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\312\000\000"}, - {319, "testlist_comp", 0, 5, states_63, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {320, "trailer", 0, 7, states_64, - "\000\040\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\002\000\000"}, - {321, "subscriptlist", 0, 3, states_65, - "\000\040\210\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {322, "subscript", 0, 5, states_66, - "\000\040\210\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {323, "sliceop", 0, 3, states_67, - "\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {324, "exprlist", 0, 3, states_68, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\000\000\000\300\020\312\000\000"}, - {325, "testlist", 0, 3, states_69, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {326, "dictorsetmaker", 0, 9, states_70, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {327, "classdef", 0, 8, states_71, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000"}, - {328, "arglist", 0, 8, states_72, - "\000\040\010\140\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {329, "argument", 0, 4, states_73, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {330, "comp_iter", 0, 2, states_74, - "\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"}, - {331, "comp_for", 0, 6, states_75, + {290, "nonlocal_stmt", 0, 3, states_34, + "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000"}, + {291, "assert_stmt", 0, 5, states_35, + "\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"}, + {292, "compound_stmt", 0, 2, states_36, + "\000\010\020\000\000\000\000\000\000\000\000\144\011\000\000\000\000\000\000\040\000"}, + {293, "if_stmt", 0, 8, states_37, + "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"}, + {294, "while_stmt", 0, 8, states_38, "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"}, - {332, "comp_if", 0, 4, states_76, - "\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, - {333, "testlist1", 0, 2, states_77, - "\000\040\010\040\000\000\000\000\000\010\000\000\000\020\002\000\300\020\312\000\000"}, - {334, "encoding_decl", 0, 2, states_78, - "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, - {335, "yield_expr", 0, 3, states_79, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"}, -}; -static label labels[163] = { + {295, "for_stmt", 0, 10, states_39, + "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, + {296, "try_stmt", 0, 13, states_40, + "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"}, + {297, "with_stmt", 0, 6, states_41, + "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"}, + {298, "with_var", 0, 3, states_42, + "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"}, + {299, "except_clause", 0, 5, states_43, + "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000"}, + {300, "suite", 0, 5, states_44, + "\004\040\040\200\000\000\000\050\170\052\034\000\000\040\004\000\200\041\224\001\010"}, + {301, "test", 0, 6, states_45, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {302, "test_nocond", 0, 2, states_46, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {303, "lambdef", 0, 5, states_47, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000"}, + {304, "lambdef_nocond", 0, 5, states_48, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000"}, + {305, "or_test", 0, 2, states_49, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\200\041\224\001\000"}, + {306, "and_test", 0, 2, states_50, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\200\041\224\001\000"}, + {307, "not_test", 0, 3, states_51, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\004\000\200\041\224\001\000"}, + {308, "comparison", 0, 2, states_52, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {309, "comp_op", 0, 4, states_53, + "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\304\037\000\000\000\000\000"}, + {310, "star_expr", 0, 3, states_54, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {311, "expr", 0, 2, states_55, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {312, "xor_expr", 0, 2, states_56, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {313, "and_expr", 0, 2, states_57, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {314, "shift_expr", 0, 2, states_58, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {315, "arith_expr", 0, 2, states_59, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {316, "term", 0, 2, states_60, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {317, "factor", 0, 3, states_61, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {318, "power", 0, 4, states_62, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\224\001\000"}, + {319, "atom", 0, 9, states_63, + "\000\040\040\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\224\001\000"}, + {320, "testlist_comp", 0, 5, states_64, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {321, "trailer", 0, 7, states_65, + "\000\040\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\004\000\000"}, + {322, "subscriptlist", 0, 3, states_66, + "\000\040\040\202\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {323, "subscript", 0, 5, states_67, + "\000\040\040\202\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {324, "sliceop", 0, 3, states_68, + "\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {325, "exprlist", 0, 3, states_69, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\000\000\000\200\041\224\001\000"}, + {326, "testlist", 0, 3, states_70, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {327, "dictorsetmaker", 0, 9, states_71, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {328, "classdef", 0, 8, states_72, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\040\000"}, + {329, "arglist", 0, 8, states_73, + "\000\040\040\200\001\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {330, "argument", 0, 4, states_74, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {331, "comp_iter", 0, 2, states_75, + "\000\000\000\000\000\000\000\000\000\000\000\104\000\000\000\000\000\000\000\000\000"}, + {332, "comp_for", 0, 6, states_76, + "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, + {333, "comp_if", 0, 4, states_77, + "\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000"}, + {334, "testlist1", 0, 2, states_78, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\200\041\224\001\000"}, + {335, "encoding_decl", 0, 2, states_79, + "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, + {336, "yield_expr", 0, 3, states_80, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"}, +}; +static label labels[164] = { {0, "EMPTY"}, {256, 0}, {4, 0}, - {268, 0}, - {291, 0}, + {269, 0}, + {292, 0}, {257, 0}, - {267, 0}, + {268, 0}, {0, 0}, {258, 0}, - {325, 0}, + {326, 0}, {259, 0}, {50, 0}, - {287, 0}, + {288, 0}, {7, 0}, - {328, 0}, + {329, 0}, {8, 0}, {260, 0}, {261, 0}, + {328, 0}, + {262, 0}, {1, "def"}, {1, 0}, - {262, 0}, + {263, 0}, {51, 0}, - {300, 0}, + {301, 0}, {11, 0}, - {299, 0}, - {263, 0}, + {300, 0}, {264, 0}, + {265, 0}, {22, 0}, {12, 0}, {16, 0}, {36, 0}, - {265, 0}, {266, 0}, - {269, 0}, - {13, 0}, + {267, 0}, {270, 0}, - {272, 0}, + {13, 0}, + {271, 0}, {273, 0}, {274, 0}, - {280, 0}, - {288, 0}, + {275, 0}, + {281, 0}, {289, 0}, {290, 0}, - {271, 0}, - {335, 0}, + {291, 0}, + {272, 0}, + {336, 0}, {37, 0}, {38, 0}, {39, 0}, @@ -1928,37 +1943,36 @@ static label labels[163] = { {47, 0}, {49, 0}, {1, "del"}, - {324, 0}, + {325, 0}, {1, "pass"}, - {275, 0}, {276, 0}, {277, 0}, - {279, 0}, {278, 0}, + {280, 0}, + {279, 0}, {1, "break"}, {1, "continue"}, {1, "return"}, {1, "raise"}, - {281, 0}, {282, 0}, + {283, 0}, {1, "import"}, - {286, 0}, + {287, 0}, {1, "from"}, {23, 0}, {52, 0}, - {285, 0}, - {283, 0}, - {1, "as"}, + {286, 0}, {284, 0}, + {1, "as"}, + {285, 0}, {1, "global"}, {1, "nonlocal"}, {1, "assert"}, - {292, 0}, {293, 0}, {294, 0}, {295, 0}, {296, 0}, - {327, 0}, + {297, 0}, {1, "if"}, {1, "elif"}, {1, "else"}, @@ -1966,27 +1980,27 @@ static label labels[163] = { {1, "for"}, {1, "in"}, {1, "try"}, - {298, 0}, + {299, 0}, {1, "finally"}, {1, "with"}, - {297, 0}, - {310, 0}, + {298, 0}, + {311, 0}, {1, "except"}, {5, 0}, {6, 0}, - {304, 0}, - {302, 0}, - {301, 0}, + {305, 0}, {303, 0}, + {302, 0}, + {304, 0}, {1, "lambda"}, - {305, 0}, - {1, "or"}, {306, 0}, + {1, "or"}, + {307, 0}, {1, "and"}, {1, "not"}, - {307, 0}, - {309, 0}, {308, 0}, + {310, 0}, + {309, 0}, {20, 0}, {21, 0}, {28, 0}, @@ -1994,49 +2008,49 @@ static label labels[163] = { {30, 0}, {29, 0}, {1, "is"}, - {311, 0}, - {18, 0}, {312, 0}, - {33, 0}, + {18, 0}, {313, 0}, - {19, 0}, + {33, 0}, {314, 0}, + {19, 0}, + {315, 0}, {34, 0}, {35, 0}, - {315, 0}, + {316, 0}, {14, 0}, {15, 0}, - {316, 0}, + {317, 0}, {17, 0}, {24, 0}, {48, 0}, {32, 0}, - {317, 0}, {318, 0}, - {320, 0}, {319, 0}, + {321, 0}, + {320, 0}, {9, 0}, {10, 0}, {26, 0}, - {326, 0}, + {327, 0}, {27, 0}, {2, 0}, {3, 0}, - {331, 0}, - {321, 0}, + {332, 0}, {322, 0}, {323, 0}, + {324, 0}, {1, "class"}, - {329, 0}, {330, 0}, - {332, 0}, + {331, 0}, {333, 0}, {334, 0}, + {335, 0}, {1, "yield"}, }; grammar _PyParser_Grammar = { - 80, + 81, dfas, - {163, labels}, + {164, labels}, 256 }; diff --git a/Python/marshal.c b/Python/marshal.c index d00ac8d..262c185 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -15,7 +15,7 @@ * and risks coring the interpreter. When the object stack gets this deep, * raise an exception instead of continuing. */ -#define MAX_MARSHAL_STACK_DEPTH 5000 +#define MAX_MARSHAL_STACK_DEPTH 2000 #define TYPE_NULL '0' #define TYPE_NONE 'N' @@ -235,9 +235,16 @@ w_object(PyObject *v, WFILE *p) goto exit; } else { + int ok; o = PyInt_FromSsize_t(PyDict_Size(p->strings)); - PyDict_SetItem(p->strings, v, o); - Py_DECREF(o); + ok = o && + PyDict_SetItem(p->strings, v, o) >= 0; + Py_XDECREF(o); + if (!ok) { + p->depth--; + p->error = 1; + return; + } w_byte(TYPE_INTERNED, p); } } @@ -401,7 +408,7 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version) typedef WFILE RFILE; /* Same struct with different invariants */ -#define rs_byte(p) (((p)->ptr != (p)->end) ? (unsigned char)*(p)->ptr++ : EOF) +#define rs_byte(p) (((p)->ptr < (p)->end) ? (unsigned char)*(p)->ptr++ : EOF) #define r_byte(p) ((p)->fp ? getc((p)->fp) : rs_byte(p)) @@ -492,42 +499,60 @@ r_object(RFILE *p) PyObject *v, *v2, *v3; long i, n; int type = r_byte(p); + PyObject *retval; + + p->depth++; + + if (p->depth > MAX_MARSHAL_STACK_DEPTH) { + p->depth--; + PyErr_SetString(PyExc_ValueError, "recursion limit exceeded"); + return NULL; + } switch (type) { case EOF: PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; case TYPE_NULL: - return NULL; + retval = NULL; + break; case TYPE_NONE: Py_INCREF(Py_None); - return Py_None; + retval = Py_None; + break; case TYPE_STOPITER: Py_INCREF(PyExc_StopIteration); - return PyExc_StopIteration; + retval = PyExc_StopIteration; + break; case TYPE_ELLIPSIS: Py_INCREF(Py_Ellipsis); - return Py_Ellipsis; + retval = Py_Ellipsis; + break; case TYPE_FALSE: Py_INCREF(Py_False); - return Py_False; + retval = Py_False; + break; case TYPE_TRUE: Py_INCREF(Py_True); - return Py_True; + retval = Py_True; + break; case TYPE_INT: - return PyInt_FromLong(r_long(p)); + retval = PyInt_FromLong(r_long(p)); + break; case TYPE_INT64: - return r_long64(p); + retval = r_long64(p); + break; case TYPE_LONG: { @@ -537,12 +562,15 @@ r_object(RFILE *p) if (n < -INT_MAX || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } size = n<0 ? -n : n; ob = _PyLong_New(size); - if (ob == NULL) - return NULL; + if (ob == NULL) { + retval = NULL; + break; + } ob->ob_size = n; for (i = 0; i < size; i++) { int digit = r_short(p); @@ -550,11 +578,14 @@ r_object(RFILE *p) Py_DECREF(ob); PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + ob = NULL; + break; } - ob->ob_digit[i] = digit; + if (ob != NULL) + ob->ob_digit[i] = digit; } - return (PyObject *)ob; + retval = (PyObject *)ob; + break; } case TYPE_FLOAT: @@ -565,13 +596,16 @@ r_object(RFILE *p) if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } buf[n] = '\0'; - PyFPE_START_PROTECT("atof", return 0) + retval = NULL; + PyFPE_START_PROTECT("atof", break) dx = PyOS_ascii_atof(buf); PyFPE_END_PROTECT(dx) - return PyFloat_FromDouble(dx); + retval = PyFloat_FromDouble(dx); + break; } case TYPE_BINARY_FLOAT: @@ -581,13 +615,16 @@ r_object(RFILE *p) if (r_string((char*)buf, 8, p) != 8) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } x = _PyFloat_Unpack8(buf, 1); if (x == -1.0 && PyErr_Occurred()) { - return NULL; + retval = NULL; + break; } - return PyFloat_FromDouble(x); + retval = PyFloat_FromDouble(x); + break; } #ifndef WITHOUT_COMPLEX @@ -599,23 +636,27 @@ r_object(RFILE *p) if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } buf[n] = '\0'; - PyFPE_START_PROTECT("atof", return 0) + retval = NULL; + PyFPE_START_PROTECT("atof", break;) c.real = PyOS_ascii_atof(buf); PyFPE_END_PROTECT(c) n = r_byte(p); if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } buf[n] = '\0'; - PyFPE_START_PROTECT("atof", return 0) + PyFPE_START_PROTECT("atof", break) c.imag = PyOS_ascii_atof(buf); PyFPE_END_PROTECT(c) - return PyComplex_FromCComplex(c); + retval = PyComplex_FromCComplex(c); + break; } case TYPE_BINARY_COMPLEX: @@ -625,22 +666,27 @@ r_object(RFILE *p) if (r_string((char*)buf, 8, p) != 8) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } c.real = _PyFloat_Unpack8(buf, 1); if (c.real == -1.0 && PyErr_Occurred()) { - return NULL; + retval = NULL; + break; } if (r_string((char*)buf, 8, p) != 8) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } c.imag = _PyFloat_Unpack8(buf, 1); if (c.imag == -1.0 && PyErr_Occurred()) { - return NULL; + retval = NULL; + break; } - return PyComplex_FromCComplex(c); + retval = PyComplex_FromCComplex(c); + break; } #endif @@ -649,32 +695,42 @@ r_object(RFILE *p) n = r_long(p); if (n < 0 || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } v = PyString_FromStringAndSize((char *)NULL, n); - if (v == NULL) - return v; + if (v == NULL) { + retval = NULL; + break; + } if (r_string(PyString_AS_STRING(v), (int)n, p) != n) { Py_DECREF(v); PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } if (type == TYPE_INTERNED) { PyString_InternInPlace(&v); - PyList_Append(p->strings, v); + if (PyList_Append(p->strings, v) < 0) { + retval = NULL; + break; + } } - return v; + retval = v; + break; case TYPE_STRINGREF: n = r_long(p); if (n < 0 || n >= PyList_GET_SIZE(p->strings)) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } v = PyList_GET_ITEM(p->strings, n); Py_INCREF(v); - return v; + retval = v; + break; case TYPE_UNICODE: { @@ -683,31 +739,39 @@ r_object(RFILE *p) n = r_long(p); if (n < 0 || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } buffer = PyMem_NEW(char, n); - if (buffer == NULL) - return PyErr_NoMemory(); + if (buffer == NULL) { + retval = PyErr_NoMemory(); + break; + } if (r_string(buffer, (int)n, p) != n) { PyMem_DEL(buffer); PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - return NULL; + retval = NULL; + break; } v = PyUnicode_DecodeUTF8(buffer, n, NULL); PyMem_DEL(buffer); - return v; + retval = v; + break; } case TYPE_TUPLE: n = r_long(p); if (n < 0 || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } v = PyTuple_New((int)n); - if (v == NULL) - return v; + if (v == NULL) { + retval = NULL; + break; + } for (i = 0; i < n; i++) { v2 = r_object(p); if ( v2 == NULL ) { @@ -720,17 +784,21 @@ r_object(RFILE *p) } PyTuple_SET_ITEM(v, (int)i, v2); } - return v; + retval = v; + break; case TYPE_LIST: n = r_long(p); if (n < 0 || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } v = PyList_New((int)n); - if (v == NULL) - return v; + if (v == NULL) { + retval = NULL; + break; + } for (i = 0; i < n; i++) { v2 = r_object(p); if ( v2 == NULL ) { @@ -741,14 +809,17 @@ r_object(RFILE *p) v = NULL; break; } - PyList_SetItem(v, (int)i, v2); + PyList_SET_ITEM(v, (int)i, v2); } - return v; + retval = v; + break; case TYPE_DICT: v = PyDict_New(); - if (v == NULL) - return NULL; + if (v == NULL) { + retval = NULL; + break; + } for (;;) { PyObject *key, *val; key = r_object(p); @@ -764,18 +835,22 @@ r_object(RFILE *p) Py_DECREF(v); v = NULL; } - return v; + retval = v; + break; case TYPE_SET: case TYPE_FROZENSET: n = r_long(p); - if (n < 0) { + if (n < 0 || n > INT_MAX) { PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } v = PyTuple_New((int)n); - if (v == NULL) - return v; + if (v == NULL) { + retval = NULL; + break; + } for (i = 0; i < n; i++) { v2 = r_object(p); if ( v2 == NULL ) { @@ -788,14 +863,17 @@ r_object(RFILE *p) } PyTuple_SET_ITEM(v, (int)i, v2); } - if (v == NULL) - return v; + if (v == NULL) { + retval = NULL; + break; + } if (type == TYPE_SET) v3 = PySet_New(v); else v3 = PyFrozenSet_New(v); Py_DECREF(v); - return v3; + retval = v3; + break; case TYPE_CODE: { @@ -872,14 +950,19 @@ r_object(RFILE *p) return v; } + retval = v; + break; default: /* Bogus data got written, which isn't ideal. This will let you keep working and recover. */ PyErr_SetString(PyExc_ValueError, "bad marshal data"); - return NULL; + retval = NULL; + break; } + p->depth--; + return retval; } static PyObject * @@ -985,6 +1068,7 @@ PyMarshal_ReadObjectFromFile(FILE *fp) PyObject *result; rf.fp = fp; rf.strings = PyList_New(0); + rf.depth = 0; result = r_object(&rf); Py_DECREF(rf.strings); return result; @@ -999,6 +1083,7 @@ PyMarshal_ReadObjectFromString(char *str, Py_ssize_t len) rf.ptr = str; rf.end = str + len; rf.strings = PyList_New(0); + rf.depth = 0; result = r_object(&rf); Py_DECREF(rf.strings); return result; @@ -1125,6 +1210,7 @@ marshal_load(PyObject *self, PyObject *f) } rf.fp = PyFile_AsFile(f); rf.strings = PyList_New(0); + rf.depth = 0; result = read_object(&rf); Py_DECREF(rf.strings); return result; @@ -1153,6 +1239,7 @@ marshal_loads(PyObject *self, PyObject *args) rf.ptr = s; rf.end = s + n; rf.strings = PyList_New(0); + rf.depth = 0; result = read_object(&rf); Py_DECREF(rf.strings); return result; diff --git a/Python/symtable.c b/Python/symtable.c index 58f673e..f3a2c78 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1009,8 +1009,8 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) s->v.FunctionDef.args->kw_defaults); if (!symtable_visit_annotations(st, s)) return 0; - if (s->v.FunctionDef.decorators) - VISIT_SEQ(st, expr, s->v.FunctionDef.decorators); + if (s->v.FunctionDef.decorator_list) + VISIT_SEQ(st, expr, s->v.FunctionDef.decorator_list); if (!symtable_enter_block(st, s->v.FunctionDef.name, FunctionBlock, (void *)s, s->lineno)) return 0; @@ -1029,6 +1029,8 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) VISIT(st, expr, s->v.ClassDef.starargs); if (s->v.ClassDef.kwargs) VISIT(st, expr, s->v.ClassDef.kwargs); + if (s->v.ClassDef.decorator_list) + VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list); if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock, (void *)s, s->lineno)) return 0; |