Lines Matching refs:nch
1075 int nch = NCH(tree); in validate_repeating_list() local
1076 int res = (nch && validate_ntype(tree, ntype) in validate_repeating_list()
1082 if (is_even(nch)) in validate_repeating_list()
1083 res = validate_comma(CHILD(tree, --nch)); in validate_repeating_list()
1084 if (res && nch > 1) { in validate_repeating_list()
1086 for ( ; res && pos < nch; pos += 2) in validate_repeating_list()
1103 int nch = NCH(tree); in validate_class() local
1105 ((nch == 4) || (nch == 6) || (nch == 7))); in validate_class()
1110 && validate_colon(CHILD(tree, nch - 2)) in validate_class()
1111 && validate_suite(CHILD(tree, nch - 1))); in validate_class()
1118 if (nch == 7) { in validate_class()
1123 else if (nch == 6) { in validate_class()
1138 int nch = NCH(tree); in validate_if() local
1140 && (nch >= 4) in validate_if()
1146 if (res && ((nch % 4) == 3)) { in validate_if()
1148 res = (validate_name(CHILD(tree, nch - 3), "else") in validate_if()
1149 && validate_colon(CHILD(tree, nch - 2)) in validate_if()
1150 && validate_suite(CHILD(tree, nch - 1))); in validate_if()
1151 nch -= 3; in validate_if()
1155 if ((nch % 4) != 0) in validate_if()
1158 else if (res && (nch > 4)) { in validate_if()
1161 while ((j < nch) && res) { in validate_if()
1180 int nch = NCH(tree); in validate_parameters() local
1181 int res = validate_ntype(tree, parameters) && ((nch == 2) || (nch == 3)); in validate_parameters()
1185 && validate_rparen(CHILD(tree, nch - 1))); in validate_parameters()
1186 if (res && (nch == 3)) in validate_parameters()
1205 int nch = NCH(tree); in validate_suite() local
1206 int res = (validate_ntype(tree, suite) && ((nch == 1) || (nch >= 4))); in validate_suite()
1208 if (res && (nch == 1)) in validate_suite()
1215 && validate_dedent(CHILD(tree, nch - 1))); in validate_suite()
1217 if (res && (nch > 4)) { in validate_suite()
1219 --nch; /* forget the DEDENT */ in validate_suite()
1220 for ( ; res && (i < nch); ++i) in validate_suite()
1223 else if (nch < 4) in validate_suite()
1259 int nch = NCH(tree); in validate_varargslist_trailer() local
1263 if (nch <= start) { in validate_varargslist_trailer()
1272 if (nch-start == 2) in validate_varargslist_trailer()
1274 else if (nch-start == 5) in validate_varargslist_trailer()
1284 if (nch-start == 2) in validate_varargslist_trailer()
1305 int nch = NCH(tree); in validate_varargslist() local
1306 int res = validate_ntype(tree, varargslist) && (nch != 0); in validate_varargslist()
1311 if (nch < 1) { in validate_varargslist()
1324 sym = TYPE(CHILD(tree, nch-1)); in validate_varargslist()
1332 while (res && (i+2 <= nch)) { in validate_varargslist()
1335 if (res && TYPE(CHILD(tree, i)) == EQUAL && (i+2 <= nch)) { in validate_varargslist()
1341 if (res && i < nch) { in validate_varargslist()
1344 if (res && i < nch in validate_varargslist()
1362 res = validate_comma(CHILD(tree, nch-1)); in validate_varargslist()
1365 --nch; in validate_varargslist()
1372 if (res && (i+2 <= nch) && TYPE(CHILD(tree, i)) == EQUAL) { in validate_varargslist()
1381 while (res && (nch - i) >= 2) { in validate_varargslist()
1385 if (res && (nch - i) >= 2 && TYPE(CHILD(tree, i)) == EQUAL) { in validate_varargslist()
1391 if (res && nch - i != 0) { in validate_varargslist()
1436 int nch = NCH(tree); in validate_list_for() local
1439 if (nch == 5) in validate_list_for()
1458 int nch = NCH(tree); in validate_comp_for() local
1461 if (nch == 5) in validate_comp_for()
1480 int nch = NCH(tree); in validate_list_if() local
1483 if (nch == 3) in validate_list_if()
1500 int nch = NCH(tree); in validate_comp_if() local
1503 if (nch == 3) in validate_comp_if()
1524 int nch = NCH(tree); in validate_fpdef() local
1528 if (nch == 1) in validate_fpdef()
1530 else if (nch == 3) in validate_fpdef()
1576 int nch = NCH(tree); in validate_simple_stmt() local
1578 && (nch >= 2) in validate_simple_stmt()
1580 && validate_newline(CHILD(tree, nch - 1))); in validate_simple_stmt()
1582 if (nch < 2) in validate_simple_stmt()
1584 --nch; /* forget the NEWLINE */ in validate_simple_stmt()
1585 if (res && is_even(nch)) in validate_simple_stmt()
1586 res = validate_semi(CHILD(tree, --nch)); in validate_simple_stmt()
1587 if (res && (nch > 2)) { in validate_simple_stmt()
1590 for (i = 1; res && (i < nch); i += 2) in validate_simple_stmt()
1601 int nch = NCH(tree); in validate_small_stmt() local
1622 else if (nch == 1) { in validate_small_stmt()
1677 int nch = NCH(tree); in validate_expr_stmt() local
1679 && is_odd(nch) in validate_expr_stmt()
1682 if (res && nch == 3 in validate_expr_stmt()
1707 for (j = 1; res && (j < nch); j += 2) in validate_expr_stmt()
1723 int nch = NCH(tree); in validate_print_stmt() local
1725 && (nch > 0) in validate_print_stmt()
1728 if (res && nch > 1) { in validate_print_stmt()
1736 if (nch < 3) in validate_print_stmt()
1747 while (res && i+2 <= nch) { in validate_print_stmt()
1755 else if (res && i < nch) in validate_print_stmt()
1775 int nch = NCH(tree); in validate_return_stmt() local
1777 && ((nch == 1) || (nch == 2)) in validate_return_stmt()
1780 if (res && (nch == 2)) in validate_return_stmt()
1790 int nch = NCH(tree); in validate_raise_stmt() local
1792 && ((nch == 1) || (nch == 2) || (nch == 4) || (nch == 6))); in validate_raise_stmt()
1796 if (res && (nch >= 2)) in validate_raise_stmt()
1798 if (res && nch > 2) { in validate_raise_stmt()
1801 if (res && (nch > 4)) in validate_raise_stmt()
1808 if (res && (nch == 4)) in validate_raise_stmt()
1821 int nch = NCH(tree); in validate_yield_expr() local
1823 && ((nch == 1) || (nch == 2)) in validate_yield_expr()
1826 if (res && (nch == 2)) in validate_yield_expr()
1847 int nch = NCH(tree); in validate_import_as_name() local
1851 if (nch == 1) in validate_import_as_name()
1853 else if (nch == 3) in validate_import_as_name()
1869 int nch = NCH(tree); in validate_dotted_name() local
1871 && is_odd(nch) in validate_dotted_name()
1875 for (i = 1; res && (i < nch); i += 2) { in validate_dotted_name()
1888 int nch = NCH(tree); in validate_dotted_as_name() local
1892 if (nch == 1) in validate_dotted_as_name()
1894 else if (nch == 3) in validate_dotted_as_name()
1911 int nch = NCH(tree); in validate_dotted_as_names() local
1912 int res = is_odd(nch) && validate_dotted_as_name(CHILD(tree, 0)); in validate_dotted_as_names()
1915 for (i = 1; res && (i < nch); i += 2) in validate_dotted_as_names()
1926 int nch = NCH(tree); in validate_import_as_names() local
1930 for (i = 1; res && (i + 1 < nch); i += 2) in validate_import_as_names()
1966 int nch = NCH(tree); in validate_import_from() local
1972 && (nch >= 3 + offset) in validate_import_from()
1978 res = ((nch == offset + 5) in validate_import_from()
1992 int nch = NCH(tree); in validate_import_stmt() local
2005 else if (nch == 1) { in validate_import_stmt()
2021 int nch = NCH(tree); in validate_global_stmt() local
2023 && is_even(nch) && (nch >= 2)); in validate_global_stmt()
2031 for (j = 2; res && (j < nch); j += 2) in validate_global_stmt()
2046 int nch = NCH(tree); in validate_exec_stmt() local
2048 && ((nch == 2) || (nch == 4) || (nch == 6)) in validate_exec_stmt()
2054 if (res && (nch > 2)) in validate_exec_stmt()
2057 if (res && (nch == 6)) in validate_exec_stmt()
2072 int nch = NCH(tree); in validate_assert_stmt() local
2074 && ((nch == 2) || (nch == 4)) in validate_assert_stmt()
2080 if (res && (nch > 2)) in validate_assert_stmt()
2091 int nch = NCH(tree); in validate_while() local
2093 && ((nch == 4) || (nch == 7)) in validate_while()
2099 if (res && (nch == 7)) in validate_while()
2111 int nch = NCH(tree); in validate_for() local
2113 && ((nch == 6) || (nch == 9)) in validate_for()
2121 if (res && (nch == 9)) in validate_for()
2139 int nch = NCH(tree); in validate_try() local
2142 && (nch >= 6) && ((nch % 3) == 0)); in validate_try()
2148 && validate_colon(CHILD(tree, nch - 2)) in validate_try()
2149 && validate_suite(CHILD(tree, nch - 1))); in validate_try()
2152 if (TYPE(CHILD(tree, nch - 3)) != except_clause) in validate_try()
2153 name = STR(CHILD(tree, nch - 3)); in validate_try()
2167 while (res && pos < nch && (TYPE(CHILD(tree, pos)) == except_clause)) { in validate_try()
2174 if (res && pos < nch && (TYPE(CHILD(tree, pos)) == NAME) && in validate_try()
2180 if (res && pos < nch) { in validate_try()
2194 int nch = NCH(tree); in validate_except_clause() local
2196 && ((nch == 1) || (nch == 2) || (nch == 4)) in validate_except_clause()
2199 if (res && (nch > 1)) in validate_except_clause()
2201 if (res && (nch == 4)) { in validate_except_clause()
2215 int nch = NCH(tree); in validate_test() local
2216 int res = validate_ntype(tree, test) && is_odd(nch); in validate_test()
2219 res = ((nch == 1) in validate_test()
2223 res = (res && (nch == 1 || (nch == 5 && in validate_test()
2235 int nch = NCH(tree); in validate_old_test() local
2236 int res = validate_ntype(tree, old_test) && (nch == 1); in validate_old_test()
2249 int nch = NCH(tree); in validate_or_test() local
2250 int res = validate_ntype(tree, or_test) && is_odd(nch); in validate_or_test()
2255 for (pos = 1; res && (pos < nch); pos += 2) in validate_or_test()
2267 int nch = NCH(tree); in validate_and_test() local
2269 && is_odd(nch) in validate_and_test()
2272 for (pos = 1; res && (pos < nch); pos += 2) in validate_and_test()
2283 int nch = NCH(tree); in validate_not_test() local
2284 int res = validate_ntype(tree, not_test) && ((nch == 1) || (nch == 2)); in validate_not_test()
2287 if (nch == 2) in validate_not_test()
2290 else if (nch == 1) in validate_not_test()
2301 int nch = NCH(tree); in validate_comparison() local
2303 && is_odd(nch) in validate_comparison()
2306 for (pos = 1; res && (pos < nch); pos += 2) in validate_comparison()
2318 int nch = NCH(tree); in validate_comp_op() local
2322 if (nch == 1) { in validate_comp_op()
2369 int nch = NCH(tree); in validate_expr() local
2371 && is_odd(nch) in validate_expr()
2374 for (j = 2; res && (j < nch); j += 2) in validate_expr()
2386 int nch = NCH(tree); in validate_xor_expr() local
2388 && is_odd(nch) in validate_xor_expr()
2391 for (j = 2; res && (j < nch); j += 2) in validate_xor_expr()
2403 int nch = NCH(tree); in validate_and_expr() local
2405 && is_odd(nch) in validate_and_expr()
2408 for (pos = 1; res && (pos < nch); pos += 2) in validate_and_expr()
2420 int nch = NCH(tree); in validate_chain_two_ops() local
2421 int res = (is_odd(nch) in validate_chain_two_ops()
2424 for ( ; res && (pos < nch); pos += 2) { in validate_chain_two_ops()
2455 int nch = NCH(tree); in validate_term() local
2457 && is_odd(nch) in validate_term()
2460 for ( ; res && (pos < nch); pos += 2) in validate_term()
2478 int nch = NCH(tree); in validate_factor() local
2480 && (((nch == 2) in validate_factor()
2485 || ((nch == 1) in validate_factor()
2499 int nch = NCH(tree); in validate_power() local
2500 int res = (validate_ntype(tree, power) && (nch >= 1) in validate_power()
2503 while (res && (pos < nch) && (TYPE(CHILD(tree, pos)) == trailer)) in validate_power()
2505 if (res && (pos < nch)) { in validate_power()
2506 if (!is_even(nch - pos)) { in validate_power()
2510 for ( ; res && (pos < (nch - 1)); pos += 2) in validate_power()
2522 int nch = NCH(tree); in validate_atom() local
2525 if (res && nch < 1) in validate_atom()
2526 res = validate_numnodes(tree, nch+1, "atom"); in validate_atom()
2530 res = ((nch <= 3) in validate_atom()
2531 && (validate_rparen(CHILD(tree, nch - 1)))); in validate_atom()
2533 if (res && (nch == 3)) { in validate_atom()
2541 if (nch == 2) in validate_atom()
2543 else if (nch == 3) in validate_atom()
2552 res = ((nch <= 3) in validate_atom()
2553 && validate_ntype(CHILD(tree, nch - 1), RBRACE)); in validate_atom()
2555 if (res && (nch == 3)) in validate_atom()
2559 res = ((nch == 3) in validate_atom()
2565 res = (nch == 1); in validate_atom()
2568 for (pos = 1; res && (pos < nch); ++pos) in validate_atom()
2586 int nch = NCH(tree); in validate_listmaker() local
2587 int ok = nch; in validate_listmaker()
2589 if (nch == 0) in validate_listmaker()
2597 if (nch == 2 && TYPE(CHILD(tree, 1)) == list_for) in validate_listmaker()
2602 while (ok && nch - i >= 2) { in validate_listmaker()
2607 if (ok && i == nch-1) in validate_listmaker()
2609 else if (i != nch) { in validate_listmaker()
2623 int nch = NCH(tree); in validate_testlist_comp() local
2624 int ok = nch; in validate_testlist_comp()
2626 if (nch == 0) in validate_testlist_comp()
2635 if (nch == 2 && TYPE(CHILD(tree, 1)) == comp_for) in validate_testlist_comp()
2640 while (ok && nch - i >= 2) { in validate_testlist_comp()
2645 if (ok && i == nch-1) in validate_testlist_comp()
2647 else if (i != nch) { in validate_testlist_comp()
2662 int nch = NCH(tree); in validate_decorator() local
2664 (nch == 3 || nch == 5 || nch == 6) && in validate_decorator()
2669 if (ok && nch != 3) { in validate_decorator()
2673 if (ok && nch == 6) in validate_decorator()
2686 int i, nch, ok; in validate_decorators() local
2687 nch = NCH(tree); in validate_decorators()
2688 ok = validate_ntype(tree, decorators) && nch >= 1; in validate_decorators()
2690 for (i = 0; ok && i < nch; ++i) in validate_decorators()
2702 int nch = NCH(tree); in validate_with_item() local
2704 && (nch == 1 || nch == 3) in validate_with_item()
2706 if (ok && nch == 3) in validate_with_item()
2720 int nch = NCH(tree); in validate_with_stmt() local
2722 && (nch % 2 == 0) in validate_with_stmt()
2726 for (i = 1; ok && i < nch - 2; i += 2) in validate_with_stmt()
2739 int nch = NCH(tree); in validate_funcdef() local
2741 && (nch == 5) in validate_funcdef()
2757 int nch = NCH(tree); in validate_decorated() local
2759 && (nch == 2) in validate_decorated()
2771 int nch = NCH(tree); in validate_lambdef() local
2773 && ((nch == 3) || (nch == 4)) in validate_lambdef()
2775 && validate_colon(CHILD(tree, nch - 2)) in validate_lambdef()
2776 && validate_test(CHILD(tree, nch - 1))); in validate_lambdef()
2778 if (res && (nch == 4)) in validate_lambdef()
2790 int nch = NCH(tree); in validate_old_lambdef() local
2792 && ((nch == 3) || (nch == 4)) in validate_old_lambdef()
2794 && validate_colon(CHILD(tree, nch - 2)) in validate_old_lambdef()
2795 && validate_test(CHILD(tree, nch - 1))); in validate_old_lambdef()
2797 if (res && (nch == 4)) in validate_old_lambdef()
2813 int nch = NCH(tree); in validate_arglist() local
2817 if (nch <= 0) in validate_arglist()
2819 return validate_numnodes(tree, nch + 1, "arglist"); in validate_arglist()
2821 if (nch > 1) { in validate_arglist()
2822 for (i=0; i<nch; i++) { in validate_arglist()
2833 while (ok && nch-i >= 2) { in validate_arglist()
2843 if (nch-i > 0) { in validate_arglist()
2851 if (ok && i+1 != nch) { in validate_arglist()
2859 if (ok && (nch-i == 2)) in validate_arglist()
2861 else if (ok && (nch-i == 5)) in validate_arglist()
2872 if (nch-i == 2) in validate_arglist()
2897 int nch = NCH(tree); in validate_argument() local
2899 && ((nch == 1) || (nch == 2) || (nch == 3)) in validate_argument()
2902 if (res && (nch == 2)) in validate_argument()
2904 else if (res && (nch == 3)) in validate_argument()
2920 int nch = NCH(tree); in validate_trailer() local
2921 int res = validate_ntype(tree, trailer) && ((nch == 2) || (nch == 3)); in validate_trailer()
2926 res = validate_rparen(CHILD(tree, nch - 1)); in validate_trailer()
2927 if (res && (nch == 3)) in validate_trailer()
2971 int nch = NCH(tree); in validate_subscript() local
2972 int res = validate_ntype(tree, subscript) && (nch >= 1) && (nch <= 4); in validate_subscript()
2985 if (nch == 1) { in validate_subscript()
2996 if ((TYPE(CHILD(tree, 0)) != COLON) || (nch == 4)) { in validate_subscript()
3003 int rem = nch - ++offset; in validate_subscript()
3021 int nch = NCH(tree); in validate_sliceop() local
3022 int res = ((nch == 1) || validate_numnodes(tree, 2, "sliceop")) in validate_sliceop()
3029 if (res && (nch == 2)) in validate_sliceop()
3053 int nch = NCH(tree); in validate_dictorsetmaker() local
3058 assert(nch > 0); in validate_dictorsetmaker()
3060 if (ok && (nch == 1 || TYPE(CHILD(tree, 1)) == COMMA)) { in validate_dictorsetmaker()
3065 while (ok && nch - i >= 2) { in validate_dictorsetmaker()
3092 if (nch >= 3) { in validate_dictorsetmaker()
3103 while (ok && nch - i >= 4) { in validate_dictorsetmaker()
3113 if (i == nch-1) in validate_dictorsetmaker()
3115 else if (i != nch) { in validate_dictorsetmaker()
3129 int nch = NCH(tree); in validate_eval_input() local
3131 && (nch >= 2) in validate_eval_input()
3133 && validate_ntype(CHILD(tree, nch - 1), ENDMARKER)); in validate_eval_input()
3135 for (pos = 1; res && (pos < (nch - 1)); ++pos) in validate_eval_input()
3145 int nch = 0; /* num. children on current node */ in validate_node() local
3150 nch = NCH(tree); in validate_node()
3191 else if (nch == 1) in validate_node()
3358 int nch = NCH(tree) - 1; in validate_file_input() local
3359 int res = ((nch >= 0) in validate_file_input()
3360 && validate_ntype(CHILD(tree, nch), ENDMARKER)); in validate_file_input()
3362 for (j = 0; res && (j < nch); ++j) { in validate_file_input()
3381 int nch = NCH(tree); in validate_encoding_decl() local
3382 int res = ((nch == 1) in validate_encoding_decl()