summaryrefslogtreecommitdiff
path: root/doc/apibuild.py
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-08-24 00:03:44 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-08-24 00:51:52 +0200
commit92bb889be3bcbd1aaf64286d592f19e2060a273f (patch)
tree5e53716c844b657bc9f43a8b0715325270e2c9cd /doc/apibuild.py
parent75b5bc2b0a6219ee03069611793dccb2d47102c0 (diff)
downloadlibxml2-92bb889be3bcbd1aaf64286d592f19e2060a273f.tar.gz
Don't index anything in DOC_DISABLE sections
Somewhat misleadingly, the DOC_DISABLE directive only disabled warnings. Now we really stop the documentation generator from indexing. This results in additional warnings for xmlThrDef* functions. This should be fixed by documenting or deprecating them.
Diffstat (limited to 'doc/apibuild.py')
-rwxr-xr-xdoc/apibuild.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/apibuild.py b/doc/apibuild.py
index f46e1063..30e4d2dd 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -577,23 +577,25 @@ class CParser:
self.last_comment = ""
self.comment = None
self.collect_ref = 0
- self.no_error = 0
+ self.doc_disable = 0
self.conditionals = []
self.defines = []
def collect_references(self):
self.collect_ref = 1
- def stop_error(self):
- self.no_error = 1
+ def disable(self):
+ self.doc_disable = 1
- def start_error(self):
- self.no_error = 0
+ def enable(self):
+ self.doc_disable = 0
def lineno(self):
return self.lexer.getlineno()
def index_add(self, name, module, static, type, info=None, extra = None):
+ if self.doc_disable:
+ return
if self.is_header == 1:
self.index.add(name, module, module, static, type, self.lineno(),
info, extra, self.conditionals)
@@ -611,12 +613,12 @@ class CParser:
info, extra, self.conditionals)
def warning(self, msg):
- if self.no_error:
+ if self.doc_disable:
return
print(msg)
def error(self, msg, token=-1):
- if self.no_error:
+ if self.doc_disable:
return
print("Parse Error: " + msg)
@@ -669,10 +671,10 @@ class CParser:
token = self.lexer.token()
if self.comment.find("DOC_DISABLE") != -1:
- self.stop_error()
+ self.disable()
if self.comment.find("DOC_ENABLE") != -1:
- self.start_error()
+ self.enable()
return token
@@ -935,7 +937,7 @@ class CParser:
name = name.split('(') [0]
except:
pass
- info = self.parseMacroComment(name, not self.is_header)
+ info = self.parseMacroComment(name, True)
self.index_add(name, self.filename, not self.is_header,
"macro", info)
return token