|
@@ -224,6 +224,11 @@ let reify in_macro =
|
|
|
(EUntyped (ECall ((EConst (Ident "$__mk_pos__"),p),[file;pmin;pmax]),p),p)
|
|
|
else
|
|
|
to_obj [("file",file);("min",pmin);("max",pmax)] p
|
|
|
+ and to_enc_pos p =
|
|
|
+ match !cur_pos with
|
|
|
+ | Some p -> p
|
|
|
+ | None when in_macro -> to_pos p
|
|
|
+ | None -> (ECall ((EField ((EField ((EField ((EConst (Ident "haxe"),p),"macro"),p),"Context"),p),"makePosition"),p),[to_pos p]),p)
|
|
|
and to_expr_array a p = match a with
|
|
|
| [EMeta ((Meta.Dollar "a",[],_),e1),_] -> (match fst e1 with EArrayDecl el -> to_expr_array el p | _ -> e1)
|
|
|
| _ -> to_array to_expr a p
|
|
@@ -342,7 +347,7 @@ let reify in_macro =
|
|
|
| EParenthesis (ECheckType (e2, (CTPath{tname="String";tpackage=[]},_)),_) -> expr "EConst" [mk_enum "Constant" "CString" [e2] (pos e2)]
|
|
|
| EParenthesis (ECheckType (e2, (CTPath{tname="Int";tpackage=[]},_)),_) -> expr "EConst" [mk_enum "Constant" "CInt" [e2] (pos e2)]
|
|
|
| EParenthesis (ECheckType (e2, (CTPath{tname="Float";tpackage=[]},_)),_) -> expr "EConst" [mk_enum "Constant" "CFloat" [e2] (pos e2)]
|
|
|
- | _ -> (ECall ((EField ((EField ((EField ((EConst (Ident "haxe"),p),"macro"),p),"Context"),p),"makeExpr"),p),[e; to_pos (pos e)]),p)
|
|
|
+ | _ -> (ECall ((EField ((EField ((EField ((EConst (Ident "haxe"),p),"macro"),p),"Context"),p),"makeExpr"),p),[e; to_enc_pos (pos e)]),p)
|
|
|
end
|
|
|
| Meta.Dollar "i", _ ->
|
|
|
expr "EConst" [mk_enum "Constant" "CIdent" [e1] (pos e1)]
|