Lines Matching refs:res
336 PyObject *res = 0; in parser_st2tuple() local
366 res = node2tuple(((PyST_Object*)self)->st_node, in parser_st2tuple()
369 return (res); in parser_st2tuple()
392 PyObject *res = 0; in parser_st2list() local
421 res = node2tuple(self->st_node, in parser_st2list()
424 return (res); in parser_st2list()
445 PyObject* res = 0; in parser_compilest() local
465 res = (PyObject *)PyAST_Compile(mod, str, &(self->st_flags), arena); in parser_compilest()
471 return (res); in parser_compilest()
493 PyObject* res = 0; in parser_isexpr() local
506 res = (self->st_type == PyST_EXPR) ? Py_True : Py_False; in parser_isexpr()
507 Py_INCREF(res); in parser_isexpr()
509 return (res); in parser_isexpr()
516 PyObject* res = 0; in parser_issuite() local
529 res = (self->st_type == PyST_EXPR) ? Py_False : Py_True; in parser_issuite()
530 Py_INCREF(res); in parser_issuite()
532 return (res); in parser_issuite()
565 PyObject* res = 0; in parser_do_parse() local
579 res = parser_newstobject(n, type); in parser_do_parse()
580 if (res) in parser_do_parse()
581 ((PyST_Object *)res)->st_flags.cf_flags = flags & PyCF_MASK; in parser_do_parse()
586 return (res); in parser_do_parse()
721 Py_ssize_t res; in parser_sizeof() local
723 res = _PyObject_SIZE(Py_TYPE(st)) + _PyNode_SizeOf(st->st_node); in parser_sizeof()
724 return PyLong_FromSsize_t(res); in parser_sizeof()
875 node* res = 0; in build_node_tree() local
919 res = PyNode_New(num); in build_node_tree()
920 if (res != NULL) { in build_node_tree()
921 if (res != build_node_children(tuple, res, &line_num)) { in build_node_tree()
922 PyNode_Free(res); in build_node_tree()
923 res = NULL; in build_node_tree()
925 if (res && encoding) { in build_node_tree()
928 res->n_str = (char *)PyObject_MALLOC(len); in build_node_tree()
929 if (res->n_str == NULL) { in build_node_tree()
930 PyNode_Free(res); in build_node_tree()
936 (void) memcpy(res->n_str, PyString_AS_STRING(encoding), len); in build_node_tree()
955 return (res); in build_node_tree()
1058 int res = (validate_ntype(terminal, type) in validate_terminal() local
1061 if (!res && !PyErr_Occurred()) { in validate_terminal()
1065 return (res); in validate_terminal()
1076 int res = (nch && validate_ntype(tree, ntype) in validate_repeating_list() local
1079 if (!res && !PyErr_Occurred()) 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()
1087 res = (validate_comma(CHILD(tree, pos)) in validate_repeating_list()
1091 return (res); in validate_repeating_list()
1104 int res = (validate_ntype(tree, classdef) && in validate_class() local
1107 if (res) { in validate_class()
1108 res = (validate_name(CHILD(tree, 0), "class") in validate_class()
1117 if (res) { in validate_class()
1119 res = ((validate_lparen(CHILD(tree, 2)) && in validate_class()
1124 res = (validate_lparen(CHILD(tree,2)) && in validate_class()
1128 return (res); in validate_class()
1139 int res = (validate_ntype(tree, if_stmt) in validate_if() local
1146 if (res && ((nch % 4) == 3)) { in validate_if()
1148 res = (validate_name(CHILD(tree, nch - 3), "else") in validate_if()
1153 else if (!res && !PyErr_Occurred()) in validate_if()
1157 res = validate_numnodes(tree, 0, "if"); in validate_if()
1158 else if (res && (nch > 4)) { in validate_if()
1161 while ((j < nch) && res) { in validate_if()
1162 res = (validate_name(CHILD(tree, j), "elif") in validate_if()
1169 return (res); in validate_if()
1181 int res = validate_ntype(tree, parameters) && ((nch == 2) || (nch == 3)); in validate_parameters() local
1183 if (res) { in validate_parameters()
1184 res = (validate_lparen(CHILD(tree, 0)) in validate_parameters()
1186 if (res && (nch == 3)) in validate_parameters()
1187 res = validate_varargslist(CHILD(tree, 1)); in validate_parameters()
1192 return (res); in validate_parameters()
1206 int res = (validate_ntype(tree, suite) && ((nch == 1) || (nch >= 4))); in validate_suite() local
1208 if (res && (nch == 1)) in validate_suite()
1209 res = validate_simple_stmt(CHILD(tree, 0)); in validate_suite()
1210 else if (res) { in validate_suite()
1212 res = (validate_newline(CHILD(tree, 0)) in validate_suite()
1217 if (res && (nch > 4)) { in validate_suite()
1220 for ( ; res && (i < nch); ++i) in validate_suite()
1221 res = validate_stmt(CHILD(tree, i)); in validate_suite()
1224 res = validate_numnodes(tree, 4, "suite"); in validate_suite()
1226 return (res); in validate_suite()
1260 int res = 0; in validate_varargslist_trailer() local
1273 res = validate_name(CHILD(tree, start+1), NULL); in validate_varargslist_trailer()
1275 res = (validate_name(CHILD(tree, start+1), NULL) in validate_varargslist_trailer()
1285 res = validate_name(CHILD(tree, start+1), NULL); in validate_varargslist_trailer()
1287 if (!res) in validate_varargslist_trailer()
1289 return res; in validate_varargslist_trailer()
1306 int res = validate_ntype(tree, varargslist) && (nch != 0); in validate_varargslist() local
1309 if (!res) in validate_varargslist()
1320 res = validate_varargslist_trailer(tree, 0); in validate_varargslist()
1332 while (res && (i+2 <= nch)) { in validate_varargslist()
1333 res = validate_fpdef(CHILD(tree, i)); in validate_varargslist()
1335 if (res && TYPE(CHILD(tree, i)) == EQUAL && (i+2 <= nch)) { in validate_varargslist()
1336 res = (validate_equal(CHILD(tree, i)) in validate_varargslist()
1338 if (res) in validate_varargslist()
1341 if (res && i < nch) { in validate_varargslist()
1342 res = validate_comma(CHILD(tree, i)); in validate_varargslist()
1344 if (res && i < nch in validate_varargslist()
1353 if (res) in validate_varargslist()
1354 res = validate_varargslist_trailer(tree, i); in validate_varargslist()
1362 res = validate_comma(CHILD(tree, nch-1)); in validate_varargslist()
1363 if (!res) in validate_varargslist()
1370 res = validate_fpdef(CHILD(tree, 0)); in validate_varargslist()
1372 if (res && (i+2 <= nch) && TYPE(CHILD(tree, i)) == EQUAL) { in validate_varargslist()
1373 res = (validate_equal(CHILD(tree, i)) in validate_varargslist()
1381 while (res && (nch - i) >= 2) { in validate_varargslist()
1382 res = (validate_comma(CHILD(tree, i)) in validate_varargslist()
1385 if (res && (nch - i) >= 2 && TYPE(CHILD(tree, i)) == EQUAL) { in validate_varargslist()
1386 res = (validate_equal(CHILD(tree, i)) in validate_varargslist()
1391 if (res && nch - i != 0) { in validate_varargslist()
1392 res = 0; in validate_varargslist()
1397 return res; in validate_varargslist()
1406 int res = (validate_ntype(tree, list_iter) in validate_list_iter() local
1408 if (res && TYPE(CHILD(tree, 0)) == list_for) in validate_list_iter()
1409 res = validate_list_for(CHILD(tree, 0)); in validate_list_iter()
1411 res = validate_list_if(CHILD(tree, 0)); in validate_list_iter()
1413 return res; in validate_list_iter()
1421 int res = (validate_ntype(tree, comp_iter) in validate_comp_iter() local
1423 if (res && TYPE(CHILD(tree, 0)) == comp_for) in validate_comp_iter()
1424 res = validate_comp_for(CHILD(tree, 0)); in validate_comp_iter()
1426 res = validate_comp_if(CHILD(tree, 0)); in validate_comp_iter()
1428 return res; in validate_comp_iter()
1437 int res; in validate_list_for() local
1440 res = validate_list_iter(CHILD(tree, 4)); in validate_list_for()
1442 res = validate_numnodes(tree, 4, "list_for"); in validate_list_for()
1444 if (res) in validate_list_for()
1445 res = (validate_name(CHILD(tree, 0), "for") in validate_list_for()
1450 return res; in validate_list_for()
1459 int res; in validate_comp_for() local
1462 res = validate_comp_iter(CHILD(tree, 4)); in validate_comp_for()
1464 res = validate_numnodes(tree, 4, "comp_for"); in validate_comp_for()
1466 if (res) in validate_comp_for()
1467 res = (validate_name(CHILD(tree, 0), "for") in validate_comp_for()
1472 return res; in validate_comp_for()
1481 int res; in validate_list_if() local
1484 res = validate_list_iter(CHILD(tree, 2)); in validate_list_if()
1486 res = validate_numnodes(tree, 2, "list_if"); in validate_list_if()
1488 if (res) in validate_list_if()
1489 res = (validate_name(CHILD(tree, 0), "if") in validate_list_if()
1492 return res; in validate_list_if()
1501 int res; in validate_comp_if() local
1504 res = validate_comp_iter(CHILD(tree, 2)); in validate_comp_if()
1506 res = validate_numnodes(tree, 2, "comp_if"); in validate_comp_if()
1508 if (res) in validate_comp_if()
1509 res = (validate_name(CHILD(tree, 0), "if") in validate_comp_if()
1512 return res; in validate_comp_if()
1525 int res = validate_ntype(tree, fpdef); in validate_fpdef() local
1527 if (res) { in validate_fpdef()
1529 res = validate_ntype(CHILD(tree, 0), NAME); in validate_fpdef()
1531 res = (validate_lparen(CHILD(tree, 0)) in validate_fpdef()
1535 res = validate_numnodes(tree, 1, "fpdef"); in validate_fpdef()
1537 return (res); in validate_fpdef()
1555 int res = (validate_ntype(tree, stmt) in validate_stmt() local
1558 if (res) { in validate_stmt()
1562 res = validate_simple_stmt(tree); in validate_stmt()
1564 res = validate_compound_stmt(tree); in validate_stmt()
1566 return (res); in validate_stmt()
1577 int res = (validate_ntype(tree, simple_stmt) in validate_simple_stmt() local
1583 res = validate_numnodes(tree, 2, "simple_stmt"); 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()
1591 res = (validate_semi(CHILD(tree, i)) in validate_simple_stmt()
1594 return (res); in validate_simple_stmt()
1602 int res = validate_numnodes(tree, 1, "small_stmt"); in validate_small_stmt() local
1604 if (res) { in validate_small_stmt()
1616 res = validate_node(CHILD(tree, 0)); in validate_small_stmt()
1618 res = 0; in validate_small_stmt()
1623 res = 0; in validate_small_stmt()
1628 return (res); in validate_small_stmt()
1638 int res = (validate_ntype(tree, compound_stmt) in validate_compound_stmt() local
1642 if (!res) in validate_compound_stmt()
1655 res = validate_node(tree); in validate_compound_stmt()
1657 res = 0; in validate_compound_stmt()
1661 return (res); in validate_compound_stmt()
1678 int res = (validate_ntype(tree, expr_stmt) in validate_expr_stmt() local
1682 if (res && nch == 3 in validate_expr_stmt()
1684 res = validate_numnodes(CHILD(tree, 1), 1, "augassign") in validate_expr_stmt()
1687 if (res) { in validate_expr_stmt()
1690 res = (strcmp(s, "+=") == 0 in validate_expr_stmt()
1702 if (!res) in validate_expr_stmt()
1707 for (j = 1; res && (j < nch); j += 2) in validate_expr_stmt()
1708 res = validate_equal(CHILD(tree, j)) in validate_expr_stmt()
1711 return (res); in validate_expr_stmt()
1724 int res = (validate_ntype(tree, print_stmt) in validate_print_stmt() local
1728 if (res && nch > 1) { in validate_print_stmt()
1734 res = validate_test(CHILD(tree, i++)); in validate_print_stmt()
1737 res = validate_numnodes(tree, 3, "print_stmt"); in validate_print_stmt()
1739 res = (validate_ntype(CHILD(tree, i), RIGHTSHIFT) in validate_print_stmt()
1745 if (res) { in validate_print_stmt()
1747 while (res && i+2 <= nch) { in validate_print_stmt()
1748 res = (validate_comma(CHILD(tree, i)) in validate_print_stmt()
1753 if (res && !allow_trailing_comma) in validate_print_stmt()
1754 res = validate_numnodes(tree, i, "print_stmt"); in validate_print_stmt()
1755 else if (res && i < nch) in validate_print_stmt()
1756 res = validate_comma(CHILD(tree, i)); in validate_print_stmt()
1759 return (res); in validate_print_stmt()
1776 int res = (validate_ntype(tree, return_stmt) in validate_return_stmt() local
1780 if (res && (nch == 2)) in validate_return_stmt()
1781 res = validate_testlist(CHILD(tree, 1)); in validate_return_stmt()
1783 return (res); in validate_return_stmt()
1791 int res = (validate_ntype(tree, raise_stmt) in validate_raise_stmt() local
1794 if (res) { in validate_raise_stmt()
1795 res = validate_name(CHILD(tree, 0), "raise"); in validate_raise_stmt()
1796 if (res && (nch >= 2)) in validate_raise_stmt()
1797 res = validate_test(CHILD(tree, 1)); in validate_raise_stmt()
1798 if (res && nch > 2) { in validate_raise_stmt()
1799 res = (validate_comma(CHILD(tree, 2)) in validate_raise_stmt()
1801 if (res && (nch > 4)) in validate_raise_stmt()
1802 res = (validate_comma(CHILD(tree, 4)) in validate_raise_stmt()
1808 if (res && (nch == 4)) in validate_raise_stmt()
1809 res = (validate_comma(CHILD(tree, 2)) in validate_raise_stmt()
1812 return (res); in validate_raise_stmt()
1822 int res = (validate_ntype(tree, yield_expr) in validate_yield_expr() local
1826 if (res && (nch == 2)) in validate_yield_expr()
1827 res = validate_testlist(CHILD(tree, 1)); in validate_yield_expr()
1829 return (res); in validate_yield_expr()
1870 int res = (validate_ntype(tree, dotted_name) in validate_dotted_name() local
1875 for (i = 1; res && (i < nch); i += 2) { in validate_dotted_name()
1876 res = (validate_dot(CHILD(tree, i)) in validate_dotted_name()
1879 return res; in validate_dotted_name()
1889 int res = validate_ntype(tree, dotted_as_name); in validate_dotted_as_name() local
1891 if (res) { in validate_dotted_as_name()
1893 res = validate_dotted_name(CHILD(tree, 0)); in validate_dotted_as_name()
1895 res = (validate_dotted_name(CHILD(tree, 0)) in validate_dotted_as_name()
1899 res = 0; in validate_dotted_as_name()
1903 return res; in validate_dotted_as_name()
1912 int res = is_odd(nch) && validate_dotted_as_name(CHILD(tree, 0)); in validate_dotted_as_names() local
1915 for (i = 1; res && (i < nch); i += 2) in validate_dotted_as_names()
1916 res = (validate_comma(CHILD(tree, i)) in validate_dotted_as_names()
1918 return (res); in validate_dotted_as_names()
1927 int res = validate_import_as_name(CHILD(tree, 0)); in validate_import_as_names() local
1930 for (i = 1; res && (i + 1 < nch); i += 2) in validate_import_as_names()
1931 res = (validate_comma(CHILD(tree, i)) in validate_import_as_names()
1933 return (res); in validate_import_as_names()
1970 int res = validate_ntype(tree, import_from) in validate_import_from() local
1977 if (res && TYPE(CHILD(tree, offset + 2)) == LPAR) in validate_import_from()
1978 res = ((nch == offset + 5) in validate_import_from()
1982 else if (res && TYPE(CHILD(tree, offset + 2)) != STAR) in validate_import_from()
1983 res = validate_import_as_names(CHILD(tree, offset + 2)); in validate_import_from()
1984 return (res); in validate_import_from()
1993 int res = validate_numnodes(tree, 1, "import_stmt"); in validate_import_stmt() local
1995 if (res) { in validate_import_stmt()
1999 res = validate_node(CHILD(tree, 0)); in validate_import_stmt()
2001 res = 0; in validate_import_stmt()
2006 res = 0; in validate_import_stmt()
2011 return (res); in validate_import_stmt()
2022 int res = (validate_ntype(tree, global_stmt) in validate_global_stmt() local
2025 if (!res && !PyErr_Occurred()) in validate_global_stmt()
2028 if (res) in validate_global_stmt()
2029 res = (validate_name(CHILD(tree, 0), "global") in validate_global_stmt()
2031 for (j = 2; res && (j < nch); j += 2) in validate_global_stmt()
2032 res = (validate_comma(CHILD(tree, j)) in validate_global_stmt()
2035 return (res); in validate_global_stmt()
2047 int res = (validate_ntype(tree, exec_stmt) in validate_exec_stmt() local
2052 if (!res && !PyErr_Occurred()) in validate_exec_stmt()
2054 if (res && (nch > 2)) in validate_exec_stmt()
2055 res = (validate_name(CHILD(tree, 2), "in") in validate_exec_stmt()
2057 if (res && (nch == 6)) in validate_exec_stmt()
2058 res = (validate_comma(CHILD(tree, 4)) in validate_exec_stmt()
2061 return (res); in validate_exec_stmt()
2073 int res = (validate_ntype(tree, assert_stmt) in validate_assert_stmt() local
2078 if (!res && !PyErr_Occurred()) in validate_assert_stmt()
2080 if (res && (nch > 2)) in validate_assert_stmt()
2081 res = (validate_comma(CHILD(tree, 2)) in validate_assert_stmt()
2084 return (res); in validate_assert_stmt()
2092 int res = (validate_ntype(tree, while_stmt) in validate_while() local
2099 if (res && (nch == 7)) in validate_while()
2100 res = (validate_name(CHILD(tree, 4), "else") in validate_while()
2104 return (res); in validate_while()
2112 int res = (validate_ntype(tree, for_stmt) in validate_for() local
2121 if (res && (nch == 9)) in validate_for()
2122 res = (validate_name(CHILD(tree, 6), "else") in validate_for()
2126 return (res); in validate_for()
2141 int res = (validate_ntype(tree, try_stmt) in validate_try() local
2144 if (res) in validate_try()
2145 res = (validate_name(CHILD(tree, 0), "try") in validate_try()
2159 if (res && (TYPE(CHILD(tree, pos)) == NAME) && in validate_try()
2161 res = (validate_numnodes(tree, 6, "try/finally") in validate_try()
2164 return (res); in validate_try()
2167 while (res && pos < nch && (TYPE(CHILD(tree, pos)) == except_clause)) { in validate_try()
2168 res = (validate_except_clause(CHILD(tree, pos)) in validate_try()
2174 if (res && pos < nch && (TYPE(CHILD(tree, pos)) == NAME) && in validate_try()
2176 res = (validate_colon(CHILD(tree, pos + 1)) in validate_try()
2180 if (res && pos < nch) { in validate_try()
2182 res = (validate_name(CHILD(tree, pos), "finally") in validate_try()
2187 return (res); in validate_try()
2195 int res = (validate_ntype(tree, except_clause) in validate_except_clause() local
2199 if (res && (nch > 1)) in validate_except_clause()
2200 res = validate_test(CHILD(tree, 1)); in validate_except_clause()
2201 if (res && (nch == 4)) { in validate_except_clause()
2203 res = validate_name(CHILD(tree, 2), "as"); in validate_except_clause()
2205 res = validate_comma(CHILD(tree, 2)); in validate_except_clause()
2206 res = res && validate_test(CHILD(tree, 3)); in validate_except_clause()
2208 return (res); in validate_except_clause()
2216 int res = validate_ntype(tree, test) && is_odd(nch); in validate_test() local
2218 if (res && (TYPE(CHILD(tree, 0)) == lambdef)) in validate_test()
2219 res = ((nch == 1) in validate_test()
2221 else if (res) { in validate_test()
2222 res = validate_or_test(CHILD(tree, 0)); in validate_test()
2223 res = (res && (nch == 1 || (nch == 5 && in validate_test()
2229 return (res); in validate_test()
2236 int res = validate_ntype(tree, old_test) && (nch == 1); in validate_old_test() local
2238 if (res && (TYPE(CHILD(tree, 0)) == old_lambdef)) in validate_old_test()
2239 res = (validate_old_lambdef(CHILD(tree, 0))); in validate_old_test()
2240 else if (res) { in validate_old_test()
2241 res = (validate_or_test(CHILD(tree, 0))); in validate_old_test()
2243 return (res); in validate_old_test()
2250 int res = validate_ntype(tree, or_test) && is_odd(nch); in validate_or_test() local
2252 if (res) { in validate_or_test()
2254 res = validate_and_test(CHILD(tree, 0)); in validate_or_test()
2255 for (pos = 1; res && (pos < nch); pos += 2) in validate_or_test()
2256 res = (validate_name(CHILD(tree, pos), "or") in validate_or_test()
2259 return (res); in validate_or_test()
2268 int res = (validate_ntype(tree, and_test) in validate_and_test() local
2272 for (pos = 1; res && (pos < nch); pos += 2) in validate_and_test()
2273 res = (validate_name(CHILD(tree, pos), "and") in validate_and_test()
2276 return (res); in validate_and_test()
2284 int res = validate_ntype(tree, not_test) && ((nch == 1) || (nch == 2)); in validate_not_test() local
2286 if (res) { in validate_not_test()
2288 res = (validate_name(CHILD(tree, 0), "not") in validate_not_test()
2291 res = validate_comparison(CHILD(tree, 0)); in validate_not_test()
2293 return (res); in validate_not_test()
2302 int res = (validate_ntype(tree, comparison) in validate_comparison() local
2306 for (pos = 1; res && (pos < nch); pos += 2) in validate_comparison()
2307 res = (validate_comp_op(CHILD(tree, pos)) in validate_comparison()
2310 return (res); in validate_comparison()
2317 int res = 0; in validate_comp_op() local
2336 res = 1; in validate_comp_op()
2339 res = ((strcmp(STR(tree), "in") == 0) in validate_comp_op()
2341 if (!res) { in validate_comp_op()
2351 else if ((res = validate_numnodes(tree, 2, "comp_op")) != 0) { in validate_comp_op()
2352 res = (validate_ntype(CHILD(tree, 0), NAME) in validate_comp_op()
2358 if (!res && !PyErr_Occurred()) in validate_comp_op()
2361 return (res); in validate_comp_op()
2370 int res = (validate_ntype(tree, expr) in validate_expr() local
2374 for (j = 2; res && (j < nch); j += 2) in validate_expr()
2375 res = (validate_xor_expr(CHILD(tree, j)) in validate_expr()
2378 return (res); in validate_expr()
2387 int res = (validate_ntype(tree, xor_expr) in validate_xor_expr() local
2391 for (j = 2; res && (j < nch); j += 2) in validate_xor_expr()
2392 res = (validate_circumflex(CHILD(tree, j - 1)) in validate_xor_expr()
2395 return (res); in validate_xor_expr()
2404 int res = (validate_ntype(tree, and_expr) in validate_and_expr() local
2408 for (pos = 1; res && (pos < nch); pos += 2) in validate_and_expr()
2409 res = (validate_ampersand(CHILD(tree, pos)) in validate_and_expr()
2412 return (res); in validate_and_expr()
2421 int res = (is_odd(nch) in validate_chain_two_ops() local
2424 for ( ; res && (pos < nch); pos += 2) { in validate_chain_two_ops()
2426 res = validate_ntype(CHILD(tree, pos), op2); in validate_chain_two_ops()
2427 if (res) in validate_chain_two_ops()
2428 res = (*termvalid)(CHILD(tree, pos + 1)); in validate_chain_two_ops()
2430 return (res); in validate_chain_two_ops()
2456 int res = (validate_ntype(tree, term) in validate_term() local
2460 for ( ; res && (pos < nch); pos += 2) in validate_term()
2461 res = (((TYPE(CHILD(tree, pos)) == STAR) in validate_term()
2467 return (res); in validate_term()
2479 int res = (validate_ntype(tree, factor) in validate_factor() local
2487 return (res); in validate_factor()
2500 int res = (validate_ntype(tree, power) && (nch >= 1) in validate_power() local
2503 while (res && (pos < nch) && (TYPE(CHILD(tree, pos)) == trailer)) in validate_power()
2504 res = validate_trailer(CHILD(tree, pos++)); in validate_power()
2505 if (res && (pos < nch)) { in validate_power()
2510 for ( ; res && (pos < (nch - 1)); pos += 2) in validate_power()
2511 res = (validate_doublestar(CHILD(tree, pos)) in validate_power()
2514 return (res); in validate_power()
2523 int res = validate_ntype(tree, atom); in validate_atom() local
2525 if (res && nch < 1) in validate_atom()
2526 res = validate_numnodes(tree, nch+1, "atom"); in validate_atom()
2527 if (res) { in validate_atom()
2530 res = ((nch <= 3) in validate_atom()
2533 if (res && (nch == 3)) { in validate_atom()
2535 res = validate_yield_expr(CHILD(tree, 1)); in validate_atom()
2537 res = validate_testlist_comp(CHILD(tree, 1)); in validate_atom()
2542 res = validate_ntype(CHILD(tree, 1), RSQB); in validate_atom()
2544 res = (validate_listmaker(CHILD(tree, 1)) in validate_atom()
2547 res = 0; in validate_atom()
2552 res = ((nch <= 3) in validate_atom()
2555 if (res && (nch == 3)) in validate_atom()
2556 res = validate_dictorsetmaker(CHILD(tree, 1)); 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()
2569 res = validate_ntype(CHILD(tree, pos), STRING); in validate_atom()
2572 res = 0; in validate_atom()
2576 return (res); in validate_atom()
2772 int res = (validate_ntype(tree, lambdef) in validate_lambdef() local
2778 if (res && (nch == 4)) in validate_lambdef()
2779 res = validate_varargslist(CHILD(tree, 1)); in validate_lambdef()
2780 else if (!res && !PyErr_Occurred()) in validate_lambdef()
2783 return (res); in validate_lambdef()
2791 int res = (validate_ntype(tree, old_lambdef) in validate_old_lambdef() local
2797 if (res && (nch == 4)) in validate_old_lambdef()
2798 res = validate_varargslist(CHILD(tree, 1)); in validate_old_lambdef()
2799 else if (!res && !PyErr_Occurred()) in validate_old_lambdef()
2802 return (res); in validate_old_lambdef()
2898 int res = (validate_ntype(tree, argument) in validate_argument() local
2902 if (res && (nch == 2)) in validate_argument()
2903 res = validate_comp_for(CHILD(tree, 1)); in validate_argument()
2904 else if (res && (nch == 3)) in validate_argument()
2905 res = (validate_equal(CHILD(tree, 1)) in validate_argument()
2908 return (res); in validate_argument()
2921 int res = validate_ntype(tree, trailer) && ((nch == 2) || (nch == 3)); in validate_trailer() local
2923 if (res) { in validate_trailer()
2926 res = validate_rparen(CHILD(tree, nch - 1)); in validate_trailer()
2927 if (res && (nch == 3)) in validate_trailer()
2928 res = validate_arglist(CHILD(tree, 1)); in validate_trailer()
2931 res = (validate_numnodes(tree, 3, "trailer") in validate_trailer()
2936 res = (validate_numnodes(tree, 2, "trailer") in validate_trailer()
2940 res = 0; in validate_trailer()
2947 return (res); in validate_trailer()
2972 int res = validate_ntype(tree, subscript) && (nch >= 1) && (nch <= 4); in validate_subscript() local
2974 if (!res) { in validate_subscript()
2987 res = validate_test(CHILD(tree, 0)); in validate_subscript()
2989 res = validate_colon(CHILD(tree, 0)); in validate_subscript()
2990 return (res); in validate_subscript()
2997 res = validate_test(CHILD(tree, 0)); in validate_subscript()
3000 if (res) in validate_subscript()
3001 res = validate_colon(CHILD(tree, offset)); in validate_subscript()
3002 if (res) { in validate_subscript()
3006 res = validate_test(CHILD(tree, offset)); in validate_subscript()
3010 if (res && rem) in validate_subscript()
3011 res = validate_sliceop(CHILD(tree, offset)); in validate_subscript()
3014 return (res); in validate_subscript()
3022 int res = ((nch == 1) || validate_numnodes(tree, 2, "sliceop")) in validate_sliceop() local
3024 if (!res && !PyErr_Occurred()) { in validate_sliceop()
3025 res = validate_numnodes(tree, 1, "sliceop"); in validate_sliceop()
3027 if (res) in validate_sliceop()
3028 res = validate_colon(CHILD(tree, 0)); in validate_sliceop()
3029 if (res && (nch == 2)) in validate_sliceop()
3030 res = validate_test(CHILD(tree, 1)); in validate_sliceop()
3032 return (res); in validate_sliceop()
3130 int res = (validate_ntype(tree, eval_input) in validate_eval_input() local
3135 for (pos = 1; res && (pos < (nch - 1)); ++pos) in validate_eval_input()
3136 res = validate_ntype(CHILD(tree, pos), NEWLINE); in validate_eval_input()
3138 return (res); in validate_eval_input()
3146 int res = 1; /* result value */ in validate_node() local
3149 while (res && (tree != 0)) { in validate_node()
3157 res = validate_funcdef(tree); in validate_node()
3160 res = validate_with_stmt(tree); in validate_node()
3163 res = validate_class(tree); in validate_node()
3166 res = validate_decorated(tree); in validate_node()
3173 res = validate_stmt(tree); in validate_node()
3180 res = validate_small_stmt(tree); in validate_node()
3183 res = (validate_numnodes(tree, 1, "flow_stmt") in validate_node()
3189 if (res) in validate_node()
3195 res = validate_yield_stmt(tree); in validate_node()
3201 res = validate_simple_stmt(tree); in validate_node()
3204 res = validate_compound_stmt(tree); in validate_node()
3210 res = validate_expr_stmt(tree); in validate_node()
3213 res = validate_print_stmt(tree); in validate_node()
3216 res = validate_del_stmt(tree); in validate_node()
3219 res = (validate_numnodes(tree, 1, "pass") in validate_node()
3223 res = (validate_numnodes(tree, 1, "break") in validate_node()
3227 res = (validate_numnodes(tree, 1, "continue") in validate_node()
3231 res = validate_return_stmt(tree); in validate_node()
3234 res = validate_raise_stmt(tree); in validate_node()
3237 res = validate_import_stmt(tree); in validate_node()
3240 res = validate_import_name(tree); in validate_node()
3243 res = validate_import_from(tree); in validate_node()
3246 res = validate_global_stmt(tree); in validate_node()
3249 res = validate_exec_stmt(tree); in validate_node()
3252 res = validate_assert_stmt(tree); in validate_node()
3255 res = validate_if(tree); in validate_node()
3258 res = validate_while(tree); in validate_node()
3261 res = validate_for(tree); in validate_node()
3264 res = validate_try(tree); in validate_node()
3267 res = validate_suite(tree); in validate_node()
3273 res = validate_testlist(tree); in validate_node()
3276 res = validate_yield_expr(tree); in validate_node()
3279 res = validate_testlist1(tree); in validate_node()
3282 res = validate_test(tree); in validate_node()
3285 res = validate_and_test(tree); in validate_node()
3288 res = validate_not_test(tree); in validate_node()
3291 res = validate_comparison(tree); in validate_node()
3294 res = validate_exprlist(tree); in validate_node()
3297 res = validate_comp_op(tree); in validate_node()
3300 res = validate_expr(tree); in validate_node()
3303 res = validate_xor_expr(tree); in validate_node()
3306 res = validate_and_expr(tree); in validate_node()
3309 res = validate_shift_expr(tree); in validate_node()
3312 res = validate_arith_expr(tree); in validate_node()
3315 res = validate_term(tree); in validate_node()
3318 res = validate_factor(tree); in validate_node()
3321 res = validate_power(tree); in validate_node()
3324 res = validate_atom(tree); in validate_node()
3330 res = 0; in validate_node()
3335 return (res); in validate_node()
3342 int res = validate_eval_input(tree); in validate_expr_tree() local
3344 if (!res && !PyErr_Occurred()) in validate_expr_tree()
3347 return (res); in validate_expr_tree()
3359 int res = ((nch >= 0) in validate_file_input() local
3362 for (j = 0; res && (j < nch); ++j) { in validate_file_input()
3364 res = validate_stmt(CHILD(tree, j)); in validate_file_input()
3366 res = validate_newline(CHILD(tree, j)); in validate_file_input()
3372 if (!res && !PyErr_Occurred()) in validate_file_input()
3375 return (res); in validate_file_input()
3382 int res = ((nch == 1) in validate_encoding_decl() local
3385 if (!res && !PyErr_Occurred()) in validate_encoding_decl()
3388 return res; in validate_encoding_decl()
3523 PyObject *res; in initparser() local
3525 res = PyObject_CallFunctionObjArgs(func, &PyST_Type, pickler, in initparser()
3527 Py_XDECREF(res); in initparser()