Browse Source

support leading colon syntax like a[1:]

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

+ 2 - 0
genpy.ml

@@ -1203,6 +1203,8 @@ module Printer = struct
 				Printf.sprintf "(%s)" (print_exprs pctx ", " el)
 				Printf.sprintf "(%s)" (print_exprs pctx ", " el)
 			| "__python_array_get__",e1::tail ->
 			| "__python_array_get__",e1::tail ->
 				Printf.sprintf "%s[%s]" (print_expr pctx e1) (print_exprs pctx ":" tail)
 				Printf.sprintf "%s[%s]" (print_expr pctx e1) (print_exprs pctx ":" tail)
+			| "__python_array_access_leading_colon__", e1::tail ->
+				Printf.sprintf "%s[%s:]" (print_expr pctx e1) (print_exprs pctx ":" tail)
 			| "__python_in__",[e1;e2] ->
 			| "__python_in__",[e1;e2] ->
 				Printf.sprintf "%s in %s" (print_expr pctx e1) (print_expr pctx e2)
 				Printf.sprintf "%s in %s" (print_expr pctx e1) (print_expr pctx e2)
 			| "__python_for__",[{eexpr = TBlock [{eexpr = TVar(v1,_)};e2;block]}] ->
 			| "__python_for__",[{eexpr = TBlock [{eexpr = TVar(v1,_)};e2;block]}] ->