浏览代码

support leading colon syntax like a[1:]

frabbit 11 年之前
父节点
当前提交
e8e405c731
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      genpy.ml

+ 2 - 0
genpy.ml

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