Browse Source

fixed empty arguments named.
fixed method parameters.

Nicolas Cannasse 19 years ago
parent
commit
035d9aec24
1 changed files with 14 additions and 6 deletions
  1. 14 6
      std/tools/haxedoc/HtmlPrinter.hx

+ 14 - 6
std/tools/haxedoc/HtmlPrinter.hx

@@ -223,6 +223,9 @@ class HtmlPrinter {
 	function processClassField(platforms : Platforms,f : ClassField,stat) {
 	function processClassField(platforms : Platforms,f : ClassField,stat) {
 		if( !f.isPublic )
 		if( !f.isPublic )
 			return;
 			return;
+		var oldParams = typeParams;
+		if( f.params != null )
+			typeParams = typeParams.concat(f.params);
 		print('<dt>');
 		print('<dt>');
 		if( stat ) keyword("static");
 		if( stat ) keyword("static");
 		var isMethod = false;
 		var isMethod = false;
@@ -233,17 +236,19 @@ class HtmlPrinter {
 				if( f.set == RF9Dynamic )
 				if( f.set == RF9Dynamic )
 					keyword("f9dynamic");
 					keyword("f9dynamic");
 				keyword("function");
 				keyword("function");
-				print(f.name);				
+				print(f.name);
 				if( f.params != null )
 				if( f.params != null )
-					print("&lt;"+f.params.join(", ")+"&gt;");				
+					print("&lt;"+f.params.join(", ")+"&gt;");
 				print("(");
 				print("(");
 				var me = this;
 				var me = this;
 				display(args,function(a) {
 				display(args,function(a) {
 					if( a.opt )
 					if( a.opt )
 						me.print("?");
 						me.print("?");
-					me.print(a.name);
-					me.print(" : ");
-					me.processType(a.t);					
+					if( a.name != null && a.name != "" ) {
+						me.print(a.name);
+						me.print(" : ");
+					}
+					me.processType(a.t);
 				},", ");
 				},", ");
 				print(") : ");
 				print(") : ");
 				processType(ret);
 				processType(ret);
@@ -267,6 +272,8 @@ class HtmlPrinter {
 		print('<dd>');
 		print('<dd>');
 		processDoc(f.doc);
 		processDoc(f.doc);
 		print('</dd>');
 		print('</dd>');
+		if( f.params != null )
+			typeParams = oldParams;
 	}
 	}
 	
 	
 	function processEnum(e : Enum) {
 	function processEnum(e : Enum) {
@@ -372,7 +379,8 @@ class HtmlPrinter {
 			for( a in args ) {
 			for( a in args ) {
 				if( a.opt )
 				if( a.opt )
 					print("?");
 					print("?");
-				print(a.name+" : ");
+				if( a.name != null && a.name != "" )
+					print(a.name+" : ");
 				processTypeFun(a.t,true);
 				processTypeFun(a.t,true);
 				print(" -> ");
 				print(" -> ");
 			}
 			}