valadoc r15 - in trunk/src: doclets/devhelp/doclet doclets/html/doclet doclets/htmlhelpers doclets/valadoc.org/doclet libvaladoc valadoc
- From: flobrosch svn gnome org
- To: svn-commits-list gnome org
- Subject: valadoc r15 - in trunk/src: doclets/devhelp/doclet doclets/html/doclet doclets/htmlhelpers doclets/valadoc.org/doclet libvaladoc valadoc
- Date: Sun, 9 Nov 2008 22:46:42 +0000 (UTC)
Author: flobrosch
Date: Sun Nov 9 22:46:42 2008
New Revision: 15
URL: http://svn.gnome.org/viewvc/valadoc?rev=15&view=rev
Log:
- libvaladoc
- yields-keyword
- dynamic-keyword
- html-doclet, devhelp-doclet
- global namespace:
- navigation fixes
- content list improvements
Modified:
trunk/src/doclets/devhelp/doclet/template.vala
trunk/src/doclets/html/doclet/template.vala
trunk/src/doclets/htmlhelpers/Makefile.am
trunk/src/doclets/htmlhelpers/htmlhelpers.vala
trunk/src/doclets/valadoc.org/doclet/template.vala
trunk/src/libvaladoc/doclet.vala
trunk/src/libvaladoc/doctree.vala
trunk/src/libvaladoc/parser.vala
trunk/src/valadoc/valadoc.vala
Modified: trunk/src/doclets/devhelp/doclet/template.vala
==============================================================================
--- trunk/src/doclets/devhelp/doclet/template.vala (original)
+++ trunk/src/doclets/devhelp/doclet/template.vala Sun Nov 9 22:46:42 2008
@@ -444,6 +444,9 @@
this.write_file_footer ( file );
file = null;
}
+
+ public override void cleanups () {
+ }
}
Modified: trunk/src/doclets/html/doclet/template.vala
==============================================================================
--- trunk/src/doclets/html/doclet/template.vala (original)
+++ trunk/src/doclets/html/doclet/template.vala Sun Nov 9 22:46:42 2008
@@ -147,8 +147,7 @@
private Gee.ArrayList<Namespace> source_namespaces = new Gee.ArrayList<Namespace> ();
private Gee.ArrayList<Package> files = new Gee.ArrayList<Package> ();
-
- ~HtmlDoclet () {
+ public override void cleanups () {
this.directory_level = 0;
copy_directory ( Config.doclet_path + "deps/", this.settings.path );
Modified: trunk/src/doclets/htmlhelpers/Makefile.am
==============================================================================
--- trunk/src/doclets/htmlhelpers/Makefile.am (original)
+++ trunk/src/doclets/htmlhelpers/Makefile.am Sun Nov 9 22:46:42 2008
@@ -11,7 +11,7 @@
libhtmlhelpers.vala.stamp: $(libhtmlhelpers_VALASOURCES)
- $(VALAC) -C --library libhtmlhelpers-1.0 --basedir . --vapidir ../../../vapi --pkg valadoc-1.0 --disable-non-null $^
+ $(VALAC) -C --library libhtmlhelpers-1.0 --basedir . --vapidir ../../vapi --pkg valadoc-1.0 --disable-non-null $^
touch $@
Modified: trunk/src/doclets/htmlhelpers/htmlhelpers.vala
==============================================================================
--- trunk/src/doclets/htmlhelpers/htmlhelpers.vala (original)
+++ trunk/src/doclets/htmlhelpers/htmlhelpers.vala Sun Nov 9 22:46:42 2008
@@ -357,8 +357,18 @@
if ( type_reference.type_name == null )
return ;
+
+ GLib.StringBuilder modifiers = new GLib.StringBuilder ();
+
+ if ( type_reference.is_dynamic )
+ modifiers.append ( "dynamic " );
+
if ( type_reference.is_weak )
- file.printf ( "<font class=\"%s\">weak</font> ", css_keyword );
+ modifiers.append ( "weak " );
+
+ if ( modifiers.len > 0 )
+ file.printf ( "<font class=\"%s\">%s</font> ", css_keyword, modifiers.str );
+
this.write_type_reference_name ( type_reference, file );
this.write_type_reference_template_arguments ( type_reference, file );
@@ -495,9 +505,9 @@
if ( m.is_abstract )
modifiers.append ( " abstract" );
- if ( m.is_virtual )
+ else if ( m.is_virtual )
modifiers.append ( " virtual" );
- if ( m.is_override )
+ else if ( m.is_override )
modifiers.append ( " override" );
if ( m.is_static )
modifiers.append ( " static" );
@@ -509,6 +519,10 @@
file.puts ( m.name );
file.puts ( " " );
this.write_parameter_list ( m, file );
+
+ if ( m.is_yields )
+ file.printf ( " <span class=\"%s\">yields</span> ", css_keyword );
+
this.write_exception_list ( m, file );
}
@@ -598,13 +612,14 @@
if ( prop.is_virtual )
modifiers.append ( " virtual " );
- if ( prop.is_abstract )
+ else if ( prop.is_abstract )
modifiers.append ( " abstract " );
- if ( prop.is_override )
+ else if ( prop.is_override )
modifiers.append ( " override " );
+ if ( modifiers.len > 0 )
+ file.printf ( " <span class=\"%s\">%s</span> ", css_keyword, modifiers.str );
- file.printf ( " <span class=\"%s\">%s</span> ", css_keyword, modifiers.str );
this.write_type_reference ( prop.return_type, file );
file.printf ( " %s { ", prop.name );
@@ -627,6 +642,7 @@
this.write_accessor ( sig, file );
file.printf ( " <span class=\"%s\">signal</span> ", css_keyword );
+
this.write_type_reference ( sig.return_type, file );
file.printf ( " %s ", sig.name );
this.write_parameter_list ( sig, file );
@@ -832,8 +848,9 @@
if ( mself == null )
mself = element;
- else if ( mself.name == null )
- mself = mself.parent;
+
+// else if ( mself.name == null )
+// mself = mself.parent;
string package_name = element.file.name;
@@ -846,9 +863,7 @@
for ( int i = lst.size-1; i >= 0 ; i-- ) {
Basic el = lst.get ( i );
- if ( el.name != null ) {
- this.write_navi_top_entry ( file, el, mself );
- }
+ this.write_navi_top_entry ( file, el, mself );
}
}
@@ -910,6 +925,11 @@
protected void write_navi_child_namespaces_inline ( GLib.FileStream file, Namespace ns, Basic mself ) {
file.printf ( "<ul class=\"%s\">\n", css_navi );
+
+ if ( ns.name == null ) {
+ this.write_navi_child_namespaces_without_childs ( file, (Package)ns.parent, ns );
+ }
+
this.write_navi_child_namespaces_inline_withouth_block ( file, ns, mself );
file.puts ( "</ul>\n" );
}
@@ -1348,6 +1368,9 @@
protected void write_navi_child_namespaces_without_childs ( GLib.FileStream file, NamespaceHandler nsh, Basic mself ) {
Gee.ReadOnlyCollection<Namespace> namespaces = nsh.get_namespace_list ( );
foreach ( Namespace ns in namespaces ) {
+ if ( ns.name == null )
+ continue ;
+
if ( ns == mself )
this.write_navi_entry ( file, ns, mself, css_navi_namespace, false );
else
@@ -1543,14 +1566,14 @@
}
}
- protected void write_child_namespaces ( GLib.FileStream file, NamespaceHandler nh ) {
+ protected void write_child_namespaces ( GLib.FileStream file, NamespaceHandler nh, Basic? mself = null ) {
Gee.ReadOnlyCollection<Namespace> nsl = nh.get_namespace_list ();
if ( nsl.size > 0 ) {
file.printf ( "<h3 class=\"%s\">Namespaces:</h3>\n", css_title );
file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
foreach ( Namespace ns in nsl ) {
if ( ns.name != null ) {
- file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_namespace, css_navi_link, this.get_link(ns, nh), ns.name );
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_namespace, css_navi_link, this.get_link(ns, (mself == null)? nh : mself), ns.name );
}
}
file.puts ( "</ul>\n" );
@@ -1868,7 +1891,11 @@
ns.write_comment ( file );
file.printf ( "\n\t\t\t\t<h2 class=\"%s\">Content:</h2>\n", css_title );
- this.write_child_namespaces ( file, ns );
+ if ( ns.name == null )
+ this.write_child_namespaces ( file, (Package)ns.parent, ns );
+ else
+ this.write_child_namespaces ( file, ns );
+
this.write_child_classes ( file, ns );
this.write_child_interfaces ( file, ns );
this.write_child_structs ( file, ns );
Modified: trunk/src/doclets/valadoc.org/doclet/template.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/doclet/template.vala (original)
+++ trunk/src/doclets/valadoc.org/doclet/template.vala Sun Nov 9 22:46:42 2008
@@ -410,6 +410,9 @@
this.write_method_content ( file, m, parent );
file = null;
}
+
+ public override void cleanups () {
+ }
}
Modified: trunk/src/libvaladoc/doclet.vala
==============================================================================
--- trunk/src/libvaladoc/doclet.vala (original)
+++ trunk/src/libvaladoc/doclet.vala Sun Nov 9 22:46:42 2008
@@ -29,6 +29,9 @@
public abstract class Valadoc.Doclet : GLib.Object {
public abstract void initialisation ( Settings settings );
+ // walkarround for a strage bug
+ public abstract void cleanups ( );
+
public abstract void visit_package ( Package pkg );
public abstract void visit_namespace ( Namespace ns );
Modified: trunk/src/libvaladoc/doctree.vala
==============================================================================
--- trunk/src/libvaladoc/doctree.vala (original)
+++ trunk/src/libvaladoc/doctree.vala Sun Nov 9 22:46:42 2008
@@ -1803,6 +1803,12 @@
}
return true;
}
+
+ public bool is_dynamic {
+ get {
+ return this.vtyperef.is_dynamic;
+ }
+ }
public bool is_weak {
get {
@@ -2419,6 +2425,12 @@
private get;
}
+ public bool is_yields {
+ get {
+ return this.vmethod.coroutine;
+ }
+ }
+
public bool is_abstract {
get {
return this.vmethod.is_abstract;
Modified: trunk/src/libvaladoc/parser.vala
==============================================================================
--- trunk/src/libvaladoc/parser.vala (original)
+++ trunk/src/libvaladoc/parser.vala Sun Nov 9 22:46:42 2008
@@ -490,7 +490,7 @@
pos = 0;
this.skip_deadh_zone ( ref str, ref chr, linenr, ref pos );
- this.set_prev_chr ( out prevchr, out prevprevchr, 'p' );
+// this.set_prev_chr ( out prevchr, out prevprevchr, 'p' );
return buf.str;
}
@@ -559,7 +559,6 @@
return true;
}
- // add a line counter!!
private inline void skip_spaces ( ref string str, ref int pos ) {
for ( unichar chr = str.get_char(); chr != '\0' ; str = str.next_char(), chr = str.get_char() ) {
pos++;
@@ -576,6 +575,8 @@
str = str.next_char();
pos++;
+ string tagline = linestart;
+
string? currtagname = "";
unichar prevprevchr = '\0';
unichar prevchr = '\0';
@@ -597,6 +598,9 @@
if ( tagname == null )
return null;
+ str = str.next_char();
+// pos++;
+
if ( !this.taglets.contains( tagname ) ) {
string line = this.extract_line ( linestart );
string reportmsg = "Taglet '%s' is not registered.\n".printf( tagname );
@@ -613,6 +617,7 @@
return null;
}
+
for ( unichar chr = str.get_char(); chr != '\0' ; str = str.next_char(), chr = str.get_char() ) {
pos++;
@@ -622,6 +627,15 @@
continue ;
}
+ 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 ) {
+ continue;
+ }
+
tmp = this.skip_double_spaces ( ref str, buf, chr, ref prevchr, ref prevprevchr );
if ( tmp == true )
continue ;
@@ -633,8 +647,8 @@
InlineTaglet rtag = ((InlineTaglet)tag);
rtag.init ( );
- //rtag.parse ( this.settings, tree, this.reporter, linestart.offset(1), linenr, pos, me, buf.str );
- rtag.parse ( this.settings, tree, this.reporter, linestart.offset(1), taglinenr, tagpos, me, buf.str );
+
+ rtag.parse ( this.settings, tree, this.reporter, tagline.offset(1), taglinenr, tagpos, me, buf.str );
return rtag;
}
@@ -697,6 +711,27 @@
return false;
}
+ private bool newline_handler ( GLib.StringBuilder buf, ref string linestart, ref string str, ref int linenr, ref int pos, ref int linestartnr, ref unichar chr, ref unichar prevchr, ref unichar prevprevchr ) {
+ if ( chr == '\n' ) {
+ linestartnr = linenr;
+ linestart = str;
+ linenr++;
+ pos = 0;
+
+ this.skip_deadh_zone ( ref str, ref chr, linenr, ref pos );
+ if ( chr == '\0' )
+ return false;
+
+ if ( prevchr == '\n' ) {
+ buf.append_unichar ( '\n' );
+ }
+
+ this.set_prev_chr ( out prevchr, out prevprevchr, '\n' );
+ return true;
+ }
+ return false;
+ }
+
public DocumentationTree? parse ( Valadoc.Tree tree, Valadoc.Basic me, string str2 ) {
string str = str2;
@@ -735,28 +770,14 @@
continue ;
}
- if ( chr == '\n' ) {
- linestartnr = linenr;
- linestart = str;
- linenr++;
- pos = 0;
-
- this.skip_deadh_zone ( ref str, ref chr, linenr, ref pos );
- if ( chr == '\0' )
- break;
-
- if ( prevchr == '\n' ) {
- buf.append_unichar ( '\n' );
- }
-
- this.set_prev_chr ( out prevchr, out prevprevchr, '\n' );
- continue ;
+ tmp = this.newline_handler ( buf, ref linestart, ref str, ref linenr, ref pos, ref linestartnr, ref chr, ref prevchr, ref prevprevchr );
+ if ( chr == '\0' ) {
+ break;
}
-/*
- if ( prevchr == '\n' && prevprevchr == '\n' ) {
- buf.append_unichar ( '\n' );
+ else if ( tmp == true ) {
+ continue;
}
-*/
+
tmp = this.skip_double_spaces ( ref str, buf, chr, ref prevchr, ref prevprevchr );
if ( tmp == true )
continue ;
Modified: trunk/src/valadoc/valadoc.vala
==============================================================================
--- trunk/src/valadoc/valadoc.vala (original)
+++ trunk/src/valadoc/valadoc.vala Sun Nov 9 22:46:42 2008
@@ -540,14 +540,14 @@
return 1;
-
-
doclet.initialisation ( settings );
+ doctree.visit ( doclet );
+ doclet.cleanups ( );
- doctree.visit ( doclet );
doclet = null;
+ settings = null;
doctree = null;
return quit ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]