[glib] Allow whitespace between marshallers list tokens



commit c6793d1cfb845ae1cab7fa03a8044568e3494ecd
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jul 11 18:23:38 2017 +0100

    Allow whitespace between marshallers list tokens
    
    Some (older) list files use whitespace, and we need to take that into
    account when splitting off the various tokens.

 gobject/glib-genmarshal.in |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in
index eb473d5..9a39a53 100755
--- a/gobject/glib-genmarshal.in
+++ b/gobject/glib-genmarshal.in
@@ -962,7 +962,7 @@ if __name__ == '__main__':
             if line == '\n' or line.startswith('#'):
                 continue
 
-            matches = re.match(r'^([A-Z0-9]+):([A-Z0-9,]+)$', line.strip())
+            matches = re.match(r'^([A-Z0-9]+)\s?:\s?([A-Z0-9,\s]+)$', line.strip())
             if not matches or len(matches.groups()) != 2:
                 print_warning('Invalid entry: "{}"'.format(line.strip()), args.fatal_warnings)
                 continue
@@ -972,8 +972,8 @@ if __name__ == '__main__':
             else:
                 location = None
 
-            retval = matches.group(1)
-            params = matches.group(2).split(',')
+            retval = matches.group(1).strip()
+            params = [x.strip() for x in matches.group(2).split(',')]
             check_args(retval, params, args.fatal_warnings)
 
             raw_marshaller = generate_marshaller_name(args.prefix, retval, params, False)


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