diff options
Diffstat (limited to 'pyGHDL/dom/Literal.py')
-rw-r--r-- | pyGHDL/dom/Literal.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyGHDL/dom/Literal.py b/pyGHDL/dom/Literal.py index 7c722583b..334355b35 100644 --- a/pyGHDL/dom/Literal.py +++ b/pyGHDL/dom/Literal.py @@ -39,6 +39,7 @@ from pyVHDLModel.VHDLModel import ( IntegerLiteral as VHDLModel_IntegerLiteral, FloatingPointLiteral as VHDLModel_FloatingPointLiteral, CharacterLiteral as VHDLModel_CharacterLiteral, + StringLiteral as VHDLModel_StringLiteral, ) __all__ = [] @@ -67,3 +68,12 @@ class CharacterLiteral(VHDLModel_CharacterLiteral): identifier = nodes.Get_Identifier(node) value = name_table.Get_Character(identifier) return cls(value) + + +@export +class StringLiteral(VHDLModel_StringLiteral): + @classmethod + def parse(cls, node): + stringID = nodes.Get_String8_Id(node) + value = name_table.Get_Name_Ptr(stringID) + return cls(value) |