History

scripts: kernel-doc: fix parsing function-like typedefs (again)

Typedefs like typedef struct phylink_pcs *(*pcs_xlate_t)(const u64 *args); have a typedef_type that ends with a * and therefore has no word boundary. Add an extra clause for the final group of the typedef_type so we only require a word boundary if we match a word. [mchehab: modify also kernel-doc.py, as we're deprecating the perl version]

Sean Anderson committed 1 year ago

Commit de258fa1 parent 04a383c2 files · +2 −2Browse files

Unified · Split

2 files
  1. scripts/kernel-doc.pl +1 −1
  2. scripts/lib/kdoc/kdoc_parser.py +1 −1
scripts/kernel-doc.pl+1−1
@@ -1325,7 +1325,7 @@ sub dump_enum($$) { · 1324 unmodified lines
1325 }1325 }
1326}1326}
1327 1327
1328my $typedef_type = qr { ((?:\s+[\w\*]+\b){1,8})\s* }x;1328my $typedef_type = qr { ((?:\s+[\w\*]+\b){0,7}\s+(?:\w+\b|\*+))\s* }x;
1329my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x;1329my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x;
1330my $typedef_args = qr { \s*\((.*)\); }x;1330my $typedef_args = qr { \s*\((.*)\); }x;
1331 1331
scripts/lib/kdoc/kdoc_parser.py+1−1
@@ -1067,7 +1067,7 @@ class KernelDoc: · 1066 unmodified lines
1067 Stores a typedef inside self.entries array.1067 Stores a typedef inside self.entries array.
1068 """1068 """
1069 1069
1070 typedef_type = r'((?:\s+[\w\*]+\b){1,8})\s*'1070 typedef_type = r'((?:\s+[\w\*]+\b){0,7}\s+(?:\w+\b|\*+))\s*'
1071 typedef_ident = r'\*?\s*(\w\S+)\s*'1071 typedef_ident = r'\*?\s*(\w\S+)\s*'
1072 typedef_args = r'\s*\((.*)\);'1072 typedef_args = r'\s*\((.*)\);'
1073 1073