[hawkmoth] Re: [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:56:44 +0000

Ah! I managed to sort out the issue with GitHub. I created a pull
request there since the mailing list seems to be obsolete now in a way.

On 22:22:10 2021-11-15, Bruno Santos wrote:

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 = ''

Other related posts: