fn gen_pu_methods(class_name: &str, extends: bool, instance: Tast::PuEnum) -> Vec<Tast::Method_> {
    let is_final = instance.is_final;
    let pu_members = instance.members;
    let ast_defs::Id(pos, instance_name) = instance.name.clone();
    let infos = process_class_enum(pu_members.clone());
    let m_members = if extends {
        gen_members_extends(&instance_name, pos.clone(), pu_members)
    } else {
        gen_members_no_extends(&instance_name, pos.clone(), pu_members)
    };
    let acc = infos
        .into_iter()
        .map(|(key, info)| {
            let fun_name = pu_name_mangle(&instance_name, &key);
            let error = error_msg(&class_name, &instance_name, &key);
            gen_pu_accessor(fun_name, pos.clone(), is_final, extends, info, error)
        })
        .chain(std::iter::once(m_members))
        .collect::<Vec<_>>();

    // TODO(hrust)(vsiles)
    // I'm keeping this around until I can test it to understand what's happening. Will remove
    // the loop version once tests are done
    // let mut acc = vec![];
    // for (key, info) in infos.iter() {
    //     let fun_name = gen_fun_name(field_name, key);
    //     let error = error_msg(class_name, field_name, key);
    //     let accessor = gen_pu_accessor(fun_name, pos.clone(), is_final, extends, info, error);
    //     acc.push(accessor);
    // }
    // let fun_members = gen_members(field);
    // acc.push(fun_members);
    // acc.reverse();
    acc
}
/* Returns the generated methods (accessors + Members) */
Returns the generated methods (accessors + Members)
Returns the generated methods ( accessors + Members )
fn gen_pu_methods(class_name: &str, extends: bool, instance: Tast::PuEnum) -> Vec<Tast::Method_> {
    let is_final = instance.is_final;
    let pu_members = instance.members;
    let ast_defs::Id(pos, instance_name) = instance.name.clone();
    let infos = process_class_enum(pu_members.clone());
    let m_members = if extends {
        gen_members_extends(&instance_name, pos.clone(), pu_members)
    } else {
        gen_members_no_extends(&instance_name, pos.clone(), pu_members)
    };
    let acc = infos
        .into_iter()
        .map(|(key, info)| {
            let fun_name = pu_name_mangle(&instance_name, &key);
            let error = error_msg(&class_name, &instance_name, &key);
            gen_pu_accessor(fun_name, pos.clone(), is_final, extends, info, error)
        })
        .chain(std::iter::once(m_members))
        .collect::<Vec<_>>();
    // TODO(hrust)(vsiles)
    // I'm keeping this around until I can test it to understand what's happening. Will remove
    // the loop version once tests are done
    // let mut acc = vec![];
    // for (key, info) in infos.iter() {
    //     let fun_name = gen_fun_name(field_name, key);
    //     let error = error_msg(class_name, field_name, key);
    //     let accessor = gen_pu_accessor(fun_name, pos.clone(), is_final, extends, info, error);
    //     acc.push(accessor);
    // }
    // let fun_members = gen_members(field);
    // acc.push(fun_members);
    // acc.reverse();
    acc
}
fn gen_pu_methods ( class_name : & str , extends : bool , instance : Tast :: PuEnum ) -> Vec < Tast :: Method_ > { let is_final = instance . is_final ; let pu_members = instance . members ; let ast_defs :: Id ( pos , instance_name ) = instance . name . clone ( ) ; let infos = process_class_enum ( pu_members . clone ( ) ) ; let m_members = if extends { gen_members_extends ( & instance_name , pos . clone ( ) , pu_members ) } else { gen_members_no_extends ( & instance_name , pos . clone ( ) , pu_members ) } ; let acc = infos . into_iter ( ) . map ( | ( key , info ) | { let fun_name = pu_name_mangle ( & instance_name , & key ) ; let error = error_msg ( & class_name , & instance_name , & key ) ; gen_pu_accessor ( fun_name , pos . clone ( ) , is_final , extends , info , error ) } ) . chain ( std :: iter :: once ( m_members ) ) . collect :: < Vec < _ > > ( ) ; // TODO(hrust)(vsiles) // I'm keeping this around until I can test it to understand what's happening. Will remove // the loop version once tests are done // let mut acc = vec![]; // for (key, info) in infos.iter() { //     let fun_name = gen_fun_name(field_name, key); //     let error = error_msg(class_name, field_name, key); //     let accessor = gen_pu_accessor(fun_name, pos.clone(), is_final, extends, info, error); //     acc.push(accessor); // } // let fun_members = gen_members(field); // acc.push(fun_members); // acc.reverse(); acc }
Returns the generated methods (accessors + Members)
Returns the generated methods ( accessors + Members )
class_name
&str
extends
bool
instance
Tast::PuEnum