ruby: added error message to isinstance check
authorBrad Beckmann <Brad.Beckmann@amd.com>
Thu, 19 Nov 2009 00:34:32 +0000 (16:34 -0800)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Thu, 19 Nov 2009 00:34:32 +0000 (16:34 -0800)
Added error message when a symbol is not an instance of a particular expected
type.

src/mem/slicc/symbols/SymbolTable.py

index 17d7dfad3dacc02dd80cf4686754d7ce1a645bf0..6b1bf13e63c87691353195b4b63e6b834a880d18 100644 (file)
@@ -72,7 +72,10 @@ class SymbolTable(object):
                 continue
 
             if types is not None:
-                assert isinstance(symbol, types)
+                if not isinstance(symbol, types):
+                    symbol.error("Symbol '%s' is not of types '%s'.",
+                                 symbol,
+                                 types)
 
             return symbol