Browse Source

fixed typedef fields being considered private for docgen (fixed issue #1562)

Nicolas Cannasse 12 years ago
parent
commit
24161fea1c
2 changed files with 8 additions and 5 deletions
  1. 7 4
      std/haxe/rtti/XmlParser.hx
  2. 1 1
      std/tools/haxedoc/HtmlPrinter.hx

+ 7 - 4
std/haxe/rtti/XmlParser.hx

@@ -383,7 +383,7 @@ class XmlParser {
 		};
 		};
 	}
 	}
 
 
-	function xclassfield( x : Fast ) : ClassField {
+	function xclassfield( x : Fast, ?defPublic ) : ClassField {
 		var e = x.elements;
 		var e = x.elements;
 		var t = xtype(e.next());
 		var t = xtype(e.next());
 		var doc = null;
 		var doc = null;
@@ -397,7 +397,7 @@ class XmlParser {
 		return {
 		return {
 			name : x.name,
 			name : x.name,
 			type : t,
 			type : t,
-			isPublic : x.x.exists("public"),
+			isPublic : x.x.exists("public") || defPublic,
 			isOverride : x.x.exists("override"),
 			isOverride : x.x.exists("override"),
 			line : if( x.has.line ) Std.parseInt(x.att.line) else null,
 			line : if( x.has.line ) Std.parseInt(x.att.line) else null,
 			doc : doc,
 			doc : doc,
@@ -561,8 +561,11 @@ class XmlParser {
 			CFunction(args,ret.t);
 			CFunction(args,ret.t);
 		case "a":
 		case "a":
 			var fields = new List();
 			var fields = new List();
-			for( f in x.elements )
-				fields.add(xclassfield(f));
+			for( f in x.elements ) {
+				var f = xclassfield(f,true);
+				f.platforms = new List(); // platforms selection are on the type itself, not on fields
+				fields.add(f);
+			}
 			CAnonymous(fields);
 			CAnonymous(fields);
 		case "d":
 		case "d":
 			var t = null;
 			var t = null;

+ 1 - 1
std/tools/haxedoc/HtmlPrinter.hx

@@ -327,7 +327,7 @@ class HtmlPrinter {
 			print(" : ");
 			print(" : ");
 			processType(f.type);
 			processType(f.type);
 		}
 		}
-		if( f.platforms.length != platforms.length ) {
+		if( f.platforms.length != platforms.length && f.platforms.length > 0 ) {
 			print('<div class="platforms">Available in ');
 			print('<div class="platforms">Available in ');
 			display(f.platforms,output,", ");
 			display(f.platforms,output,", ");
 			print('</div>');
 			print('</div>');