]> granicus.if.org Git - python/commitdiff
accept * in return value type and convert it to _ptr after the
authorGuido van Rossum <guido@python.org>
Tue, 28 Apr 1998 16:04:50 +0000 (16:04 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 28 Apr 1998 16:04:50 +0000 (16:04 +0000)
typename, as in argument types.
(Jack)

Tools/bgen/bgen/scantools.py

index 851a4d0929ee57da8d8c819299ee012801430490..80cfd5e009cf2e5b38003a45b26596c8dce44821 100644 (file)
@@ -228,7 +228,7 @@ if missing: raise "Missing Types"
 #              self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)[ \t\n]+"
                self.type_pat = "EXTERN_API" + \
                                                "[ \t\n]*([ \t\n]*" + \
-                                               "\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)" + \
+                                               "\(<type>[a-zA-Z0-9_* \t]*[a-zA-Z0-9_*]\)" + \
                                                "[ \t\n]*)[ \t\n]*"
                self.name_pat = "\(<name>[a-zA-Z0-9_]+\)[ \t\n]*"
                self.args_pat = "(\(<args>\([^(;=)]+\|([^(;=)]*)\)*\))"
@@ -399,6 +399,7 @@ if missing: raise "Missing Types"
                        self.report("Bad raw spec: %s", `raw`)
                        return
                type, name, args = self.whole.group('type', 'name', 'args')
+               type = regsub.gsub("\*", " ptr", type)
                type = regsub.gsub("[ \t]+", "_", type)
                if name in self.alreadydone:
                        self.report("Name has already been defined: %s", `name`)