Browse Source

fix array_get generation

frabbit 11 years ago
parent
commit
0faf3767cc
1 changed files with 5 additions and 1 deletions
  1. 5 1
      genpy.ml

+ 5 - 1
genpy.ml

@@ -1225,7 +1225,11 @@ module Printer = struct
 			| "__python_tuple__" ->
 			| "__python_tuple__" ->
 				Printf.sprintf "(%s)" (print_exprs pctx ", " el)
 				Printf.sprintf "(%s)" (print_exprs pctx ", " el)
 			| "__python_array_get__" ->
 			| "__python_array_get__" ->
-				Printf.sprintf "%s[%s]" (print_expr pctx e1) (print_exprs pctx ":" el)
+				let e1, tail = match el with
+					| e1::tail -> e1,tail
+					| _ -> assert false
+				in
+				Printf.sprintf "%s[%s]" (print_expr pctx e1) (print_exprs pctx ":" tail)
 			| "__python_in__" ->
 			| "__python_in__" ->
 				begin match el with
 				begin match el with
 					| [e1;e2] ->
 					| [e1;e2] ->