From 6acaf4b6baba21f8eca7520f518c62ffd75abd04 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 29 Jun 2021 19:10:33 +0200 Subject: Minor changes. --- pyGHDL/dom/_Translate.py | 2 +- pyGHDL/requirements.txt | 2 +- testsuite/pyunit/dom/Expressions.py | 8 ++++---- testsuite/pyunit/dom/Literals.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pyGHDL/dom/_Translate.py b/pyGHDL/dom/_Translate.py index 8229755f3..fc8f86b42 100644 --- a/pyGHDL/dom/_Translate.py +++ b/pyGHDL/dom/_Translate.py @@ -270,7 +270,7 @@ def GetAnonymousTypeFromNode(node: Iir) -> BaseType: r = GetRangeFromNode(typeDefinition) return IntegerType(node, typeName, r) - elif kind == nodes.Iir_Kind.Parenthesis_Name: + elif kind in (nodes.Iir_Kind.Attribute_Name, nodes.Iir_Kind.Parenthesis_Name): n = GetNameFromNode(typeDefinition) return IntegerType(node, typeName, n) diff --git a/pyGHDL/requirements.txt b/pyGHDL/requirements.txt index d09e07a4a..013f8cbef 100644 --- a/pyGHDL/requirements.txt +++ b/pyGHDL/requirements.txt @@ -1,3 +1,3 @@ pydecor>=2.0.1 -#pyVHDLModel==0.10.5 +#pyVHDLModel==0.11.1 https://github.com/VHDL/pyVHDLModel/archive/dev.zip#pyVHDLModel diff --git a/testsuite/pyunit/dom/Expressions.py b/testsuite/pyunit/dom/Expressions.py index 6f64c6c86..21b0cd03b 100644 --- a/testsuite/pyunit/dom/Expressions.py +++ b/testsuite/pyunit/dom/Expressions.py @@ -103,8 +103,8 @@ class Expressions(TestCase): # default: Expression = self.parse(filename, constantDeclartion) # # # Start checks - # self.assertTrue(isinstance(default, AbsoluteExpression)) - # self.assertTrue(isinstance(default.Operand, SimpleObjectOrFunctionCallSymbol)) + # self.assertIsInstance(default, AbsoluteExpression) + # self.assertIsInstance(default.Operand, SimpleObjectOrFunctionCallSymbol) # self.assertTrue(default.Operand.SymbolName == "-3") # def test_Aggregare(self): @@ -130,6 +130,6 @@ class Expressions(TestCase): # package: Package = design.Documents[0].Packages[0] # item: Constant = package.DeclaredItems[0] # default: Expression = item.DefaultExpression - # self.assertTrue(isinstance(default, InverseExpression)) - # self.assertTrue(isinstance(default.Operand, SimpleObjectOrFunctionCallSymbol)) + # self.assertIsInstance(default, InverseExpression) + # self.assertIsInstance(default.Operand, SimpleObjectOrFunctionCallSymbol) # self.assertTrue(default.Operand.SymbolName == "true") diff --git a/testsuite/pyunit/dom/Literals.py b/testsuite/pyunit/dom/Literals.py index 905ea7749..9dc40d4cb 100644 --- a/testsuite/pyunit/dom/Literals.py +++ b/testsuite/pyunit/dom/Literals.py @@ -78,8 +78,8 @@ class Literals(TestCase): self.assertEqual(len(package.DeclaredItems), len(expected)) for i in range(len(expected)): item: Constant = package.DeclaredItems[i] - self.assertTrue(isinstance(item, Constant)) + self.assertIsInstance(item, Constant) self.assertTrue(item.Identifier == "c{}".format(i)) self.assertTrue(str(item.SubType.SymbolName) == "integer") - self.assertTrue(isinstance(item.DefaultExpression, IntegerLiteral)) + self.assertIsInstance(item.DefaultExpression, IntegerLiteral) self.assertTrue(item.DefaultExpression.Value == expected[i]) -- cgit v1.2.3