pub fn core_shift_all(
        &mut self,
        scopes: &mut Vec<RefCell<HashMap<String, Rc<RefCell<Value>>>>>,
        global_functions: &mut RefCell<HashMap<String, Chunk>>,
        prev_local_vars_stacks: &mut Vec<Rc<RefCell<Vec<Rc<RefCell<Value>>>>>>,
        chunk: &Chunk, i: usize, line_col: (u32, u32),
        running: Arc<AtomicBool>
    ) -> i32 {
        if self.stack.len() < 1 {
            print_error(chunk, i, "shift-all requires one argument");
            return 0;
        }

        loop {
            let dup_res = self.opcode_dup(chunk, i);
            if dup_res == 0 {
                return 0;
            }
            let shift_res = self.opcode_shift(
                scopes,
                global_functions,
                prev_local_vars_stacks,
                chunk,
                i,
                line_col,
                running.clone(),
            );
            if shift_res == 0 {
                self.stack.pop();
                return 0;
            }
            let is_null;
            {
                let shifted_rr = &self.stack[self.stack.len() - 1];
                let shifted_rrb = shifted_rr.borrow();
                match &*shifted_rrb {
                    Value::Null => {
                        is_null = true;
                    }
                    _ => {
                        is_null = false;
                    }
                }
            }
            if is_null {
                self.stack.pop();
                self.stack.pop();
                break;
            }

            let swap_res = self.opcode_swap(chunk, i);
            if swap_res == 0 {
                return 0;
            }
        }
        return 1;
    }
/// Takes a shiftable object as its single argument, and places
/// copies of all the elements from the list onto the stack, in
/// the order that they are shifted.
Takes a shiftable object as its single argument, and places
copies of all the elements from the list onto the stack, in
the order that they are shifted.
Takes a shiftable object as its single argument and places copies of all the elements from the list onto the stack in the order that they are shifted .
pub fn core_shift_all(
        &mut self,
        scopes: &mut Vec<RefCell<HashMap<String, Rc<RefCell<Value>>>>>,
        global_functions: &mut RefCell<HashMap<String, Chunk>>,
        prev_local_vars_stacks: &mut Vec<Rc<RefCell<Vec<Rc<RefCell<Value>>>>>>,
        chunk: &Chunk, i: usize, line_col: (u32, u32),
        running: Arc<AtomicBool>
    ) -> i32 {
        if self.stack.len() < 1 {
            print_error(chunk, i, "shift-all requires one argument");
            return 0;
        }
        loop {
            let dup_res = self.opcode_dup(chunk, i);
            if dup_res == 0 {
                return 0;
            }
            let shift_res = self.opcode_shift(
                scopes,
                global_functions,
                prev_local_vars_stacks,
                chunk,
                i,
                line_col,
                running.clone(),
            );
            if shift_res == 0 {
                self.stack.pop();
                return 0;
            }
            let is_null;
            {
                let shifted_rr = &self.stack[self.stack.len() - 1];
                let shifted_rrb = shifted_rr.borrow();
                match &*shifted_rrb {
                    Value::Null => {
                        is_null = true;
                    }
                    _ => {
                        is_null = false;
                    }
                }
            }
            if is_null {
                self.stack.pop();
                self.stack.pop();
                break;
            }
            let swap_res = self.opcode_swap(chunk, i);
            if swap_res == 0 {
                return 0;
            }
        }
        return 1;
    }
pub fn core_shift_all ( & mut self , scopes : & mut Vec < RefCell < HashMap < String , Rc < RefCell < Value > > > > > , global_functions : & mut RefCell < HashMap < String , Chunk > > , prev_local_vars_stacks : & mut Vec < Rc < RefCell < Vec < Rc < RefCell < Value > > > > > > , chunk : & Chunk , i : usize , line_col : ( u32 , u32 ) , running : Arc < AtomicBool > ) -> i32 { if self . stack . len ( ) < 1 { print_error ( chunk , i , " " ) ; return 0 ; } loop { let dup_res = self . opcode_dup ( chunk , i ) ; if dup_res == 0 { return 0 ; } let shift_res = self . opcode_shift ( scopes , global_functions , prev_local_vars_stacks , chunk , i , line_col , running . clone ( ) , ) ; if shift_res == 0 { self . stack . pop ( ) ; return 0 ; } let is_null ; { let shifted_rr = & self . stack [ self . stack . len ( ) - 1 ] ; let shifted_rrb = shifted_rr . borrow ( ) ; match & * shifted_rrb { Value :: Null => { is_null = true ; } _ => { is_null = false ; } } } if is_null { self . stack . pop ( ) ; self . stack . pop ( ) ; break ; } let swap_res = self . opcode_swap ( chunk , i ) ; if swap_res == 0 { return 0 ; } } return 1 ; }
Takes a shiftable object as its single argument, and places
copies of all the elements from the list onto the stack, in
the order that they are shifted.
Takes a shiftable object as its single argument and places copies of all the elements from the list onto the stack in the order that they are shifted .
&mut self
scopes
&mut Vec<RefCell<HashMap<String, Rc<RefCell<Value>>>>>
global_functions
&mut RefCell<HashMap<String, Chunk>>
prev_local_vars_stacks
&mut Vec<Rc<RefCell<Vec<Rc<RefCell<Value>>>>>>
chunk
&Chunk
i
usize
line_col
(u32, u32)
running
Arc<AtomicBool>