summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2009-06-18 18:48:37 +0200
committerMurray Cumming <murrayc@murrayc.com>2009-06-18 18:48:37 +0200
commit549313fc4886fa3deb31761de6f5400708165d86 (patch)
tree0c708cc2d7e741ab55fef56aee7596342bb03922
parent5c36ef20dca8cd1793f2d3e88949675299097f40 (diff)
downloadpygobject-549313fc4886fa3deb31761de6f5400708165d86.tar.gz
pygobject-549313fc4886fa3deb31761de6f5400708165d86.tar.xz
pygobject-549313fc4886fa3deb31761de6f5400708165d86.zip
Allow h2def.py to work when there are tabs or multiple spaces after the struct keyword.
-rwxr-xr-xcodegen/h2def.py8
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):