MemberExprAST.py (6657:ef5fae93a3b2) MemberExprAST.py (6690:4dc4e494e4d8)
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;

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

42 def generate(self, code):
43 return_type, gcode = self.expr_ast.inline(True)
44 fix = code.nofix()
45 code("($gcode).m_${{self.field}}")
46 code.fix(fix)
47
48 # Verify that this is a valid field name for this type
49 if self.field not in return_type.data_members:
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;

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

42 def generate(self, code):
43 return_type, gcode = self.expr_ast.inline(True)
44 fix = code.nofix()
45 code("($gcode).m_${{self.field}}")
46 code.fix(fix)
47
48 # Verify that this is a valid field name for this type
49 if self.field not in return_type.data_members:
50 error("Invalid object field: " +
51 "Type '%s' does not have data member %s" % \
52 (return_type, self.field))
50 self.error("Invalid object field: " +
51 "Type '%s' does not have data member %s" % \
52 (return_type, self.field))
53
54 # Return the type of the field
55 return return_type.data_members[self.field].type
53
54 # Return the type of the field
55 return return_type.data_members[self.field].type