History

docs: kdoc_parser: fix parser to support multi-word types

The regular expression currently expects a single word for the type, but it may be something like "struct foo". Add support for it.

Mauro Carvalho Chehab committed 8 months ago

Commit 6d9c2e91 parent b7dc6351 file · +2 −2Browse files

Unified · Split

tools/lib/python/kdoc/kdoc_parser.py+2−2
@@ -1018,14 +1018,14 @@ class KernelDoc: · 1017 unmodified lines
1018 1018
1019 default_val = None1019 default_val = None
1020 1020
1021 r= KernRe(OPTIONAL_VAR_ATTR + r"[\w_]*\s+(?:\*+)?([\w_]+)\s*[\d\]\[]*\s*(=.*)?")1021 r= KernRe(OPTIONAL_VAR_ATTR + r"\s*[\w_\s]*\s+(?:\*+)?([\w_]+)\s*[\d\]\[]*\s*(=.*)?")
1022 if r.match(proto):1022 if r.match(proto):
1023 if not declaration_name:1023 if not declaration_name:
1024 declaration_name = r.group(1)1024 declaration_name = r.group(1)
1025 1025
1026 default_val = r.group(2)1026 default_val = r.group(2)
1027 else:1027 else:
1028 r= KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w_]+)\s*[\d\]\[]*\s*(=.*)?")1028 r= KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_\s]*)?\s+(?:\*+)?(?:[\w_]+)\s*[\d\]\[]*\s*(=.*)?")
1029 1029
1030 if r.match(proto):1030 if r.match(proto):
1031 default_val = r.group(1)1031 default_val = r.group(1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t