]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport:
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 2 Feb 2003 19:34:14 +0000 (19:34 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 2 Feb 2003 19:34:14 +0000 (19:34 +0000)
revision 2.75
date: 2003/01/29 14:20:22;  author: mwh;  state: Exp;  lines: +2 -0
Teach the parsermodule about floor division.  Fixes

[ 676521 ] parser module validation failure

Modules/parsermodule.c

index ca0531d6b0f6b53eddc69f12817b47811d706b31..20db86e1fe2a221c2beb7f20331eadbd74f45733 100644 (file)
@@ -1438,6 +1438,7 @@ validate_expr_stmt(node *tree)
                    || strcmp(s, "-=") == 0
                    || strcmp(s, "*=") == 0
                    || strcmp(s, "/=") == 0
+                   || strcmp(s, "//=") == 0
                    || strcmp(s, "%=") == 0
                    || strcmp(s, "&=") == 0
                    || strcmp(s, "|=") == 0
@@ -2093,6 +2094,7 @@ validate_term(node *tree)
     for ( ; res && (pos < nch); pos += 2)
         res = (((TYPE(CHILD(tree, pos)) == STAR)
                || (TYPE(CHILD(tree, pos)) == SLASH)
+               || (TYPE(CHILD(tree, pos)) == DOUBLESLASH)
                || (TYPE(CHILD(tree, pos)) == PERCENT))
                && validate_factor(CHILD(tree, pos + 1)));