Deleted Added
sdiff udiff text old ( 6999:f226c098c393 ) new ( 7839:9e556fb25900 )
full compact
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 41 unchanged lines hidden (view full) ---

50 self.cond.error("Condition of if stmt must be bool, type was '%s'",
51 ctype)
52
53 # Conditional
54 code.indent()
55 code('if ($cond_code) {')
56 # Then part
57 code.indent()
58 self.then.generate(code, return_type)
59 code.dedent()
60 # Else part
61 if self.else_:
62 code('} else {')
63 code.indent()
64 self.else_.generate(code, return_type)
65 code.dedent()
66 code('}') # End scope
67
68 def findResources(self, resources):
69 # Take a worse case look at both paths
70 self.then.findResources(resources)
71 if self.else_ is not None:
72 self.else_.findResources(resources)