pub(super) fn collect<'a>(is: &'a InstrSeq, jt_gen: &mut jt::Gen) -> JumpInstructions<'a> {
        fn get_label_id(jt_gen: &mut jt::Gen, is_break: bool, level: Level) -> label::Id {
            use jt::ResolvedJumpTarget::*;
            match jt_gen.jump_targets().get_target_for_level(is_break, level) {
                ResolvedRegular(target_label, _)
                | ResolvedTryFinally(jt::ResolvedTryFinally { target_label, .. }) => {
                    jt_gen.get_id_for_label(target_label)
                }
                _ => panic!("impossible"),
            }
        }
        JumpInstructions(is.fold_left(
            &mut |mut acc: LabelMap<'a>, i| {
                use hhbc_ast::Instruct::*;
                use hhbc_ast::InstructControlFlow::{RetC, RetCSuspended, RetM};
                use hhbc_ast::InstructSpecialFlow::{Break, Continue, Goto};
                match i {
                    &ISpecialFlow(Break(level)) => {
                        acc.insert(get_label_id(jt_gen, true, level as Level), i);
                    }
                    &ISpecialFlow(Continue(level)) => {
                        acc.insert(get_label_id(jt_gen, false, level as Level), i);
                    }
                    &IContFlow(ref cont_flow) => match cont_flow {
                        RetC | RetCSuspended | RetM(_) => {
                            acc.insert(jt_gen.get_id_for_return(), i);
                        }
                        _ => {}
                    },
                    &ISpecialFlow(Goto(ref l)) => {
                        acc.insert(jt_gen.get_id_for_label(Label::Named(l.clone())), i);
                    }
                    _ => {}
                };
                acc
            },
            LabelMap::new(),
        ))
    }
/// Collects list of Ret* and non rewritten Break/Continue instructions inside try body.
Collects list of Ret* and non rewritten Break/Continue instructions inside try body.
Collects list of Ret * and non rewritten Break / Continue instructions inside try body .
pub(super) fn collect<'a>(is: &'a InstrSeq, jt_gen: &mut jt::Gen) -> JumpInstructions<'a> {
        fn get_label_id(jt_gen: &mut jt::Gen, is_break: bool, level: Level) -> label::Id {
            use jt::ResolvedJumpTarget::*;
            match jt_gen.jump_targets().get_target_for_level(is_break, level) {
                ResolvedRegular(target_label, _)
                | ResolvedTryFinally(jt::ResolvedTryFinally { target_label, .. }) => {
                    jt_gen.get_id_for_label(target_label)
                }
                _ => panic!("impossible"),
            }
        }
        JumpInstructions(is.fold_left(
            &mut |mut acc: LabelMap<'a>, i| {
                use hhbc_ast::Instruct::*;
                use hhbc_ast::InstructControlFlow::{RetC, RetCSuspended, RetM};
                use hhbc_ast::InstructSpecialFlow::{Break, Continue, Goto};
                match i {
                    &ISpecialFlow(Break(level)) => {
                        acc.insert(get_label_id(jt_gen, true, level as Level), i);
                    }
                    &ISpecialFlow(Continue(level)) => {
                        acc.insert(get_label_id(jt_gen, false, level as Level), i);
                    }
                    &IContFlow(ref cont_flow) => match cont_flow {
                        RetC | RetCSuspended | RetM(_) => {
                            acc.insert(jt_gen.get_id_for_return(), i);
                        }
                        _ => {}
                    },
                    &ISpecialFlow(Goto(ref l)) => {
                        acc.insert(jt_gen.get_id_for_label(Label::Named(l.clone())), i);
                    }
                    _ => {}
                };
                acc
            },
            LabelMap::new(),
        ))
    }
pub ( super ) fn collect < ' a > ( is : & ' a InstrSeq , jt_gen : & mut jt :: Gen ) -> JumpInstructions < ' a > { fn get_label_id ( jt_gen : & mut jt :: Gen , is_break : bool , level : Level ) -> label :: Id { use jt :: ResolvedJumpTarget :: * ; match jt_gen . jump_targets ( ) . get_target_for_level ( is_break , level ) { ResolvedRegular ( target_label , _ ) | ResolvedTryFinally ( jt :: ResolvedTryFinally { target_label , .. } ) => { jt_gen . get_id_for_label ( target_label ) } _ => panic ! ( " " ) , } } JumpInstructions ( is . fold_left ( & mut | mut acc : LabelMap < ' a > , i | { use hhbc_ast :: Instruct :: * ; use hhbc_ast :: InstructControlFlow :: { RetC , RetCSuspended , RetM } ; use hhbc_ast :: InstructSpecialFlow :: { Break , Continue , Goto } ; match i { & ISpecialFlow ( Break ( level ) ) => { acc . insert ( get_label_id ( jt_gen , true , level as Level ) , i ) ; } & ISpecialFlow ( Continue ( level ) ) => { acc . insert ( get_label_id ( jt_gen , false , level as Level ) , i ) ; } & IContFlow ( ref cont_flow ) => match cont_flow { RetC | RetCSuspended | RetM ( _ ) => { acc . insert ( jt_gen . get_id_for_return ( ) , i ) ; } _ => { } } , & ISpecialFlow ( Goto ( ref l ) ) => { acc . insert ( jt_gen . get_id_for_label ( Label :: Named ( l . clone ( ) ) ) , i ) ; } _ => { } } ; acc } , LabelMap :: new ( ) , ) ) }
Collects list of Ret* and non rewritten Break/Continue instructions inside try body.
Collects list of Ret * and non rewritten Break / Continue instructions inside try body .
is
&'a InstrSeq
jt_gen
&mut jt::Gen