summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-01-03 06:47:47 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2020-01-03 06:47:47 -0500
commitb922e1486e6fa34611527f2628fef34ce4ffd42e (patch)
tree79a33470a94030ce111be1bfb131eaea7ca543ae
parentca42972cd3fc5420a429ae752228c0c89ec7c763 (diff)
downloadgtk-doc-b922e1486e6fa34611527f2628fef34ce4ffd42e.tar.gz
typedef can be followed by decorator
-rw-r--r--gtkdoc/scan.py30
1 files changed, 17 insertions, 13 deletions
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index 7de08ad..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+