浏览代码

added documentation in Type api

Nicolas Cannasse 14 年之前
父节点
当前提交
59a616b83e
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      interp.ml
  2. 3 0
      std/haxe/macro/Type.hx

+ 3 - 0
interp.ml

@@ -3471,6 +3471,7 @@ and encode_tenum e =
 		"params", enc_array (List.map (fun (n,t) -> enc_obj ["name",enc_string n;"t",encode_type t]) e.e_types);
 		"constructs", encode_pmap encode_efield e.e_constrs;
 		"names", enc_array (List.map enc_string e.e_names);
+		"doc", null enc_string e.e_doc;
 	]
 
 and encode_efield f =
@@ -3480,6 +3481,7 @@ and encode_efield f =
 		"pos", encode_pos f.ef_pos;
 		"index", VInt f.ef_index;
 		"meta", encode_meta f.ef_meta (fun m -> f.ef_meta <- m);
+		"doc", null enc_string f.ef_doc;
 	]
 
 and encode_cfield f =
@@ -3492,6 +3494,7 @@ and encode_cfield f =
 		"expr", (match f.cf_expr with None -> VNull | Some e -> encode_texpr e);
 		"kind", encode_field_kind f.cf_kind;
 		"pos", encode_pos f.cf_pos;
+		"doc", null enc_string f.cf_doc;
 	]
 
 and encode_field_kind k =

+ 3 - 0
std/haxe/macro/Type.hx

@@ -53,6 +53,7 @@ typedef BaseType = {
 	var isExtern : Bool;
 	var params : Array<{ name : String, t : Type }>;
 	var meta : MetaAccess;
+	var doc : Null<String>;
 	function exclude() : Void;
 }
 
@@ -65,6 +66,7 @@ typedef ClassField = {
 	var kind : FieldKind;
 	var expr : Null<TypedExpr>;
 	var pos : Expr.Position;
+	var doc : Null<String>;
 }
 
 typedef ClassType = {> BaseType,
@@ -86,6 +88,7 @@ typedef EnumField = {
 	var pos : Expr.Position;
 	var meta : MetaAccess;
 	var index : Int;
+	var doc : Null<String>;
 }
 
 typedef EnumType = {> BaseType,