valadoc r16 - in trunk/src/doclets: devhelp/taglets/parameter devhelp/taglets/return devhelp/taglets/throws html/taglets/parameter html/taglets/return html/taglets/throws valadoc.org/taglets/parameter valadoc.org/taglets/return valadoc.org/taglets/throws



Author: flobrosch
Date: Mon Nov 10 00:28:32 2008
New Revision: 16
URL: http://svn.gnome.org/viewvc/valadoc?rev=16&view=rev

Log:

 - context checks



Modified:
   trunk/src/doclets/devhelp/taglets/parameter/taglet.vala
   trunk/src/doclets/devhelp/taglets/return/taglet.vala
   trunk/src/doclets/devhelp/taglets/throws/taglet.vala
   trunk/src/doclets/html/taglets/parameter/taglet.vala
   trunk/src/doclets/html/taglets/return/taglet.vala
   trunk/src/doclets/html/taglets/throws/taglet.vala
   trunk/src/doclets/valadoc.org/taglets/parameter/taglet.vala
   trunk/src/doclets/valadoc.org/taglets/return/taglet.vala
   trunk/src/doclets/valadoc.org/taglets/throws/taglet.vala

Modified: trunk/src/doclets/devhelp/taglets/parameter/taglet.vala
==============================================================================
--- trunk/src/doclets/devhelp/taglets/parameter/taglet.vala	(original)
+++ trunk/src/doclets/devhelp/taglets/parameter/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -57,6 +57,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+6, "@param is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );

Modified: trunk/src/doclets/devhelp/taglets/return/taglet.vala
==============================================================================
--- trunk/src/doclets/devhelp/taglets/return/taglet.vala	(original)
+++ trunk/src/doclets/devhelp/taglets/return/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -44,6 +44,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@return is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		this.content = content;
 		return true;
 	}

Modified: trunk/src/doclets/devhelp/taglets/throws/taglet.vala
==============================================================================
--- trunk/src/doclets/devhelp/taglets/throws/taglet.vala	(original)
+++ trunk/src/doclets/devhelp/taglets/throws/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -60,6 +60,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@throws is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+7, "Errordomain was expected.\n", error_start );

Modified: trunk/src/doclets/html/taglets/parameter/taglet.vala
==============================================================================
--- trunk/src/doclets/html/taglets/parameter/taglet.vala	(original)
+++ trunk/src/doclets/html/taglets/parameter/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -69,6 +69,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+6, "@param is not allowed in this contex.\n", error_start );
+			return false;		
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );

Modified: trunk/src/doclets/html/taglets/return/taglet.vala
==============================================================================
--- trunk/src/doclets/html/taglets/return/taglet.vala	(original)
+++ trunk/src/doclets/html/taglets/return/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -44,6 +44,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@return is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		this.content = content;
 		return true;
 	}

Modified: trunk/src/doclets/html/taglets/throws/taglet.vala
==============================================================================
--- trunk/src/doclets/html/taglets/throws/taglet.vala	(original)
+++ trunk/src/doclets/html/taglets/throws/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -60,6 +60,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@throws is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+7, "Errordomain was expected.\n", error_start );

Modified: trunk/src/doclets/valadoc.org/taglets/parameter/taglet.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/taglets/parameter/taglet.vala	(original)
+++ trunk/src/doclets/valadoc.org/taglets/parameter/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -57,6 +57,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+6, "@param is not allowed in this contex.\n", error_start );
+			return false;		
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );

Modified: trunk/src/doclets/valadoc.org/taglets/return/taglet.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/taglets/return/taglet.vala	(original)
+++ trunk/src/doclets/valadoc.org/taglets/return/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -44,6 +44,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@return is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		this.content = content;
 		return true;
 	}

Modified: trunk/src/doclets/valadoc.org/taglets/throws/taglet.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/taglets/throws/taglet.vala	(original)
+++ trunk/src/doclets/valadoc.org/taglets/throws/taglet.vala	Mon Nov 10 00:28:32 2008
@@ -60,6 +60,12 @@
 	}
 
 	public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+		if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) {
+			string error_start = this.extract_lines ( line_start, 0, 0 );
+			reporter.add_error ( 0, pos, 0, pos+7, "@throws is not allowed in this contex.\n", error_start );
+			return false;
+		}
+
 		if ( content.size == 0 ) {
 			string error_start = this.extract_lines ( line_start, 0, 0 );
 			reporter.add_error ( 0, pos, 0, pos+7, "Errordomain was expected.\n", error_start );



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