AssignStatementAST.py (6999:f226c098c393) | AssignStatementAST.py (9106:aa9b75db7ea0) |
---|---|
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; --- 31 unchanged lines hidden (view full) --- 40 lcode = self.slicc.codeFormatter() 41 rcode = self.slicc.codeFormatter() 42 43 ltype = self.lvalue.generate(lcode) 44 rtype = self.rvalue.generate(rcode) 45 46 code("$lcode = $rcode;") 47 | 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; --- 31 unchanged lines hidden (view full) --- 40 lcode = self.slicc.codeFormatter() 41 rcode = self.slicc.codeFormatter() 42 43 ltype = self.lvalue.generate(lcode) 44 rtype = self.rvalue.generate(rcode) 45 46 code("$lcode = $rcode;") 47 |
48 if ltype != rtype: | 48 if not (ltype == rtype or (ltype.isInterface and ltype['interface'] == rtype.ident)): |
49 # FIXME - beckmann 50 # the following if statement is a hack to allow NetDest 51 # objects to be assigned to Sets this allows for the 52 # previous NetworkMessage Destiantion 'Set class' to 53 # migrate to the new NetworkMessage Destiantion 'NetDest 54 # class' 55 if str(ltype) != "NetDest" and str(rtype) != "Set": 56 self.error("Assignment type mismatch '%s' and '%s'", 57 ltype, rtype) | 49 # FIXME - beckmann 50 # the following if statement is a hack to allow NetDest 51 # objects to be assigned to Sets this allows for the 52 # previous NetworkMessage Destiantion 'Set class' to 53 # migrate to the new NetworkMessage Destiantion 'NetDest 54 # class' 55 if str(ltype) != "NetDest" and str(rtype) != "Set": 56 self.error("Assignment type mismatch '%s' and '%s'", 57 ltype, rtype) |