From dbc004bc126258455d66170e8518f8d623b0067c Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 18 Nov 2001 17:03:33 +0000 Subject: [PATCH] allow the enums name to not be on the same line as the trailing '}'. 2001-11-16 Mark McLoughlin * glib-mkenums.in: allow the enums name to not be on the same line as the trailing '}'. (#64714) --- gobject/ChangeLog | 5 +++++ gobject/glib-mkenums.in | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 049e0deba..deda0c719 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,8 @@ +2001-11-16 Mark McLoughlin + + * glib-mkenums.in: allow the enums name to not be on the same + line as the trailing '}'. (#64714) + 2001-11-18 Hans Breuer * makefile.msc.in : remove g_log_domain_gruntime usage diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in index e58f90772..c0e31ca0d 100755 --- a/gobject/glib-mkenums.in +++ b/gobject/glib-mkenums.in @@ -27,6 +27,7 @@ sub parse_trigraph { sub parse_entries { my $file = shift; my $file_name = shift; + my $looking_for_name = 0; while (<$file>) { @@ -46,6 +47,13 @@ sub parse_entries { next if m@^\s*$@; # print STDERR "xxx $_\n"; + + if ($looking_for_name) { + if (/^\s*(\w+)/) { + $enumname = $1; + return 1; + } + } # Handle include files if (/^\#include\s*<([^>]*)>/ ) { @@ -74,6 +82,12 @@ sub parse_entries { return 1; } + if (/^\s*\}/) { + $enumindex++; + $looking_for_name = 1; + next; + } + if (m@^\s* (\w+)\s* # name (?:=( # value