diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2005-06-30 15:00:13 +0000 |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2005-06-30 15:00:13 +0000 |
commit | e4be74b730506a6f2a5efb0e5f7ea61cc6c7e1a6 (patch) | |
tree | 82f226f4022d389d665be636219bc8b1d121e4f0 /Tools/bgen | |
parent | 6a1900c469cea2c433be84ee2380101084c29bd9 (diff) | |
download | cpython-e4be74b730506a6f2a5efb0e5f7ea61cc6c7e1a6.tar.gz |
More factorization: added a method getrvforcallit(). This allows a C++
bridge to combine declaration and assignment to the return value
temporary, allowing us to handle functions returning const values.
Diffstat (limited to 'Tools/bgen')
-rw-r--r-- | Tools/bgen/bgen/bgenGenerator.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Tools/bgen/bgen/bgenGenerator.py b/Tools/bgen/bgen/bgenGenerator.py index 03e8b45deb..83ff552b0c 100644 --- a/Tools/bgen/bgen/bgenGenerator.py +++ b/Tools/bgen/bgen/bgenGenerator.py @@ -213,10 +213,7 @@ class FunctionGenerator(BaseFunctionGenerator): def callit(self): args = "" - if self.rv: - s = "%s = %s(" % (self.rv.name, self.callname) - else: - s = "%s(" % self.name + s = "%s%s(" % (self.getrvforcallit(), self.callname) sep = ",\n" + ' '*len(s) for arg in self.argumentList: if arg is self.rv: @@ -224,12 +221,15 @@ class FunctionGenerator(BaseFunctionGenerator): s = arg.passArgument() if args: s = sep + s args = args + s + Output("%s%s(%s);", + self.getrvforcallit(), self.callname, args) + + def getrvforcallit(self): if self.rv: - Output("%s = %s(%s);", - self.rv.name, self.callname, args) + return "%s = " % self.rv.name else: - Output("%s(%s);", self.callname, args) - + return "" + def checkit(self): for arg in self.argumentList: arg.errorCheck() |