@@ -857,7 +857,7 @@ VALIDATER(testlist); VALIDATER(varargslist);
857857VALIDATER (vfpdef ); VALIDATER (vfplist );
858858VALIDATER (stmt ); VALIDATER (simple_stmt );
859859VALIDATER (expr_stmt ); VALIDATER (power );
860- VALIDATER (print_stmt ); VALIDATER ( del_stmt );
860+ VALIDATER (del_stmt );
861861VALIDATER (return_stmt ); VALIDATER (list_iter );
862862VALIDATER (raise_stmt ); VALIDATER (import_stmt );
863863VALIDATER (import_name ); VALIDATER (import_from );
@@ -1545,7 +1545,6 @@ validate_small_stmt(node *tree)
15451545 int ntype = TYPE (CHILD (tree , 0 ));
15461546
15471547 if ( (ntype == expr_stmt )
1548- || (ntype == print_stmt )
15491548 || (ntype == del_stmt )
15501549 || (ntype == pass_stmt )
15511550 || (ntype == flow_stmt )
@@ -1650,54 +1649,6 @@ validate_expr_stmt(node *tree)
16501649}
16511650
16521651
1653- /* print_stmt:
1654- *
1655- * 'print' ( [ test (',' test)* [','] ]
1656- * | '>>' test [ (',' test)+ [','] ] )
1657- */
1658- static int
1659- validate_print_stmt (node * tree )
1660- {
1661- int nch = NCH (tree );
1662- int res = (validate_ntype (tree , print_stmt )
1663- && (nch > 0 )
1664- && validate_name (CHILD (tree , 0 ), "print" ));
1665-
1666- if (res && nch > 1 ) {
1667- int sym = TYPE (CHILD (tree , 1 ));
1668- int i = 1 ;
1669- int allow_trailing_comma = 1 ;
1670-
1671- if (sym == test )
1672- res = validate_test (CHILD (tree , i ++ ));
1673- else {
1674- if (nch < 3 )
1675- res = validate_numnodes (tree , 3 , "print_stmt" );
1676- else {
1677- res = (validate_ntype (CHILD (tree , i ), RIGHTSHIFT )
1678- && validate_test (CHILD (tree , i + 1 )));
1679- i += 2 ;
1680- allow_trailing_comma = 0 ;
1681- }
1682- }
1683- if (res ) {
1684- /* ... (',' test)* [','] */
1685- while (res && i + 2 <= nch ) {
1686- res = (validate_comma (CHILD (tree , i ))
1687- && validate_test (CHILD (tree , i + 1 )));
1688- allow_trailing_comma = 1 ;
1689- i += 2 ;
1690- }
1691- if (res && !allow_trailing_comma )
1692- res = validate_numnodes (tree , i , "print_stmt" );
1693- else if (res && i < nch )
1694- res = validate_comma (CHILD (tree , i ));
1695- }
1696- }
1697- return (res );
1698- }
1699-
1700-
17011652static int
17021653validate_del_stmt (node * tree )
17031654{
@@ -2977,7 +2928,7 @@ validate_node(node *tree)
29772928 break ;
29782929 case small_stmt :
29792930 /*
2980- * expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt
2931+ * expr_stmt | del_stmt | pass_stmt | flow_stmt
29812932 * | import_stmt | global_stmt | assert_stmt
29822933 */
29832934 res = validate_small_stmt (tree );
@@ -3012,9 +2963,6 @@ validate_node(node *tree)
30122963 case expr_stmt :
30132964 res = validate_expr_stmt (tree );
30142965 break ;
3015- case print_stmt :
3016- res = validate_print_stmt (tree );
3017- break ;
30182966 case del_stmt :
30192967 res = validate_del_stmt (tree );
30202968 break ;
0 commit comments