]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
- trivial cleanups
authorFlorian Brosch <flobrosch@src.gnome.org>
Tue, 11 Nov 2008 13:48:31 +0000 (13:48 +0000)
committerFlorian Brosch <flobrosch@src.gnome.org>
Tue, 11 Nov 2008 13:48:31 +0000 (13:48 +0000)
 - trivial cleanups

svn path=/trunk/; revision=18

src/libvaladoc/doctree.vala
src/libvaladoc/parser.vala
src/valadoc/valadoc.vala

index 4cb28d6ea151c40954ad4ce734c77f360d4bd9a0..837cea310adc997d9f028e159aae346ad0adf4f4 100755 (executable)
@@ -3684,10 +3684,6 @@ public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHa
                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 );
index a496f3fe2f332765766e356ec48d72ef784213db..1e0737511879ff01918f9a1e287aa442377dcbb7 100644 (file)
@@ -629,7 +629,6 @@ public class Parser : Object {
 
                        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 class Parser : Object {
        }
 
        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 @@ public class Parser : Object {
 
                bool tmp = this.skip_documentation_header ( ref str, ref linenr, ref pos );
                if ( tmp == false ) {
-               stdout.printf ( "-----------------------\n" );
                        return null;
                }
 
@@ -844,7 +794,6 @@ public class Parser : Object {
 
                                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 @@ public class Parser : Object {
                        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 @@ public class Parser : Object {
                        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;
        }
 
index dfe19cb6b6d941bf6c71df547e1aa3e82594b152..a1f86a7aeb134486391cd36b4a381a803e11622a 100755 (executable)
@@ -278,34 +278,30 @@ public class ValaDoc : Object {
                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 @@ public class ValaDoc : Object {
                }
                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 @@ public class ValaDoc : Object {
                        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 @@ public class ValaDoc : Object {
 
                        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 @@ public class ValaDoc : Object {
                }
 
                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;
                }