public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] Further commenting and formatting changes for def2doc.py.
@ 2022-11-05 17:24 Gaius Mulley
0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-11-05 17:24 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:be86a95e809b1e95a3e534a9dfa9456107daa325
commit be86a95e809b1e95a3e534a9dfa9456107daa325
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Sat Nov 5 17:23:25 2022 +0000
Further commenting and formatting changes for def2doc.py.
gcc/m2/ChangeLog:
* tools-src/def2doc.py: Corrected Python3 formatting.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diff:
---
gcc/m2/tools-src/def2doc.py | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/gcc/m2/tools-src/def2doc.py b/gcc/m2/tools-src/def2doc.py
index ea1ccd6f43b..0412d518eb7 100755
--- a/gcc/m2/tools-src/def2doc.py
+++ b/gcc/m2/tools-src/def2doc.py
@@ -72,11 +72,9 @@ def displayLibraryClass():
# a routine to summarize each module.
global args
previous = ""
-
nxt = libraryClassifications[1][1]
i = 0
lib = libraryClassifications[i]
-
while True:
emitNode(lib[1], nxt, previous, args.up)
emitSection(lib[1])
@@ -101,7 +99,6 @@ def displayMenu():
for lib in libraryClassifications:
output.write("* " + lib[1] + "::" + lib[2] + "\n")
output.write("@end menu\n")
-
output.write("\n")
output.write("@c " + "=" * 60 + "\n")
output.write("\n")
@@ -114,10 +111,9 @@ def removeInitialComments(file, line):
line = file.readline()
-# removeableField - returns True if a comment field should be removed
-# from the definition module.
-
def removeableField(line):
+ # removeableField - returns True if a comment field should be removed
+ # from the definition module.
field_list = ["Author", "Last edit", "LastEdit", "Last update",
"Date", "Title", "Revision"]
for field in field_list:
@@ -157,7 +153,6 @@ def checkIndex(line):
procedure = words[2]
else:
procedure = words[1]
-
if (len(line) > 1) and (line[0:2] == "(*"):
inConst = False
inType = False
@@ -201,7 +196,6 @@ def checkIndex(line):
if (len(word[0]) > 0) and (word[0][0] != "_"):
output.write("@findex " + str.rstrip(word[0]))
output.write(" (type)\n")
-
if inConst:
words = str.split(line, ";")
for word in words:
@@ -211,7 +205,6 @@ def checkIndex(line):
var = str.split(word, "=")
if len(var) > 0:
output.write("@findex " + var[0] + " (const)\n")
-
if procedure != "":
name = str.split(procedure, "(")
if name[0] != "":
@@ -232,10 +225,8 @@ def parseDefinition(dir, source, build, file, needPage):
while (str.find(line, "(*") != -1):
removeInitialComments(f, line)
line = f.readline()
-
while (str.find(line, "DEFINITION") == -1):
line = f.readline()
-
output.write("@example\n")
output.write(str.rstrip(line) + "\n")
line = f.readline()
@@ -350,7 +341,6 @@ def displayModules(up, dir, build, source):
if checkDirectory(dir, build, source):
if foundFile(dir, build, source, "README.texi"):
doCat(findFile(dir, build, source, "README.texi"))
-
moduleMenu(dir, build, source)
listOfFiles = []
if os.path.exists(os.path.join(source, dir)):
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-05 17:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-05 17:24 [gcc/devel/modula-2] Further commenting and formatting changes for def2doc.py Gaius Mulley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).