瀏覽代碼

MacroType fix

Nicolas Cannasse 13 年之前
父節點
當前提交
ccb0246dbf
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      codegen.ml
  2. 1 1
      parser.ml

+ 2 - 1
codegen.ml

@@ -370,7 +370,8 @@ let build_metadata com t =
 
 let build_macro_type ctx pl p =
 	let path, field, args = (match pl with
-		| [TInst ({ cl_kind = KExpr (ECall (e,args),_) },_)] ->
+		| [TInst ({ cl_kind = KExpr (ECall (e,args),_) },_)]
+		| [TInst ({ cl_kind = KExpr (EArrayDecl [ECall (e,args),_],_) },_)] ->
 			let rec loop e =
 				match fst e with
 				| EField (e,f) | EType (e,f) -> f :: loop e

+ 1 - 1
parser.ml

@@ -395,7 +395,7 @@ and parse_type_path_or_const = parser
 	(* we can't allow (expr) here *)
 	| [< t = parse_complex_type >] -> TPType t
 	| [< '(Const c,p) >] -> TPExpr (EConst c,p)
-	| [< e = expr >] -> TPExpr (match fst e with EBlock [e] -> e | _ -> e)
+	| [< e = expr >] -> TPExpr e
 
 and parse_complex_type_next t = parser
 	| [< '(Arrow,_); t2 = parse_complex_type >] ->