summaryrefslogtreecommitdiff
path: root/gtkdoc/scan.py
diff options
context:
space:
mode:
Diffstat (limited to 'gtkdoc/scan.py')
-rw-r--r--gtkdoc/scan.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index d04d4d4..5a5da92 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -96,19 +96,8 @@ CLINE_MATCHER = [
(struct|union)\s*
\w*\s*{""", re.VERBOSE),
# 12-14: OTHER TYPEDEFS
- re.compile(
- r"""^\s*typedef\s+
- (?:struct|union)\s+\w+[\s\*]+
- (\w+) # 1: name
- \s*;""", re.VERBOSE),
- re.compile(
- r"""^\s*
- (?:G_GNUC_EXTENSION\s+)?
- typedef\s+
- (.+[\s\*]) # 1: e.g. 'unsigned int'
- (\w+) # 2: name
- (?:\s*\[[^\]]+\])*
- \s*;""", re.VERBOSE),
+ None, # in InitScanner()
+ None, # in InitScanner()
re.compile(r'^\s*typedef\s+'),
# 15: VARIABLES (extern'ed variables)
None, # in InitScanner()
@@ -267,6 +256,21 @@ def InitScanner(options):
%s # 3: optional decorator
\s*;""" % optional_decorators_regex, re.VERBOSE)
# OTHER TYPEDEFS
+ CLINE_MATCHER[12] = re.compile(
+ r"""^\s*typedef\s+
+ (?:struct|union)\s+\w+[\s\*]+
+ (\w+) # 1: name
+ %s # 2: optional decorator
+ \s*;""" % optional_decorators_regex, re.VERBOSE)
+ CLINE_MATCHER[13] = re.compile(
+ r"""^\s*
+ (?:G_GNUC_EXTENSION\s+)?
+ typedef\s+
+ (.+?[\s\*]) # 1: e.g. 'unsigned int'
+ (\w+) # 2: name
+ (?:\s*\[[^\]]+\])*
+ %s # 3: optional decorator
+ \s*;""" % optional_decorators_regex, re.VERBOSE)
CLINE_MATCHER[15] = re.compile(
r"""^\s*
(?:extern|[A-Za-z_]+VAR%s)\s+
@@ -561,6 +565,11 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
logging.info('Found start of comment: %s', line.strip())
continue
+ # Skip begin/end deprecation macros.
+ m = re.search(r'^\s*G_GNUC_(BEGIN|END)_IGNORE_DEPRECATIONS', line)
+ if m:
+ continue
+
logging.info('no decl: %s', line.strip())
cm = [m.match(line) for m in CLINE_MATCHER]