• Home
  • Raw
  • Download

Lines Matching refs:node_

404 static int astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
405 static int astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
406 static int astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
407 static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
408 static int astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
409 static int astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
410 static int astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
411 static int astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
412 static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
413 static int astfold_match_case(match_case_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
414 static int astfold_pattern(pattern_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
468 astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_mod() argument
470 switch (node_->kind) { in astfold_mod()
472 CALL(astfold_body, asdl_seq, node_->v.Module.body); in astfold_mod()
475 CALL_SEQ(astfold_stmt, stmt, node_->v.Interactive.body); in astfold_mod()
478 CALL(astfold_expr, expr_ty, node_->v.Expression.body); in astfold_mod()
490 astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_expr() argument
497 switch (node_->kind) { in astfold_expr()
499 CALL_SEQ(astfold_expr, expr, node_->v.BoolOp.values); in astfold_expr()
502 CALL(astfold_expr, expr_ty, node_->v.BinOp.left); in astfold_expr()
503 CALL(astfold_expr, expr_ty, node_->v.BinOp.right); in astfold_expr()
504 CALL(fold_binop, expr_ty, node_); in astfold_expr()
507 CALL(astfold_expr, expr_ty, node_->v.UnaryOp.operand); in astfold_expr()
508 CALL(fold_unaryop, expr_ty, node_); in astfold_expr()
511 CALL(astfold_arguments, arguments_ty, node_->v.Lambda.args); in astfold_expr()
512 CALL(astfold_expr, expr_ty, node_->v.Lambda.body); in astfold_expr()
515 CALL(astfold_expr, expr_ty, node_->v.IfExp.test); in astfold_expr()
516 CALL(astfold_expr, expr_ty, node_->v.IfExp.body); in astfold_expr()
517 CALL(astfold_expr, expr_ty, node_->v.IfExp.orelse); in astfold_expr()
520 CALL_SEQ(astfold_expr, expr, node_->v.Dict.keys); in astfold_expr()
521 CALL_SEQ(astfold_expr, expr, node_->v.Dict.values); in astfold_expr()
524 CALL_SEQ(astfold_expr, expr, node_->v.Set.elts); in astfold_expr()
527 CALL(astfold_expr, expr_ty, node_->v.ListComp.elt); in astfold_expr()
528 CALL_SEQ(astfold_comprehension, comprehension, node_->v.ListComp.generators); in astfold_expr()
531 CALL(astfold_expr, expr_ty, node_->v.SetComp.elt); in astfold_expr()
532 CALL_SEQ(astfold_comprehension, comprehension, node_->v.SetComp.generators); in astfold_expr()
535 CALL(astfold_expr, expr_ty, node_->v.DictComp.key); in astfold_expr()
536 CALL(astfold_expr, expr_ty, node_->v.DictComp.value); in astfold_expr()
537 CALL_SEQ(astfold_comprehension, comprehension, node_->v.DictComp.generators); in astfold_expr()
540 CALL(astfold_expr, expr_ty, node_->v.GeneratorExp.elt); in astfold_expr()
541 CALL_SEQ(astfold_comprehension, comprehension, node_->v.GeneratorExp.generators); in astfold_expr()
544 CALL(astfold_expr, expr_ty, node_->v.Await.value); in astfold_expr()
547 CALL_OPT(astfold_expr, expr_ty, node_->v.Yield.value); in astfold_expr()
550 CALL(astfold_expr, expr_ty, node_->v.YieldFrom.value); in astfold_expr()
553 CALL(astfold_expr, expr_ty, node_->v.Compare.left); in astfold_expr()
554 CALL_SEQ(astfold_expr, expr, node_->v.Compare.comparators); in astfold_expr()
555 CALL(fold_compare, expr_ty, node_); in astfold_expr()
558 CALL(astfold_expr, expr_ty, node_->v.Call.func); in astfold_expr()
559 CALL_SEQ(astfold_expr, expr, node_->v.Call.args); in astfold_expr()
560 CALL_SEQ(astfold_keyword, keyword, node_->v.Call.keywords); in astfold_expr()
563 CALL(astfold_expr, expr_ty, node_->v.FormattedValue.value); in astfold_expr()
564 CALL_OPT(astfold_expr, expr_ty, node_->v.FormattedValue.format_spec); in astfold_expr()
567 CALL_SEQ(astfold_expr, expr, node_->v.JoinedStr.values); in astfold_expr()
570 CALL(astfold_expr, expr_ty, node_->v.Attribute.value); in astfold_expr()
573 CALL(astfold_expr, expr_ty, node_->v.Subscript.value); in astfold_expr()
574 CALL(astfold_expr, expr_ty, node_->v.Subscript.slice); in astfold_expr()
575 CALL(fold_subscr, expr_ty, node_); in astfold_expr()
578 CALL(astfold_expr, expr_ty, node_->v.Starred.value); in astfold_expr()
581 CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.lower); in astfold_expr()
582 CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.upper); in astfold_expr()
583 CALL_OPT(astfold_expr, expr_ty, node_->v.Slice.step); in astfold_expr()
586 CALL_SEQ(astfold_expr, expr, node_->v.List.elts); in astfold_expr()
589 CALL_SEQ(astfold_expr, expr, node_->v.Tuple.elts); in astfold_expr()
590 CALL(fold_tuple, expr_ty, node_); in astfold_expr()
593 if (node_->v.Name.ctx == Load && in astfold_expr()
594 _PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) { in astfold_expr()
596 return make_const(node_, PyBool_FromLong(!state->optimize), ctx_); in astfold_expr()
600 CALL(astfold_expr, expr_ty, node_->v.NamedExpr.value); in astfold_expr()
613 astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_keyword() argument
615 CALL(astfold_expr, expr_ty, node_->value); in astfold_keyword()
620 astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_comprehension() argument
622 CALL(astfold_expr, expr_ty, node_->target); in astfold_comprehension()
623 CALL(astfold_expr, expr_ty, node_->iter); in astfold_comprehension()
624 CALL_SEQ(astfold_expr, expr, node_->ifs); in astfold_comprehension()
626 CALL(fold_iter, expr_ty, node_->iter); in astfold_comprehension()
631 astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_arguments() argument
633 CALL_SEQ(astfold_arg, arg, node_->posonlyargs); in astfold_arguments()
634 CALL_SEQ(astfold_arg, arg, node_->args); in astfold_arguments()
635 CALL_OPT(astfold_arg, arg_ty, node_->vararg); in astfold_arguments()
636 CALL_SEQ(astfold_arg, arg, node_->kwonlyargs); in astfold_arguments()
637 CALL_SEQ(astfold_expr, expr, node_->kw_defaults); in astfold_arguments()
638 CALL_OPT(astfold_arg, arg_ty, node_->kwarg); in astfold_arguments()
639 CALL_SEQ(astfold_expr, expr, node_->defaults); in astfold_arguments()
644 astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_arg() argument
647 CALL_OPT(astfold_expr, expr_ty, node_->annotation); in astfold_arg()
653 astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_stmt() argument
660 switch (node_->kind) { in astfold_stmt()
662 CALL(astfold_arguments, arguments_ty, node_->v.FunctionDef.args); in astfold_stmt()
663 CALL(astfold_body, asdl_seq, node_->v.FunctionDef.body); in astfold_stmt()
664 CALL_SEQ(astfold_expr, expr, node_->v.FunctionDef.decorator_list); in astfold_stmt()
666 CALL_OPT(astfold_expr, expr_ty, node_->v.FunctionDef.returns); in astfold_stmt()
670 CALL(astfold_arguments, arguments_ty, node_->v.AsyncFunctionDef.args); in astfold_stmt()
671 CALL(astfold_body, asdl_seq, node_->v.AsyncFunctionDef.body); in astfold_stmt()
672 CALL_SEQ(astfold_expr, expr, node_->v.AsyncFunctionDef.decorator_list); in astfold_stmt()
674 CALL_OPT(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.returns); in astfold_stmt()
678 CALL_SEQ(astfold_expr, expr, node_->v.ClassDef.bases); in astfold_stmt()
679 CALL_SEQ(astfold_keyword, keyword, node_->v.ClassDef.keywords); in astfold_stmt()
680 CALL(astfold_body, asdl_seq, node_->v.ClassDef.body); in astfold_stmt()
681 CALL_SEQ(astfold_expr, expr, node_->v.ClassDef.decorator_list); in astfold_stmt()
684 CALL_OPT(astfold_expr, expr_ty, node_->v.Return.value); in astfold_stmt()
687 CALL_SEQ(astfold_expr, expr, node_->v.Delete.targets); in astfold_stmt()
690 CALL_SEQ(astfold_expr, expr, node_->v.Assign.targets); in astfold_stmt()
691 CALL(astfold_expr, expr_ty, node_->v.Assign.value); in astfold_stmt()
694 CALL(astfold_expr, expr_ty, node_->v.AugAssign.target); in astfold_stmt()
695 CALL(astfold_expr, expr_ty, node_->v.AugAssign.value); in astfold_stmt()
698 CALL(astfold_expr, expr_ty, node_->v.AnnAssign.target); in astfold_stmt()
700 CALL(astfold_expr, expr_ty, node_->v.AnnAssign.annotation); in astfold_stmt()
702 CALL_OPT(astfold_expr, expr_ty, node_->v.AnnAssign.value); in astfold_stmt()
705 CALL(astfold_expr, expr_ty, node_->v.For.target); in astfold_stmt()
706 CALL(astfold_expr, expr_ty, node_->v.For.iter); in astfold_stmt()
707 CALL_SEQ(astfold_stmt, stmt, node_->v.For.body); in astfold_stmt()
708 CALL_SEQ(astfold_stmt, stmt, node_->v.For.orelse); in astfold_stmt()
710 CALL(fold_iter, expr_ty, node_->v.For.iter); in astfold_stmt()
713 CALL(astfold_expr, expr_ty, node_->v.AsyncFor.target); in astfold_stmt()
714 CALL(astfold_expr, expr_ty, node_->v.AsyncFor.iter); in astfold_stmt()
715 CALL_SEQ(astfold_stmt, stmt, node_->v.AsyncFor.body); in astfold_stmt()
716 CALL_SEQ(astfold_stmt, stmt, node_->v.AsyncFor.orelse); in astfold_stmt()
719 CALL(astfold_expr, expr_ty, node_->v.While.test); in astfold_stmt()
720 CALL_SEQ(astfold_stmt, stmt, node_->v.While.body); in astfold_stmt()
721 CALL_SEQ(astfold_stmt, stmt, node_->v.While.orelse); in astfold_stmt()
724 CALL(astfold_expr, expr_ty, node_->v.If.test); in astfold_stmt()
725 CALL_SEQ(astfold_stmt, stmt, node_->v.If.body); in astfold_stmt()
726 CALL_SEQ(astfold_stmt, stmt, node_->v.If.orelse); in astfold_stmt()
729 CALL_SEQ(astfold_withitem, withitem, node_->v.With.items); in astfold_stmt()
730 CALL_SEQ(astfold_stmt, stmt, node_->v.With.body); in astfold_stmt()
733 CALL_SEQ(astfold_withitem, withitem, node_->v.AsyncWith.items); in astfold_stmt()
734 CALL_SEQ(astfold_stmt, stmt, node_->v.AsyncWith.body); in astfold_stmt()
737 CALL_OPT(astfold_expr, expr_ty, node_->v.Raise.exc); in astfold_stmt()
738 CALL_OPT(astfold_expr, expr_ty, node_->v.Raise.cause); in astfold_stmt()
741 CALL_SEQ(astfold_stmt, stmt, node_->v.Try.body); in astfold_stmt()
742 CALL_SEQ(astfold_excepthandler, excepthandler, node_->v.Try.handlers); in astfold_stmt()
743 CALL_SEQ(astfold_stmt, stmt, node_->v.Try.orelse); in astfold_stmt()
744 CALL_SEQ(astfold_stmt, stmt, node_->v.Try.finalbody); in astfold_stmt()
747 CALL(astfold_expr, expr_ty, node_->v.Assert.test); in astfold_stmt()
748 CALL_OPT(astfold_expr, expr_ty, node_->v.Assert.msg); in astfold_stmt()
751 CALL(astfold_expr, expr_ty, node_->v.Expr.value); in astfold_stmt()
754 CALL(astfold_expr, expr_ty, node_->v.Match.subject); in astfold_stmt()
755 CALL_SEQ(astfold_match_case, match_case, node_->v.Match.cases); in astfold_stmt()
774 astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_excepthandler() argument
776 switch (node_->kind) { in astfold_excepthandler()
778 CALL_OPT(astfold_expr, expr_ty, node_->v.ExceptHandler.type); in astfold_excepthandler()
779 CALL_SEQ(astfold_stmt, stmt, node_->v.ExceptHandler.body); in astfold_excepthandler()
788 astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_withitem() argument
790 CALL(astfold_expr, expr_ty, node_->context_expr); in astfold_withitem()
791 CALL_OPT(astfold_expr, expr_ty, node_->optional_vars); in astfold_withitem()
796 astfold_pattern(pattern_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_pattern() argument
806 switch (node_->kind) { in astfold_pattern()
808 CALL(astfold_expr, expr_ty, node_->v.MatchValue.value); in astfold_pattern()
813 CALL_SEQ(astfold_pattern, pattern, node_->v.MatchSequence.patterns); in astfold_pattern()
816 CALL_SEQ(astfold_expr, expr, node_->v.MatchMapping.keys); in astfold_pattern()
817 CALL_SEQ(astfold_pattern, pattern, node_->v.MatchMapping.patterns); in astfold_pattern()
820 CALL(astfold_expr, expr_ty, node_->v.MatchClass.cls); in astfold_pattern()
821 CALL_SEQ(astfold_pattern, pattern, node_->v.MatchClass.patterns); in astfold_pattern()
822 CALL_SEQ(astfold_pattern, pattern, node_->v.MatchClass.kwd_patterns); in astfold_pattern()
827 if (node_->v.MatchAs.pattern) { in astfold_pattern()
828 CALL(astfold_pattern, pattern_ty, node_->v.MatchAs.pattern); in astfold_pattern()
832 CALL_SEQ(astfold_pattern, pattern, node_->v.MatchOr.patterns); in astfold_pattern()
842 astfold_match_case(match_case_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) in astfold_match_case() argument
844 CALL(astfold_pattern, expr_ty, node_->pattern); in astfold_match_case()
845 CALL_OPT(astfold_expr, expr_ty, node_->guard); in astfold_match_case()
846 CALL_SEQ(astfold_stmt, stmt, node_->body); in astfold_match_case()