summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2019-04-09 07:51:00 +0200
committerStefan Sauer <ensonic@users.sf.net>2019-04-09 07:51:00 +0200
commit5002876f952c807cc24b2b0b8e716861ca672c49 (patch)
tree759ba052bf30dd1dd09533ba470d91e29bbecb96
parentf0e7d623c9af948f54c505c5c8bbc461a7998571 (diff)
downloadgtk-doc-5002876f952c807cc24b2b0b8e716861ca672c49.tar.gz
mkdb: join two regexp to simplify the code
-rw-r--r--gtkdoc/mkdb.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/gtkdoc/mkdb.py b/gtkdoc/mkdb.py
index fff9de6..9652276 100644
--- a/gtkdoc/mkdb.py
+++ b/gtkdoc/mkdb.py
@@ -3780,20 +3780,16 @@ def SegmentCommentBlock(lines, line_number=0, ifile=''):
# If we haven't found the symbol name yet, look for it.
if not symbol:
- m1 = re.search(r'^\s*(SECTION:\s*\S+)', line)
- m2 = re.search(r'^\s*(PROGRAM:\s*\S+)', line)
- m3 = re.search(r'^\s*([\w:-]*\w)\s*:?\s*(\(.+?\)\s*)*$', line)
+ m1 = re.search(r'^\s*((SECTION|PROGRAM):\s*\S+)', line)
+ m2 = re.search(r'^\s*([\w:-]*\w)\s*:?\s*(\(.+?\)\s*)*$', line)
if m1:
symbol = m1.group(1)
- logging.info("SECTION DOCS found in source for : '%s'", symbol)
+ logging.info("docs found in source for : '%s'", symbol)
elif m2:
symbol = m2.group(1)
- logging.info("PROGRAM DOCS found in source for : '%s'", symbol)
- elif m3:
- symbol = m3.group(1)
- logging.info("SYMBOL DOCS found in source for : '%s'", symbol)
- if m3.group(2):
- annotation = m3.group(2).strip()
+ logging.info("docs found in source for : '%s'", symbol)
+ if m2.group(2):
+ annotation = m2.group(2).strip()
if annotation != '':
SymbolAnnotations[symbol] = annotation
logging.info("remaining text for %s: '%s'", symbol, annotation)