History

docs: kdoc_parser: move var transformers to the beginning

Just like functions and structs had their transform variables placed at the beginning, move variable transforms to there as well. No functional changes.

Mauro Carvalho Chehab committed 8 months ago

Commit 77e6e171 parent 8eb49351 file · +13 −10Browse files

Showing the changes to tools/lib/python (1 of 1 file). Show all

Unified · Split

tools/lib/python/kdoc/kdoc_parser.py+13−10
@@ -192,6 +192,18 @@ function_xforms = [ · 191 unmodified lines
192192 (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+"), ""),
193193 ]
194194
195+#
196+# Transforms for variable prototypes
197+#
198+var_xforms = [
199+ (KernRe(r"__read_mostly"), ""),
200+ (KernRe(r"__ro_after_init"), ""),
201+ (KernRe(r"(?://.*)$"), ""),
202+ (KernRe(r"(?:/\*.*\*/)"), ""),
203+ (KernRe(r";$"), ""),
204+ (KernRe(r"=.*"), ""),
205+]
206+
195207 #
196208 # Ancillary functions
197209 #
@@ -972,15 +984,6 @@ class KernelDoc: · 774 unmodified lines
972984 ]
973985 OPTIONAL_VAR_ATTR = "^(?:" + "|".join(VAR_ATTRIBS) + ")?"
974986
975− sub_prefixes = [
976− (KernRe(r"__read_mostly"), ""),
977− (KernRe(r"__ro_after_init"), ""),
978− (KernRe(r"(?://.*)$"), ""),
979− (KernRe(r"(?:/\*.*\*/)"), ""),
980− (KernRe(r";$"), ""),
981− (KernRe(r"=.*"), ""),
982− ]
983−
984987 #
985988 # Store the full prototype before modifying it
986989 #
@@ -1004,7 +1007,7 @@ class KernelDoc: · 17 unmodified lines
10041007 # Drop comments and macros to have a pure C prototype
10051008 #
10061009 if not declaration_name:
1007− for r, sub in sub_prefixes:
1010+ for r, sub in var_xforms:
10081011 proto = r.sub(sub, proto)
10091012
10101013 proto = proto.rstrip()

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