@@ -2695,130 +2695,231 @@ pub fn (node Node) children() []Node {
26952695 mut children := []Node{}
26962696 if node is Expr {
26972697 match node {
2698- Assoc, ArrayInit {
2699- return node.exprs.map (Node (it ))
2698+ Assoc {
2699+ assoc := node
2700+ return assoc.exprs.map (Node (it ))
2701+ }
2702+ ArrayInit {
2703+ array_init := node
2704+ return array_init.exprs.map (Node (it ))
27002705 }
27012706 StringInterLiteral {
2702- children << node.exprs.map (Node (it ))
2703- for expr in node.fwidth_exprs {
2707+ string_inter_literal := node
2708+ children << string_inter_literal.exprs.map (Node (it ))
2709+ for expr in string_inter_literal.fwidth_exprs {
27042710 if expr ! is EmptyExpr {
27052711 children << expr
27062712 }
27072713 }
2708- for expr in node .precision_exprs {
2714+ for expr in string_inter_literal .precision_exprs {
27092715 if expr ! is EmptyExpr {
27102716 children << expr
27112717 }
27122718 }
27132719 return children
27142720 }
2715- SelectorExpr, PostfixExpr, UnsafeExpr, AsCast, ParExpr, IfGuardExpr, SizeOf, Likely,
2716- TypeOf, ArrayDecompose {
2717- children << node.expr
2721+ SelectorExpr {
2722+ selector_expr := node
2723+ children << selector_expr.expr
2724+ }
2725+ PostfixExpr {
2726+ postfix_expr := node
2727+ children << postfix_expr.expr
2728+ }
2729+ UnsafeExpr {
2730+ unsafe_expr := node
2731+ children << unsafe_expr.expr
2732+ }
2733+ AsCast {
2734+ as_cast := node
2735+ children << as_cast.expr
2736+ }
2737+ ParExpr {
2738+ par_expr := node
2739+ children << par_expr.expr
2740+ }
2741+ IfGuardExpr {
2742+ if_guard_expr := node
2743+ children << if_guard_expr.expr
2744+ }
2745+ SizeOf {
2746+ size_of := node
2747+ children << size_of.expr
2748+ }
2749+ Likely {
2750+ likely_expr := node
2751+ children << likely_expr.expr
2752+ }
2753+ TypeOf {
2754+ type_of := node
2755+ children << type_of.expr
2756+ }
2757+ ArrayDecompose {
2758+ array_decompose := node
2759+ children << array_decompose.expr
27182760 }
27192761 LambdaExpr {
2720- for p in node.params {
2762+ lambda_expr := node
2763+ for p in lambda_expr.params {
27212764 children << Node (Expr (p))
27222765 }
2723- children << node .expr
2766+ children << lambda_expr .expr
27242767 }
2725- LockExpr, OrExpr {
2726- return node.stmts.map (Node (it ))
2768+ LockExpr {
2769+ lock_expr := node
2770+ return lock_expr.stmts.map (Node (it ))
2771+ }
2772+ OrExpr {
2773+ or_expr := node
2774+ return or_expr.stmts.map (Node (it ))
27272775 }
27282776 StructInit {
2729- return node.init_fields.map (Node (it ))
2777+ struct_init := node
2778+ return struct_init.init_fields.map (Node (it ))
27302779 }
27312780 AnonFn {
2732- children << Stmt (node.decl)
2781+ anon_fn := node
2782+ children << Stmt (anon_fn.decl)
27332783 }
27342784 CallExpr {
2735- children << node.left
2736- children << node.args.map (Node (it ))
2737- children << Expr (node.or_block)
2785+ call_expr := node
2786+ children << call_expr.left
2787+ children << call_expr.args.map (Node (it ))
2788+ children << Expr (call_expr.or_block)
27382789 }
27392790 InfixExpr {
2740- children << node.left
2741- children << node.right
2791+ infix_expr := node
2792+ children << infix_expr.left
2793+ children << infix_expr.right
27422794 }
27432795 PrefixExpr {
2744- children << node.right
2796+ prefix_expr := node
2797+ children << prefix_expr.right
27452798 }
27462799 IndexExpr {
2747- children << node.left
2748- children << node.index
2800+ index_expr := node
2801+ children << index_expr.left
2802+ children << index_expr.index
27492803 }
27502804 IfExpr {
2751- children << node.left
2752- children << node.branches.map (Node (it ))
2805+ if_expr := node
2806+ children << if_expr.left
2807+ children << if_expr.branches.map (Node (it ))
27532808 }
27542809 MatchExpr {
2755- children << node.cond
2756- children << node.branches.map (Node (it ))
2810+ match_expr := node
2811+ children << match_expr.cond
2812+ children << match_expr.branches.map (Node (it ))
27572813 }
27582814 SelectExpr {
2759- return node.branches.map (Node (it ))
2815+ select_expr := node
2816+ return select_expr.branches.map (Node (it ))
27602817 }
27612818 ChanInit {
2762- children << node.cap_expr
2819+ chan_init := node
2820+ children << chan_init.cap_expr
27632821 }
27642822 MapInit {
2765- children << node.keys.map (Node (it ))
2766- children << node.vals.map (Node (it ))
2823+ map_init := node
2824+ children << map_init.keys.map (Node (it ))
2825+ children << map_init.vals.map (Node (it ))
27672826 }
27682827 RangeExpr {
2769- children << node.low
2770- children << node.high
2828+ range_expr := node
2829+ children << range_expr.low
2830+ children << range_expr.high
27712831 }
27722832 CastExpr {
2773- children << node.expr
2774- children << node.arg
2833+ cast_expr := node
2834+ children << cast_expr.expr
2835+ children << cast_expr.arg
27752836 }
27762837 ConcatExpr {
2777- return node.vals.map (Node (it ))
2838+ concat_expr := node
2839+ return concat_expr.vals.map (Node (it ))
2840+ }
2841+ ComptimeCall {
2842+ comptime_call := node
2843+ children << comptime_call.left
27782844 }
2779- ComptimeCall, ComptimeSelector {
2780- children << node.left
2845+ ComptimeSelector {
2846+ comptime_selector := node
2847+ children << comptime_selector.left
27812848 }
27822849 else {}
27832850 }
27842851 } else if node is Stmt {
27852852 match node {
2786- Block, DeferStmt, ForCStmt, ForInStmt, ForStmt, ComptimeFor {
2787- return node.stmts.map (Node (it ))
2853+ Block {
2854+ block := node
2855+ return block.stmts.map (Node (it ))
2856+ }
2857+ DeferStmt {
2858+ defer_stmt := node
2859+ return defer_stmt.stmts.map (Node (it ))
27882860 }
2789- ExprStmt, AssertStmt {
2790- children << node.expr
2861+ ForCStmt {
2862+ for_c_stmt := node
2863+ return for_c_stmt.stmts.map (Node (it ))
2864+ }
2865+ ForInStmt {
2866+ for_in_stmt := node
2867+ return for_in_stmt.stmts.map (Node (it ))
2868+ }
2869+ ForStmt {
2870+ for_stmt := node
2871+ return for_stmt.stmts.map (Node (it ))
2872+ }
2873+ ComptimeFor {
2874+ comptime_for := node
2875+ return comptime_for.stmts.map (Node (it ))
2876+ }
2877+ ExprStmt {
2878+ expr_stmt := node
2879+ children << expr_stmt.expr
2880+ }
2881+ AssertStmt {
2882+ assert_stmt := node
2883+ children << assert_stmt.expr
27912884 }
27922885 InterfaceDecl {
2793- children << node.methods.map (Node (Stmt (it )))
2794- children << node.fields.map (Node (it ))
2886+ interface_decl := node
2887+ children << interface_decl.methods.map (Node (Stmt (it )))
2888+ children << interface_decl.fields.map (Node (it ))
27952889 }
27962890 AssignStmt {
2797- children << node.left.map (Node (it ))
2798- children << node.right.map (Node (it ))
2891+ assign_stmt := node
2892+ children << assign_stmt.left.map (Node (it ))
2893+ children << assign_stmt.right.map (Node (it ))
27992894 }
28002895 Return {
2801- return node.exprs.map (Node (it ))
2896+ return_stmt := node
2897+ return return_stmt.exprs.map (Node (it ))
28022898 }
28032899 // Note: these four decl nodes cannot be merged as one branch
28042900 StructDecl {
2805- return node.fields.map (Node (it ))
2901+ struct_decl := node
2902+ return struct_decl.fields.map (Node (it ))
28062903 }
28072904 GlobalDecl {
2808- return node.fields.map (Node (it ))
2905+ global_decl := node
2906+ return global_decl.fields.map (Node (it ))
28092907 }
28102908 ConstDecl {
2811- return node.fields.map (Node (it ))
2909+ const_decl := node
2910+ return const_decl.fields.map (Node (it ))
28122911 }
28132912 EnumDecl {
2814- return node.fields.map (Node (it ))
2913+ enum_decl := node
2914+ return enum_decl.fields.map (Node (it ))
28152915 }
28162916 FnDecl {
2817- if node.is_method {
2818- children << Node (node.receiver)
2917+ fn_decl := node
2918+ if fn_decl.is_method {
2919+ children << Node (fn_decl.receiver)
28192920 }
2820- children << node .params.map (Node (it ))
2821- children << node .stmts.map (Node (it ))
2921+ children << fn_decl .params.map (Node (it ))
2922+ children << fn_decl .stmts.map (Node (it ))
28222923 }
28232924 TypeDecl {
28242925 if node is SumTypeDecl {
@@ -2829,24 +2930,59 @@ pub fn (node Node) children() []Node {
28292930 }
28302931 } else if node is ScopeObject {
28312932 match node {
2832- GlobalField, ConstField, Var { children << node.expr }
2933+ GlobalField {
2934+ global_field := node
2935+ children << global_field.expr
2936+ }
2937+ ConstField {
2938+ const_field := node
2939+ children << const_field.expr
2940+ }
2941+ Var {
2942+ var_ := node
2943+ children << var_.expr
2944+ }
28332945 AsmRegister, EmptyScopeObject {}
28342946 }
28352947 } else {
28362948 match node {
2837- GlobalField, ConstField, EnumField, StructInitField, CallArg {
2838- children << node.expr
2949+ GlobalField {
2950+ global_field := node
2951+ children << global_field.expr
2952+ }
2953+ ConstField {
2954+ const_field := node
2955+ children << const_field.expr
2956+ }
2957+ EnumField {
2958+ enum_field := node
2959+ children << enum_field.expr
2960+ }
2961+ StructInitField {
2962+ struct_init_field := node
2963+ children << struct_init_field.expr
2964+ }
2965+ CallArg {
2966+ call_arg := node
2967+ children << call_arg.expr
28392968 }
28402969 SelectBranch {
2841- children << node.stmt
2842- children << node.stmts.map (Node (it ))
2970+ select_branch := node
2971+ children << select_branch.stmt
2972+ children << select_branch.stmts.map (Node (it ))
2973+ }
2974+ IfBranch {
2975+ if_branch := node
2976+ return if_branch.stmts.map (Node (it ))
28432977 }
2844- IfBranch, File {
2845- return node.stmts.map (Node (it ))
2978+ File {
2979+ file := node
2980+ return file.stmts.map (Node (it ))
28462981 }
28472982 MatchBranch {
2848- children << node.stmts.map (Node (it ))
2849- children << node.exprs.map (Node (it ))
2983+ match_branch := node
2984+ children << match_branch.stmts.map (Node (it ))
2985+ children << match_branch.exprs.map (Node (it ))
28502986 }
28512987 else {}
28522988 }
0 commit comments