pub fn add_constant(&mut self, value_rr: Rc<RefCell<Value>>) -> i32 {
        let value_rrb = value_rr.borrow();
        let value_sd = match &*value_rrb {
            Value::Null => ValueSD::Null,
            Value::Int(n) => ValueSD::Int(*n),
            Value::Float(n) => ValueSD::Float(*n),
            Value::BigInt(n) => ValueSD::BigInt(n.to_str_radix(10)),
            Value::String(s, _) => ValueSD::String(s.to_string()),
            Value::Command(s) => ValueSD::Command(s.to_string()),
            Value::CommandUncaptured(s) => {
                ValueSD::CommandUncaptured(s.to_string())
            }
            _ => {
                eprintln!("constant type cannot be added to chunk! {:?}",
                          value_rrb);
                std::process::abort();
            }
        };
        self.constants.push(value_sd);
        return (self.constants.len() - 1) as i32;
    }
/// Add a constant to the current chunk, and return its index in
/// the constants list (for later calls to `get_constant`).
Add a constant to the current chunk, and return its index in
the constants list (for later calls to `get_constant`).
Add a constant to the current chunk and return its index in the constants list ( for later calls to ` get_constant ` ) .
pub fn add_constant(&mut self, value_rr: Rc<RefCell<Value>>) -> i32 {
        let value_rrb = value_rr.borrow();
        let value_sd = match &*value_rrb {
            Value::Null => ValueSD::Null,
            Value::Int(n) => ValueSD::Int(*n),
            Value::Float(n) => ValueSD::Float(*n),
            Value::BigInt(n) => ValueSD::BigInt(n.to_str_radix(10)),
            Value::String(s, _) => ValueSD::String(s.to_string()),
            Value::Command(s) => ValueSD::Command(s.to_string()),
            Value::CommandUncaptured(s) => {
                ValueSD::CommandUncaptured(s.to_string())
            }
            _ => {
                eprintln!("constant type cannot be added to chunk! {:?}",
                          value_rrb);
                std::process::abort();
            }
        };
        self.constants.push(value_sd);
        return (self.constants.len() - 1) as i32;
    }
pub fn add_constant ( & mut self , value_rr : Rc < RefCell < Value > > ) -> i32 { let value_rrb = value_rr . borrow ( ) ; let value_sd = match & * value_rrb { Value :: Null => ValueSD :: Null , Value :: Int ( n ) => ValueSD :: Int ( * n ) , Value :: Float ( n ) => ValueSD :: Float ( * n ) , Value :: BigInt ( n ) => ValueSD :: BigInt ( n . to_str_radix ( 10 ) ) , Value :: String ( s , _ ) => ValueSD :: String ( s . to_string ( ) ) , Value :: Command ( s ) => ValueSD :: Command ( s . to_string ( ) ) , Value :: CommandUncaptured ( s ) => { ValueSD :: CommandUncaptured ( s . to_string ( ) ) } _ => { eprintln ! ( " " value_rrb ) ; std :: process :: abort ( ) ; } } ; self . constants . push ( value_sd ) ; return ( self . constants . len ( ) - 1 ) as i32 ; }
Add a constant to the current chunk, and return its index in
the constants list (for later calls to `get_constant`).
Add a constant to the current chunk and return its index in the constants list ( for later calls to ` get_constant ` ) .
&mut self
value_rr
Rc<RefCell<Value>>