From 6cf8646600405780d67ad2bf152c8ae70589d9b8 Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Fri, 27 Jan 2017 16:19:25 +0000 Subject: fix right shift --- src/lem_interp/interp_lib.lem | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lem_interp/interp_lib.lem b/src/lem_interp/interp_lib.lem index 625dfb6c..47b3c833 100644 --- a/src/lem_interp/interp_lib.lem +++ b/src/lem_interp/interp_lib.lem @@ -701,15 +701,15 @@ let rec shift_op_vec op v = let fail () = Assert_extra.failwith ("shift_op_vec given unexpected " ^ (string_of_value v)) in let arith_op_help vl vr = match (vl,vr) with - | (V_vector b ord cs,V_lit (L_aux (L_num n) _)) -> - let n = natFromInteger n in - (match op with - | "<<" -> - V_vector b ord - ((from_n_to_n n ((length cs) - 1) cs) ++(List.replicate n (V_lit (L_aux L_zero Unknown)))) - | ">>" -> + | (V_vector b ord cs,V_lit (L_aux (L_num n) _)) -> + let n = natFromInteger n in + (match op with + | "<<" -> + V_vector b ord + ((from_n_to_n n ((length cs) - 1) cs) ++(List.replicate n (V_lit (L_aux L_zero Unknown)))) + | ">>" -> V_vector b ord - ((List.replicate n (V_lit (L_aux L_zero Unknown))) ++ (from_n_to_n 0 (n-1) cs)) + ((List.replicate n (V_lit (L_aux L_zero Unknown))) ++ (from_n_to_n 0 (((length cs) -1) - n) cs)) | "<<<" -> V_vector b ord ((from_n_to_n n ((length cs) -1) cs) ++ (from_n_to_n 0 (n-1) cs)) -- cgit v1.2.3