瀏覽代碼

Blocky array access to two expressions

@jdonaldson I dont so good in ocaml to understand your trick :)
But my trick is simple:
No need of iife coz nothing is assigned. Is am wrong????
convert this:
```
blah;
blah;
(heelllo_there(123))[yeah(456)];
somevar[456];
blah;
```
to this:
```
blah;
blah;
heelllo_there(123);
yeah(456);
// and nothing for this line
blah;
```
PeyTy 10 年之前
父節點
當前提交
e6abc9efe2
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      genlua.ml

+ 4 - 1
genlua.ml

@@ -775,7 +775,10 @@ and gen_block_element ?(after=false) ctx e =
 	| TBinop (op,e1,e2) when op <> Ast.OpAssign ->
 		let f () = gen_tbinop ctx op e1 e2 in
 		gen_iife_assign ctx f;
-	| TField _ | TArray _ ->
+	| TArray (e1,e2) ->
+		gen_block_element ctx e1;
+		gen_block_element ctx e2;
+	| TField _ ->
 		let f () = gen_expr ctx e in
 		gen_iife_assign ctx f;
 	| TConst _ | TLocal _ -> ()