From: Florian Brosch Date: Tue, 11 Nov 2008 13:48:31 +0000 (+0000) Subject: - trivial cleanups X-Git-Tag: 0.37.1~3^2~616 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb6d7dbd5bd17481b725756251872df9ec374dd;p=thirdparty%2Fvala.git - trivial cleanups - trivial cleanups svn path=/trunk/; revision=18 --- diff --git a/src/libvaladoc/doctree.vala b/src/libvaladoc/doctree.vala index 4cb28d6ea..837cea310 100755 --- a/src/libvaladoc/doctree.vala +++ b/src/libvaladoc/doctree.vala @@ -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 ); diff --git a/src/libvaladoc/parser.vala b/src/libvaladoc/parser.vala index a496f3fe2..1e0737511 100644 --- a/src/libvaladoc/parser.vala +++ b/src/libvaladoc/parser.vala @@ -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; } diff --git a/src/valadoc/valadoc.vala b/src/valadoc/valadoc.vala index dfe19cb6b..a1f86a7ae 100755 --- a/src/valadoc/valadoc.vala +++ b/src/valadoc/valadoc.vala @@ -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? load_taglets ( out Type strtag ) { + private bool load_taglets ( string fulldirpath, out Gee.HashMap? taglets, out Type strtag ) { void* function; GLib.Dir dir; - string fulldirpath = (pluginpath == null)? Config.plugin_dir : pluginpath; string pluginpath = fulldirpath + "taglets/"; Gee.ArrayList modules = new Gee.ArrayList ( ); @@ -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 taglets = load_taglets ( out strtag ); - if ( taglets == null ) + + Gee.HashMap 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; }