From e85971b9d0468d9d52e84f935f8a4a78cb15915a Mon Sep 17 00:00:00 2001 From: pushfoo <36696816+pushfoo@users.noreply.github.com> Date: Thu, 9 Jan 2025 02:37:15 -0500 Subject: [PATCH] Bug fix for Rect and Box init helpers * Add capital letters to accepted function regex * Add comment explaining in-depth why and where we need the feature --- util/update_quick_index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/update_quick_index.py b/util/update_quick_index.py index ca35cd57d..b2b053f4d 100644 --- a/util/update_quick_index.py +++ b/util/update_quick_index.py @@ -391,7 +391,10 @@ # Patterns + default config dict CLASS_RE = re.compile(r"^class ([A-Za-z0-9]+[^\(:]*)") -FUNCTION_RE = re.compile("^def ([a-z][a-z0-9_]*)") +# Yes, the capital letters in this pattern are intentional. They +# capture type instantiation helpers which act like type init calls +# in the rect, box, and other modules. +FUNCTION_RE = re.compile("^def ([a-zA-Z][a-zA-Z0-9_]*)") TYPE_RE = re.compile("^(?!LOG =)([A-Za-z][A-Za-z0-9_]*) =") DEFAULT_EXPRESSIONS = { 'class': CLASS_RE,