DocumentationTools/ModuleDocumentor.py

changeset 4667
77050ebbdb20
parent 4631
5c1a96925da4
child 4830
f609a22f43bd
diff -r bc52ef526e11 -r 77050ebbdb20 DocumentationTools/ModuleDocumentor.py
--- a/DocumentationTools/ModuleDocumentor.py	Sat Jan 16 16:53:31 2016 +0100
+++ b/DocumentationTools/ModuleDocumentor.py	Sat Jan 16 16:56:59 2016 +0100
@@ -975,12 +975,12 @@
                         paramList.append([paramName, "", []])
                     lastItem = paramList[-1][2]
                 elif desc.startswith("@type"):
+                    parts = desc.split(None, 1)
                     if lastTag not in ["@param", "@keyparam"]:
                         raise TagError(
                             "{0} line must be preceded by a parameter line\n"
                             .format(parts[0]))
                     inTagSection = True
-                    parts = desc.split(None, 1)
                     lastTag = parts[0]
                     if len(parts) < 2:
                         raise TagError(
@@ -1012,8 +1012,12 @@
                     returns = [parts[1]]
                     lastItem = returns
                 elif desc.startswith("@rtype"):
+                    parts = desc.split(None, 1)
+                    if lastTag not in ["@return", "@ireturn"]:
+                        raise TagError(
+                            "{0} line must be preceded by a return line\n"
+                            .format(parts[0]))
                     inTagSection = True
-                    parts = desc.split(None, 1)
                     lastTag = parts[0]
                     if len(parts) < 2:
                         raise TagError(

eric ide

mercurial