From 0a0f200a79a9e78b97addda6bd8e879d8c1c5d3e Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 19 Oct 2024 02:36:56 -0600 Subject: Change the AST to use Names instead of Identifiers for ObjDecls and BitsDecls This is to make anonymous expansion better and cleaner. It gets rid of the hash-mark hack introduced earlier. --- src/Language/Fiddle/Internal/UnitInterface.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Language/Fiddle/Internal') diff --git a/src/Language/Fiddle/Internal/UnitInterface.hs b/src/Language/Fiddle/Internal/UnitInterface.hs index 1302e40..26b0875 100644 --- a/src/Language/Fiddle/Internal/UnitInterface.hs +++ b/src/Language/Fiddle/Internal/UnitInterface.hs @@ -41,7 +41,7 @@ data QualifiedPath a = QualifiedPath { -- | The part of the qualified path that belongs to the package. packagePart :: [String], -- | The part of the qualified path that belongs to the object. - objectPart :: Maybe String, + objectPart :: [String], -- | The part of the qualified path that belongs to a register. registerPart :: [String], -- | The basename (unqualified path) @@ -56,7 +56,7 @@ qualifiedPathToString majorSeparator minorSeparator qp = filter (not . null) [ packagePart qp, - maybeToList (objectPart qp), + objectPart qp, registerPart qp, [basenamePart qp] ] @@ -64,7 +64,7 @@ qualifiedPathToString majorSeparator minorSeparator qp = -- | Turn a QualifiedPath with a string to a String list for scope lookups. qualifiedPathToList :: QualifiedPath String -> NonEmpty String qualifiedPathToList (QualifiedPath package obj reg base) = - NonEmpty.prependList (package ++ maybeToList obj ++ reg) (NonEmpty.singleton base) + NonEmpty.prependList (package ++ obj ++ reg) (NonEmpty.singleton base) -- | Metadata about an exported value. This includes things like the source -- location, doc comments and compiler directives associated with the exported -- cgit