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
This commit is contained in:
Sam Spilsbury 2018-03-19 04:56:17 +08:00 committed by Philip Withnall
parent 0a42a7cb74
commit 7027a128c1

View File

@ -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*
(?:/\*<
(([^*]|\*(?!/))*)