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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/lib/kdoc/kdoc_parser.py+1−1
@@ -551,7 +551,6 @@ class KernelDoc: · 550 unmodified lines
551 ]551 ]
552 552
553 definition_body = r'\{(.*)\}\s*' + "(?:" + '|'.join(qualifiers) + ")?"553 definition_body = r'\{(.*)\}\s*' + "(?:" + '|'.join(qualifiers) + ")?"
554 struct_members = KernRe(type_pattern + r'([^\{\};]+)(\{)([^\{\}]*)(\})([^\{\}\;]*)(\;)')
555 554
556 # Extract struct/union definition555 # Extract struct/union definition
557 members = None556 members = None
@@ -683,6 +682,7 @@ class KernelDoc: · 125 unmodified lines
683 # So, we need to have an extra loop on Python to override such682 # So, we need to have an extra loop on Python to override such
684 # re limitation.683 # re limitation.
685 684
685 struct_members = KernRe(type_pattern + r'([^\{\};]+)(\{)([^\{\}]*)(\})([^\{\};]*)(;)')
686 while True:686 while True:
687 tuples = struct_members.findall(members)687 tuples = struct_members.findall(members)
688 if not tuples:688 if not tuples: