cairo_lang_sierra/extensions/modules/
unconditional_jump.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::extensions::lib_func::{
    BranchSignature, LibfuncSignature, SierraApChange, SignatureSpecializationContext,
};
use crate::extensions::{NoGenericArgsGenericLibfunc, SpecializationError};

#[derive(Default)]
pub struct UnconditionalJumpLibfunc {}
impl NoGenericArgsGenericLibfunc for UnconditionalJumpLibfunc {
    const STR_ID: &'static str = "jump";

    fn specialize_signature(
        &self,
        _context: &dyn SignatureSpecializationContext,
    ) -> Result<LibfuncSignature, SpecializationError> {
        Ok(LibfuncSignature {
            param_signatures: vec![],
            branch_signatures: vec![BranchSignature {
                vars: vec![],
                ap_change: SierraApChange::Known { new_vars_only: true },
            }],
            fallthrough: None,
        })
    }
}