[hawkmoth] [PATCH] Fix anonymous type detection for newer Clang version

  • From: "Bruno Santos" <dmarc-noreply@xxxxxxxxxxxxx> ("brunomanuelsantos")
  • To: hawkmoth mailing list <hawkmoth@xxxxxxxxxxxxx>, Jani Nikula <jani@xxxxxxxxxx>
  • Date: Mon, 15 Nov 2021 22:22:10 +0000

Clang 13 introduces a change to the anonymous type names forcing us to
update the regex to support both versions.
---
 hawkmoth/parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hawkmoth/parser.py b/hawkmoth/parser.py
index 35b048b..dd8be2e 100644
--- a/hawkmoth/parser.py
+++ b/hawkmoth/parser.py
@@ -177,7 +177,7 @@ def _anonymous_fixup(ttype, name):
     if name:
         return ttype, name
 
-    mo = re.match(r'(?a)^(?P<type>enum|struct|union) ([^:]+::)?\(anonymous at 
[^)]+\)$', ttype)
+    mo = re.match(r'(?a)^(?P<type>enum|struct|union) 
([^:]+::)?\((anonymous|unnamed) at [^)]+\)$', ttype)
     if mo:
         # Anonymous
         name = ''
-- 
2.33.1


Other related posts: