summaryrefslogtreecommitdiff
path: root/Modules/parsermodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r--Modules/parsermodule.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 249fc1a73d..f170c51b2e 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -867,7 +867,8 @@ VALIDATER(while); VALIDATER(for);
VALIDATER(try); VALIDATER(except_clause);
VALIDATER(test); VALIDATER(and_test);
VALIDATER(not_test); VALIDATER(comparison);
-VALIDATER(comp_op); VALIDATER(expr);
+VALIDATER(comp_op);
+VALIDATER(star_expr); VALIDATER(expr);
VALIDATER(xor_expr); VALIDATER(and_expr);
VALIDATER(shift_expr); VALIDATER(arith_expr);
VALIDATER(term); VALIDATER(factor);
@@ -2094,11 +2095,11 @@ validate_comparison(node *tree)
int nch = NCH(tree);
int res = (validate_ntype(tree, comparison)
&& is_odd(nch)
- && validate_expr(CHILD(tree, 0)));
+ && validate_star_expr(CHILD(tree, 0)));
for (pos = 1; res && (pos < nch); pos += 2)
res = (validate_comp_op(CHILD(tree, pos))
- && validate_expr(CHILD(tree, pos + 1)));
+ && validate_star_expr(CHILD(tree, pos + 1)));
return (res);
}
@@ -2156,6 +2157,20 @@ validate_comp_op(node *tree)
static int
+validate_star_expr(node *tree)
+{
+ int res = validate_ntype(tree, star_expr);
+ if (!res) return res;
+ if (NCH(tree) == 2) {
+ return validate_ntype(CHILD(tree, 0), STAR) && \
+ validate_expr(CHILD(tree, 1));
+ } else {
+ return validate_expr(CHILD(tree, 0));
+ }
+}
+
+
+static int
validate_expr(node *tree)
{
int j;
@@ -2745,7 +2760,7 @@ static int
validate_exprlist(node *tree)
{
return (validate_repeating_list(tree, exprlist,
- validate_expr, "exprlist"));
+ validate_star_expr, "exprlist"));
}