History

docs: kdoc: Move a regex line in dump_struct()

The complex struct_members regex was defined far from its use; bring the two together. Remove some extraneous backslashes while making the move.

Jonathan Corbet committed 1 year ago

Commit 259feba1 parent 6656ae41 file · +1 −1Browse files

Unified · Split

scripts/lib/kdoc/kdoc_parser.py+1−1
@@ -551,7 +551,6 @@ class KernelDoc: · 550 unmodified lines
551551 ]
552552
553553 definition_body = r'\{(.*)\}\s*' + "(?:" + '|'.join(qualifiers) + ")?"
554− struct_members = KernRe(type_pattern + r'([^\{\};]+)(\{)([^\{\}]*)(\})([^\{\}\;]*)(\;)')
555554
556555 # Extract struct/union definition
557556 members = None
@@ -683,6 +682,7 @@ class KernelDoc: · 125 unmodified lines
683682 # So, we need to have an extra loop on Python to override such
684683 # re limitation.
685684
685+ struct_members = KernRe(type_pattern + r'([^\{\};]+)(\{)([^\{\}]*)(\})([^\{\};]*)(;)')
686686 while True:
687687 tuples = struct_members.findall(members)
688688 if not tuples: