diff options
author | Guido van Rossum <guido@python.org> | 1996-07-21 02:49:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-07-21 02:49:55 (GMT) |
commit | e47d5f9c528002586eb3f217f39fd7794dcbb909 (patch) | |
tree | 593f4f9475d31f1b6444efb9e8c83a12754f521f /Tools/bgen | |
parent | a3b4b61a74f70b5ea7affa5f7a5714691cfed985 (diff) | |
download | cpython-e47d5f9c528002586eb3f217f39fd7794dcbb909.zip cpython-e47d5f9c528002586eb3f217f39fd7794dcbb909.tar.gz cpython-e47d5f9c528002586eb3f217f39fd7794dcbb909.tar.bz2 |
Addition by Jack to test for missing type support
Diffstat (limited to 'Tools/bgen')
-rw-r--r-- | Tools/bgen/bgen/scantools.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py index ec5c733..89447e1 100644 --- a/Tools/bgen/bgen/scantools.py +++ b/Tools/bgen/bgen/scantools.py @@ -62,6 +62,25 @@ class Scanner: modes = self.usedtypes[type].keys() modes.sort() print type, string.join(modes) + + def gentypetest(self, file): + fp = open(file, "w") + fp.write("types=[\n") + types = self.usedtypes.keys() + types.sort() + for type in types: + fp.write("\t'%s',\n"%type) + fp.write("]\n") + fp.write("""missing=0 +for t in types: + try: + tt = eval(t) + except NameError: + print "** Missing type:", t + missing = 1 +if missing: raise "Missing Types" +""") + fp.close() def initsilent(self): self.silent = 0 @@ -365,6 +384,7 @@ class Scanner: self.report("Bad raw spec: %s", `raw`) return type, name, args = self.whole.group('type', 'name', 'args') + type = regsub.gsub("[ \t]+", "_", type) if name in self.alreadydone: self.report("Name has already been defined: %s", `name`) return |