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



commit 145e45f55d56caaabe33285e410a3b2105a9306c
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 d551cdcf4..57b041208 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]