The regular expression currently expects a single word for the type, but it may be something like "struct foo". Add support for it.
Showing the changes to tools/lib/python (1 of 1 file). Show all
Unified · Split
| @@ -1018,14 +1018,14 @@ class KernelDoc: · 1017 unmodified lines | |||
| 1018 | 1018 | ||
| 1019 | default_val = None | 1019 | 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) |