mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Teach the parsermodule about floor division. Fixes
[ 676521 ] parser module validation failure bugfix candidate.
This commit is contained in:
parent
090da4b626
commit
5e83b7a9cc
2 changed files with 7 additions and 0 deletions
|
@ -1440,6 +1440,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
|
||||
|
@ -2095,6 +2096,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)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue