/// Returns an INIT instruction with default parameters.
/// 
/// Does not allow for conditionals. NOT returns a no-op.
Returns an INIT instruction with default parameters.
Does not allow for conditionals. NOT returns a no-op.
Returns an INIT instruction with default parameters . Does not allow for conditionals . NOT returns a no - op .
fn generic_partial<'a>(
    statement: &'a Statement,
    target: &str,
    partial_factory: &dyn Fn(usize) -> Instruction,
) -> Instruction {
    let conds = conditions(statement);
    if let Noun::Identifier(id) = statement.subject {
        if let (None, None) = conds {
            if !statement.action_sign {
                partial_factory(id)
            }
            else {
                // NOT YOU/GROUP/TELE is a no-op
                Instruction::NoOp
            }
        }
        else {
            throw_error(
                ErrorType::InstructionValidationError, 
                format!("IS {} cannot be called with conditions", target),
                None
            );
            Instruction::NoOp
        }
    }
    else {
        throw_error(
            ErrorType::InstructionValidationError, 
            format!("Cannot initialize {:?} as {}", statement.subject, target),
            None
        );
        Instruction::NoOp
    }
}
fn generic_partial < ' a > ( statement : & ' a Statement , target : & str , partial_factory : & dyn Fn ( usize ) -> Instruction , ) -> Instruction { let conds = conditions ( statement ) ; if let Noun :: Identifier ( id ) = statement . subject { if let ( None , None ) = conds { if ! statement . action_sign { partial_factory ( id ) } else { // NOT YOU/GROUP/TELE is a no-op Instruction :: NoOp } } else { throw_error ( ErrorType :: InstructionValidationError , format ! ( " " target ) , None ) ; Instruction :: NoOp } } else { throw_error ( ErrorType :: InstructionValidationError , format ! ( " " statement subject target ) , None ) ; Instruction :: NoOp } }
Returns an INIT instruction with default parameters.
Returns an INIT instruction with default parameters .
statement
&'a Statement
target
&str
partial_factory
&dyn Fn(usize) -> Instruction