[gtk-doc] scan: fix more whitespace issues
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] scan: fix more whitespace issues
- Date: Fri, 30 Nov 2018 18:21:19 +0000 (UTC)
commit 1df431e8e287c756dc8d5815ba961d063dabaaf2
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Nov 30 19:20:07 2018 +0100
scan: fix more whitespace issues
gtkdoc/scan.py | 4 ++--
tests/scan.py | 7 +++----
2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index f10b443..51197d2 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -642,13 +642,13 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
if not previous_line_strip.startswith('G_INLINE_FUNC'):
if not previous_line_words or previous_line_words[0] != 'static':
- # $ 1
$2
+ # $1
$2
pm =
re.search(r'^\s*(?:\b(?:extern%s)\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$'
%
ignore_decorators, previous_line)
if pm:
ret_type = pm.group(1)
if pm.group(2):
- ret_type += ' ' + pm.group(2)
+ ret_type += ' ' + pm.group(2).strip()
logging.info('Function (2): "%s", Returns: "%s"', symbol, ret_type)
in_declaration = 'function'
else:
diff --git a/tests/scan.py b/tests/scan.py
index 50a26d9..9f10881 100644
--- a/tests/scan.py
+++ b/tests/scan.py
@@ -152,14 +152,13 @@ class ScanHeaderContentFunctions(ScanHeaderContentTestCase):
slist, doc_comments = self.scanHeaderContent([header])
self.assertDecl('func', 'void', 'void', slist)
- # TODO: get rid of extra spaces
def test_FindsFunctionStrucVoidMultiline(self):
header = textwrap.dedent("""\
struct ret *
func (void);""")
slist, doc_comments = self.scanHeaderContent(
header.splitlines(keepends=True))
- self.assertDecl('func', 'struct ret *', 'void', slist)
+ self.assertDecl('func', 'struct ret *', 'void', slist)
class ScanHeaderContentMacros(ScanHeaderContentTestCase):
@@ -326,6 +325,6 @@ if __name__ == '__main__':
# from gtkdoc import common
# common.setup_logging()
#
- # t = ScanHeaderContentUnions()
+ # t = ScanHeaderContentFunctions()
# t.setUp()
- # t.test_FindsUnion()
+ # t.test_FindsFunctionStrucVoidMultiline()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]