[pygobject] Allow h2def.py to work when there are tabs or multiple spaces after the struct keyword.



commit 549313fc4886fa3deb31761de6f5400708165d86
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jun 18 18:48:37 2009 +0200

    Allow h2def.py to work when there are tabs or multiple spaces after the struct keyword.

 codegen/h2def.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/codegen/h2def.py b/codegen/h2def.py
index 6859eb1..17617fa 100755
--- a/codegen/h2def.py
+++ b/codegen/h2def.py
@@ -139,7 +139,7 @@ def find_obj_defs(buf, objdefs=[]):
     maybeobjdefs = []  # contains all possible objects from file
 
     # first find all structures that look like they may represent a GtkObject
-    pat = re.compile("struct _(" + obj_name_pat + ")\s*{\s*" +
+    pat = re.compile("struct\s+_(" + obj_name_pat + ")\s*{\s*" +
                      "(" + obj_name_pat + ")\s+", re.MULTILINE)
     pos = 0
     while pos < len(buf):
@@ -160,7 +160,7 @@ def find_obj_defs(buf, objdefs=[]):
         pos = m.end()
 
     # now find all structures that look like they might represent a class:
-    pat = re.compile("struct _(" + obj_name_pat + ")Class\s*{\s*" +
+    pat = re.compile("struct\s+_(" + obj_name_pat + ")Class\s*{\s*" +
                      "(" + obj_name_pat + ")Class\s+", re.MULTILINE)
     pos = 0
     while pos < len(buf):
@@ -189,7 +189,7 @@ def find_obj_defs(buf, objdefs=[]):
 
     # now find all structures that look like they might represent
     # a class inherited from GTypeInterface:
-    pat = re.compile("struct _(" + obj_name_pat + ")Class\s*{\s*" +
+    pat = re.compile("struct\s+_(" + obj_name_pat + ")Class\s*{\s*" +
                      "GTypeInterface\s+", re.MULTILINE)
     pos = 0
     while pos < len(buf):
@@ -205,7 +205,7 @@ def find_obj_defs(buf, objdefs=[]):
 
     # now find all structures that look like they might represent
     # an Iface inherited from GTypeInterface:
-    pat = re.compile("struct _(" + obj_name_pat + ")Iface\s*{\s*" +
+    pat = re.compile("struct\s+_(" + obj_name_pat + ")Iface\s*{\s*" +
                      "GTypeInterface\s+", re.MULTILINE)
     pos = 0
     while pos < len(buf):



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