summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Internal/UnitInterface.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-10-19 02:36:56 -0600
committerJosh Rahm <joshuarahm@gmail.com>2024-10-19 02:36:56 -0600
commit0a0f200a79a9e78b97addda6bd8e879d8c1c5d3e (patch)
treec0c58bc9d4ae044624c039b3004b86fdc7cbbdc7 /src/Language/Fiddle/Internal/UnitInterface.hs
parente9ed9fe9aae2c0ac913cf1d175166e983e0a1b30 (diff)
downloadfiddle-0a0f200a79a9e78b97addda6bd8e879d8c1c5d3e.tar.gz
fiddle-0a0f200a79a9e78b97addda6bd8e879d8c1c5d3e.tar.bz2
fiddle-0a0f200a79a9e78b97addda6bd8e879d8c1c5d3e.zip
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.
Diffstat (limited to 'src/Language/Fiddle/Internal/UnitInterface.hs')
-rw-r--r--src/Language/Fiddle/Internal/UnitInterface.hs6
1 files changed, 3 insertions, 3 deletions
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