[glib] glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error



commit 7027a128c1a10904810f3cf0fb9f5c5e325082e1
Author: Sam Spilsbury <sam endlessm com>
Date:   Mon Mar 19 04:56:17 2018 +0800

    glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error
    
    Previously we were only detecting typedef\*senum\s*\{, which does not
    handle the case where there is an entifier for the enum itself but
    not the typedef. glib-mkenums would then attempt to read the next line
    looking for a matching {, but in vain.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794506

 gobject/glib-mkenums.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
index 15628df6f..61466be06 100755
--- a/gobject/glib-mkenums.in
+++ b/gobject/glib-mkenums.in
@@ -457,7 +457,7 @@ def process_file(curfilename):
         if re.match(r'\s*typedef\s+enum.*;', line):
             continue
 
-        m = re.match(r'''\s*typedef\s+enum\s*
+        m = re.match(r'''\s*typedef\s+enum\s*[_A-Za-z]*[_A-Za-z0-9]*\s*
                ({)?\s*
                (?:/\*<
                  (([^*]|\*(?!/))*)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]