Tools: prevent "struct" being removed from timezone

macOS requires this.
This commit is contained in:
Campbell Barton
2025-02-18 10:24:23 +11:00
parent dde68fbf95
commit 9057e528c7

View File

@@ -982,11 +982,17 @@ class edit_generators:
span_skip.add(match.span(1))
# Remove `struct`
for match in re.finditer(r"\b(struct)\s+[a-zA-Z0-9_]+", data):
for match in re.finditer(r"\b(struct)\s+([a-zA-Z0-9_]+)", data):
span = match.span(1)
if span in span_skip:
continue
if match.group(2) in {
# macOS requires a leading `struct` while Linux doesn't.
"timezone",
}:
continue
edits.append(Edit(
span=span,
content=' ',