valadoc r18 - in trunk/src: libvaladoc valadoc



Author: flobrosch
Date: Tue Nov 11 13:48:31 2008
New Revision: 18
URL: http://svn.gnome.org/viewvc/valadoc?rev=18&view=rev

Log:

 - trivial cleanups



Modified:
   trunk/src/libvaladoc/doctree.vala
   trunk/src/libvaladoc/parser.vala
   trunk/src/valadoc/valadoc.vala

Modified: trunk/src/libvaladoc/doctree.vala
==============================================================================
--- trunk/src/libvaladoc/doctree.vala	(original)
+++ trunk/src/libvaladoc/doctree.vala	Tue Nov 11 13:48:31 2008
@@ -3684,10 +3684,6 @@
 		if ( this.documentation != null )
 			return ;
 
-		if ( this.parent_class != null ) {
-			stdout.printf ( "{>>>>>[%s]<<<<<}\n", this.parent_class.comment_string );
-		}
-
 
 		if ( this.comment_string != null ) {
 			bool tmp = Parser.is_documentation ( this.comment_string );

Modified: trunk/src/libvaladoc/parser.vala
==============================================================================
--- trunk/src/libvaladoc/parser.vala	(original)
+++ trunk/src/libvaladoc/parser.vala	Tue Nov 11 13:48:31 2008
@@ -629,7 +629,6 @@
 
 			tmp = this.newline_handler ( buf, ref linestart, ref str, ref linenr, ref pos, ref linestartnr, ref chr, ref prevchr, ref prevprevchr );
 			if ( chr == '\0' ) {
-				stdout.printf ( ">>WTF<<\n" );
 				break;
 			}
 			else if ( tmp == true ) {
@@ -733,54 +732,6 @@
 	}
 
 	public DocumentationTree? parse ( Valadoc.Tree tree, Valadoc.Basic me, string str2 ) {
-		if ( me is Valadoc.Property ) {
-			stdout.printf ( "PROPERTY\n" );
-		}
-		else if ( me is Valadoc.Signal ) {
-			stdout.printf ( "SIGNAL\n" );
-		}
-		else if ( me is Valadoc.Class ) {
-			stdout.printf ( "CLASS\n" );
-		}
-		else if ( me is Valadoc.Interface ) {
-			stdout.printf ( "INTERFACE\n" );
-		}
-		else if ( me is Valadoc.Delegate ) {
-			stdout.printf ( "DELEGATE\n" );
-		}
-		else if ( me is Valadoc.Namespace ) {
-			stdout.printf ( "NAMESPACE\n" );
-		}
-		else if ( me is Valadoc.Method ) {
-			stdout.printf ( "METHOD\n" );
-		}
-		else if ( me is Valadoc.Field ) {
-			stdout.printf ( "FIELD\n" );
-		}
-		else if ( me is Valadoc.Constant ) {
-			stdout.printf ( "CONSTANT\n" );
-		}
-		else if ( me is Valadoc.Struct ) {
-			stdout.printf ( "STRUCT\n" );
-		}
-		else if ( me is Valadoc.Enum ) {
-			stdout.printf ( "ENUM\n" );
-		}
-		else if ( me is Valadoc.EnumValue ) {
-			stdout.printf ( "ENUMVALUE\n" );
-		}
-		else if ( me is Valadoc.ErrorCode ) {
-			stdout.printf ( "ERRORCODE\n" );
-		}
-		else if ( me is Valadoc.ErrorDomain ) {
-			stdout.printf ( "ERRORDOMAIN\n" );
-		}
-		else {
-			stdout.printf ( "Gut ^_^\n" );
-		}
-
-		stdout.printf ( "============= %s =============\n", me.full_name() );
-
 		string str = str2;
 
 		GLib.StringBuilder buf = new GLib.StringBuilder ();
@@ -792,7 +743,6 @@
 
 		bool tmp = this.skip_documentation_header ( ref str, ref linenr, ref pos );
 		if ( tmp == false ) {
-		stdout.printf ( "-----------------------\n" );
 			return null;
 		}
 
@@ -844,7 +794,6 @@
 
 				InlineTaglet itag = this.parse_bracket ( tree, me, ref str, ref linestart, ref linestartnr, ref linenr, ref pos );
 				if ( itag == null ) {
-		stdout.printf ( "-----------------------\n" );
 					return null;
 				}
 				content.add ( itag );
@@ -853,7 +802,6 @@
 			else if ( chr == '}' ) {
 				string line = this.extract_line ( linestart );
 				this.reporter.add_error (linenr, pos, linenr, pos, "syntax error.\n", line );
-		stdout.printf ( "-----------------------\n" );
 				return null;
 			}
 			else if ( chr == '@' && prevchr.isspace() ) {
@@ -884,12 +832,11 @@
 			content.add ( strtag );
 		}
 
-		stdout.printf ( "-----------------------\n" );
-
 		this.append_new_tag ( tree, me, doctree, currtagname, content, currtagline, currtagstartlinenr, currtagstartpos );
 		tmp = this.check_foother ( ref linestart, linenr );
 		if ( tmp == false )
 			return null;
+
 		return doctree;
 	}
 

Modified: trunk/src/valadoc/valadoc.vala
==============================================================================
--- trunk/src/valadoc/valadoc.vala	(original)
+++ trunk/src/valadoc/valadoc.vala	Tue Nov 11 13:48:31 2008
@@ -278,34 +278,30 @@
 		return taglets;
 	}
 */
-	private inline bool check_doclet_structure ( string realpath ) {
+	private bool check_doclet_structure ( string realpath ) {
 		bool tmp = FileUtils.test ( realpath, FileTest.IS_DIR );
 		if ( tmp == false ) {
-			stdout.printf ( "realpath %s is not a directory.\n", realpath );
 			return false;
 		}
 
 		tmp = FileUtils.test ( realpath + "/libdoclet.so", FileTest.IS_EXECUTABLE );
 		if ( tmp == false ) {
-			stdout.printf ( "%s is not executable.\n", realpath + "libdoclet.so" );
 			return false;
 		}
 
 
 		tmp = FileUtils.test ( realpath + "/taglets/", FileTest.IS_DIR );
 		if ( tmp == false ) {
-			stdout.printf ( "Error: %s is not a directory.\n", realpath + "/taglets/" );
 			return false;
 		}
 
 		return true;
 	}
 
-	private Gee.HashMap<string, Type>? load_taglets ( out Type strtag ) {
+	private bool load_taglets ( string fulldirpath, out Gee.HashMap<string, Type>? taglets, out Type strtag ) {
 		void* function;
 		GLib.Dir dir;
 
-		string fulldirpath = (pluginpath == null)? Config.plugin_dir : pluginpath;
 		string pluginpath = fulldirpath + "taglets/";
 
 		Gee.ArrayList<Module*> modules = new Gee.ArrayList<weak Module*> ( );
@@ -317,7 +313,8 @@
 		}
 		catch ( FileError err ) {
 			stdout.printf ( "Can't load plugin. %s\n", pluginpath );
-			return null;
+			taglets = null;
+			return false;
 		}
 
 		for ( weak string entry = dir.read_name(); entry != null ; entry = dir.read_name() ) {
@@ -329,7 +326,8 @@
 			Module* module = Module.open ( tagletpath, ModuleFlags.BIND_LAZY);
 			if (module == null) {
 				stdout.printf ( "Can't load plugin.\n" );
-				return taglets;
+				taglets = null;
+				return false;
 			}
 
 			module->symbol( "register_plugin", out function );
@@ -341,36 +339,23 @@
 
 			if ( entry == "libtagletstring.so" || entry == "libtagletstring.dll" )
 				strtag = type;
-			//else
-			//	taglets.set ( name, type );
 
 			modules.add ( module );
 		}
 
-		return taglets;
+		return true;
 	}
 
-	private Doclet? load_doclet ( ) {
+	private Doclet? load_doclet ( string path ) {
 		void* function;
 
-/*
-		string ppath = (pluginpath == null)? Config.plugin_dir : pluginpath;
-		string pluginpath = realpath ( ppath ) + "/template";
-
-		string pluginpath;
-		string ppath;
-*/
-
-
-		docletmodule = Module.open ( pluginpath + "/libdoclet.so", ModuleFlags.BIND_LAZY);
+		docletmodule = Module.open ( path + "/libdoclet.so", ModuleFlags.BIND_LAZY);
 		if (docletmodule == null) {
-			stdout.printf ( "Can't load doclet %s.\n", pluginpath + "/libdoclet.so" );
 			return null;
 		}
 
 		docletmodule.symbol( "register_plugin", out function );
 		if ( function == null ) {
-			stdout.printf ( "Can't register the doclet.\n" );
 			return null;
 		}
 
@@ -509,20 +494,35 @@
 		}
 
 		Reporter reporter = new Reporter();
-		GLib.Type strtag;
 
-		bool tmp = check_doclet_structure ( pluginpath );
+
+
+		string fulldirpath = (pluginpath == null)? Config.plugin_dir : pluginpath;
+
+
+		bool tmp = this.check_doclet_structure ( pluginpath );
+
+
+
 		if ( tmp == false ) {
-			stdout.printf ( "Not a doclet %s.\n", pluginpath );
+			stdout.printf ( "Error: failed to load plugin.\n" );
 			return 1;
 		}
 
-		Gee.HashMap<string, Type> taglets = load_taglets ( out strtag );
-		if ( taglets == null )
+
+		Gee.HashMap<string, Type> taglets;
+		GLib.Type strtag;
+
+
+		tmp = this.load_taglets ( fulldirpath, out taglets, out strtag );
+		if ( tmp == false ) {
+			stdout.printf ( "Error: failed to load plugin.\n" );
 			return 1;
+		}
 
-		Valadoc.Doclet doclet = this.load_doclet ( );
+		Valadoc.Doclet doclet = this.load_doclet ( fulldirpath );
 		if ( doclet == null ) {
+			stdout.printf ( "Error: failed to load plugin.\n" );
 			return 1;
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]