fn maketree_metadata(
    pos: &Pos,
    splices: &[Expr],
    functions: &[Expr],
    static_methods: &[Expr],
) -> Expr {
    let key_value_pairs = splices
        .iter()
        .enumerate()
        .map(|(i, expr)| {
            let key = Expr::new(
                (),
                expr.1.clone(),
                Expr_::String(BString::from(temp_splice_lvar_string(i))),
            );
            let value = temp_splice_lvar(&expr.1, i);
            (key, value)
        })
        .collect();
    let splices_dict = dict_literal(pos, key_value_pairs);

    let function_vars = functions
        .iter()
        .enumerate()
        .map(|(i, expr)| temp_function_pointer_lvar(&expr.1, i))
        .collect();
    let functions_vec = vec_literal_with_pos(&pos, function_vars);

    let static_method_vars = static_methods
        .iter()
        .enumerate()
        .map(|(i, expr)| temp_static_method_lvar(&expr.1, i))
        .collect();
    let static_method_vec = vec_literal_with_pos(&pos, static_method_vars);

    shape_literal(
        pos,
        vec![
            ("splices", splices_dict),
            ("functions", functions_vec),
            ("static_methods", static_method_vec),
        ],
    )
}
/// Return a shape literal that describes the values inside this
/// expression tree literal. For example, given the expression tree:
///
///     $et = Code`${ $x } + foo() + Bar::baz()`;
///
/// The metadata is:
///
///     shape(
///       // Simplified: We actually use a temporary variable whose value is $x.
///       'splices' => dict['$0splice0' => $x],
///
///       'functions' => vec[foo<>],
///       'static_methods' => vec[Bar::baz<>],
///     )
Return a shape literal that describes the values inside this
expression tree literal. For example, given the expression tree.



The metadata is.

shape(
Simplified: We actually use a temporary variable whose value is $x.


Return a shape literal that describes the values inside this expression tree literal . For example given the expression tree . The metadata is . shape ( Simplified : We actually use a temporary variable whose value is $x .
fn maketree_metadata(
    pos: &Pos,
    splices: &[Expr],
    functions: &[Expr],
    static_methods: &[Expr],
) -> Expr {
    let key_value_pairs = splices
        .iter()
        .enumerate()
        .map(|(i, expr)| {
            let key = Expr::new(
                (),
                expr.1.clone(),
                Expr_::String(BString::from(temp_splice_lvar_string(i))),
            );
            let value = temp_splice_lvar(&expr.1, i);
            (key, value)
        })
        .collect();
    let splices_dict = dict_literal(pos, key_value_pairs);
    let function_vars = functions
        .iter()
        .enumerate()
        .map(|(i, expr)| temp_function_pointer_lvar(&expr.1, i))
        .collect();
    let functions_vec = vec_literal_with_pos(&pos, function_vars);
    let static_method_vars = static_methods
        .iter()
        .enumerate()
        .map(|(i, expr)| temp_static_method_lvar(&expr.1, i))
        .collect();
    let static_method_vec = vec_literal_with_pos(&pos, static_method_vars);
    shape_literal(
        pos,
        vec![
            ("splices", splices_dict),
            ("functions", functions_vec),
            ("static_methods", static_method_vec),
        ],
    )
}
fn maketree_metadata ( pos : & Pos , splices : & [ Expr ] , functions : & [ Expr ] , static_methods : & [ Expr ] , ) -> Expr { let key_value_pairs = splices . iter ( ) . enumerate ( ) . map ( | ( i , expr ) | { let key = Expr :: new ( ( ) , expr . 1 . clone ( ) , Expr_ :: String ( BString :: from ( temp_splice_lvar_string ( i ) ) ) , ) ; let value = temp_splice_lvar ( & expr . 1 , i ) ; ( key , value ) } ) . collect ( ) ; let splices_dict = dict_literal ( pos , key_value_pairs ) ; let function_vars = functions . iter ( ) . enumerate ( ) . map ( | ( i , expr ) | temp_function_pointer_lvar ( & expr . 1 , i ) ) . collect ( ) ; let functions_vec = vec_literal_with_pos ( & pos , function_vars ) ; let static_method_vars = static_methods . iter ( ) . enumerate ( ) . map ( | ( i , expr ) | temp_static_method_lvar ( & expr . 1 , i ) ) . collect ( ) ; let static_method_vec = vec_literal_with_pos ( & pos , static_method_vars ) ; shape_literal ( pos , vec ! [ ( " " splices_dict ) ( " " functions_vec ) ( " " static_method_vec ) ] , ) }
Return a shape literal that describes the values inside this
expression tree literal.
Return a shape literal that describes the values inside this expression tree literal .
pos
&Pos
splices
&[Expr]
functions
&[Expr]
static_methods
&[Expr]
pos
&Pos
splices
&[Expr]
functions
&[Expr]
static_methods
&[Expr]