Ver código fonte

sneak in case @:macro (don't use this in production code yet)

Simon Krajewski 11 anos atrás
pai
commit
eae65830f1
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      matcher.ml

+ 6 - 0
matcher.ml

@@ -343,6 +343,12 @@ let to_pattern ctx e t =
 			unify ctx e.etype t p;
 			let c = match e.eexpr with TConst c -> c | _ -> assert false in
 			mk_con_pat (CConst c) [] t p
+		| EMeta((Meta.Macro,[],_),(ECall (e1,args),_)) ->
+			let path, field, args = Codegen.get_macro_path ctx e1 args p in
+			begin match ctx.g.do_macro ctx MExpr path field args p with
+				| Some e ->	loop pctx e t
+				| None -> error "Macro failure" p
+			end
 		| EField _ ->
 			let e = type_expr ctx e (WithType t) in
 			let e = match Optimizer.make_constant_expression ctx ~concat_strings:true e with Some e -> e | None -> e in