fn resolve_case_or_default(
    switch_case: &pt::YulSwitchOptions,
    default_block: &mut Option<YulBlock>,
    case_blocks: &mut Vec<CaseBlock>,
    context: &ExprContext,
    reachable: bool,
    function_table: &mut FunctionsTable,
    loop_scope: &mut LoopScopes,
    symtable: &mut Symtable,
    ns: &mut Namespace,
) -> Result<bool, ()> {
    match switch_case {
        YulSwitchOptions::Case(loc, expr, block) => {
            let resolved_case = resolve_case_block(
                loc,
                default_block.is_some(),
                expr,
                &block.statements,
                context,
                reachable,
                function_table,
                loop_scope,
                symtable,
                ns,
            )?;
            case_blocks.push(resolved_case.0);
            Ok(resolved_case.1)
        }

        YulSwitchOptions::Default(loc, block) => {
            let resolved_default = resolve_yul_block(
                loc,
                &block.statements,
                context,
                reachable,
                loop_scope,
                function_table,
                symtable,
                ns,
            );
            *default_block = Some(resolved_default.0);
            Ok(resolved_default.1)
        }
    }
}
/// Resolve case or default from a switch statements
Resolve case or default from a switch statements
Resolve case or default from a switch statements
fn resolve_case_or_default(
    switch_case: &pt::YulSwitchOptions,
    default_block: &mut Option<YulBlock>,
    case_blocks: &mut Vec<CaseBlock>,
    context: &ExprContext,
    reachable: bool,
    function_table: &mut FunctionsTable,
    loop_scope: &mut LoopScopes,
    symtable: &mut Symtable,
    ns: &mut Namespace,
) -> Result<bool, ()> {
    match switch_case {
        YulSwitchOptions::Case(loc, expr, block) => {
            let resolved_case = resolve_case_block(
                loc,
                default_block.is_some(),
                expr,
                &block.statements,
                context,
                reachable,
                function_table,
                loop_scope,
                symtable,
                ns,
            )?;
            case_blocks.push(resolved_case.0);
            Ok(resolved_case.1)
        }
        YulSwitchOptions::Default(loc, block) => {
            let resolved_default = resolve_yul_block(
                loc,
                &block.statements,
                context,
                reachable,
                loop_scope,
                function_table,
                symtable,
                ns,
            );
            *default_block = Some(resolved_default.0);
            Ok(resolved_default.1)
        }
    }
}
fn resolve_case_or_default ( switch_case : & pt :: YulSwitchOptions , default_block : & mut Option < YulBlock > , case_blocks : & mut Vec < CaseBlock > , context : & ExprContext , reachable : bool , function_table : & mut FunctionsTable , loop_scope : & mut LoopScopes , symtable : & mut Symtable , ns : & mut Namespace , ) -> Result < bool , ( ) > { match switch_case { YulSwitchOptions :: Case ( loc , expr , block ) => { let resolved_case = resolve_case_block ( loc , default_block . is_some ( ) , expr , & block . statements , context , reachable , function_table , loop_scope , symtable , ns , ) ? ; case_blocks . push ( resolved_case . 0 ) ; Ok ( resolved_case . 1 ) } YulSwitchOptions :: Default ( loc , block ) => { let resolved_default = resolve_yul_block ( loc , & block . statements , context , reachable , loop_scope , function_table , symtable , ns , ) ; * default_block = Some ( resolved_default . 0 ) ; Ok ( resolved_default . 1 ) } } }
Resolve case or default from a switch statements
Resolve case or default from a switch statements
switch_case
&pt::YulSwitchOptions
default_block
&mut Option<YulBlock>
case_blocks
&mut Vec<CaseBlock>
context
&ExprContext
reachable
bool
function_table
&mut FunctionsTable
loop_scope
&mut LoopScopes
symtable
&mut Symtable
ns
&mut Namespace
switch_case
&pt::YulSwitchOptions
default_block
&mut Option<YulBlock>
case_blocks
&mut Vec<CaseBlock>
context
&ExprContext
reachable
bool
function_table
&mut FunctionsTable
loop_scope
&mut LoopScopes
symtable
&mut Symtable
ns
&mut Namespace