summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Compiler/Expansion.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-10-05 17:13:26 -0600
committerJosh Rahm <joshuarahm@gmail.com>2024-10-05 17:13:26 -0600
commit3ceedaf5f5193fadadcb011c40df1688cfed279d (patch)
tree772c8a0c607d68e287addc59bdde71172edd10b1 /src/Language/Fiddle/Compiler/Expansion.hs
parent407e41489cc22fbf0518fd370530f8857b8c3ed0 (diff)
downloadfiddle-3ceedaf5f5193fadadcb011c40df1688cfed279d.tar.gz
fiddle-3ceedaf5f5193fadadcb011c40df1688cfed279d.tar.bz2
fiddle-3ceedaf5f5193fadadcb011c40df1688cfed279d.zip
Implement qualification.
Big change. Implements qualification, which separates the qualification concerns from the ConsistencyCheck phase. I'm getting close to implementing a backend.
Diffstat (limited to 'src/Language/Fiddle/Compiler/Expansion.hs')
-rw-r--r--src/Language/Fiddle/Compiler/Expansion.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Language/Fiddle/Compiler/Expansion.hs b/src/Language/Fiddle/Compiler/Expansion.hs
index 1c4df45..19b7323 100644
--- a/src/Language/Fiddle/Compiler/Expansion.hs
+++ b/src/Language/Fiddle/Compiler/Expansion.hs
@@ -120,8 +120,8 @@ instance AdvanceStage CurrentStage RegisterBitsTypeRef where
<$> advanceStage path typeref
<*> advanceStage path expr
<*> pure annot
- RegisterBitsReference () name annot ->
- return $ RegisterBitsReference () name annot
+ RegisterBitsReference q name annot ->
+ return $ RegisterBitsReference q name annot
RegisterBitsJustBits expr annot ->
RegisterBitsJustBits
<$> advanceStage path expr
@@ -130,16 +130,16 @@ instance AdvanceStage CurrentStage RegisterBitsTypeRef where
ident <-
internAnonymousBitsType path
=<< advanceStage path anonType
- return $ RegisterBitsReference () (identToName ident) annot
+ return $ RegisterBitsReference (pure ()) (identToName ident) annot
instance AdvanceStage CurrentStage ObjType where
advanceStage path = \case
(AnonymousObjType _ (Identity body) annot) -> do
body' <- advanceStage path body
identifier <- internObjType path body'
- return (ReferencedObjType () (identToName identifier) annot)
- (ReferencedObjType () name annot) ->
- return $ ReferencedObjType () name annot
+ return (ReferencedObjType (pure ()) (identToName identifier) annot)
+ (ReferencedObjType q name annot) ->
+ return $ ReferencedObjType q name annot
(ArrayObjType objType expr a) ->
ArrayObjType
<$> advanceStage path objType
@@ -197,13 +197,13 @@ reconfigureFiddleDecls p decls = do
where
resolveAnonymousObjType (Linkage linkage, objTypeBody) =
ObjTypeDecl
- ()
+ (pure ())
(Identifier linkage (annot objTypeBody))
(pure objTypeBody)
(annot objTypeBody)
resolveAnonymousBitsType (Linkage linkage, AnonymousEnumBody expr body a) =
- BitsDecl () (Identifier linkage a) (EnumBitType expr body a) a
+ BitsDecl (pure ()) (Identifier linkage a) (EnumBitType expr body a) a
identToName :: Identifier I a -> Name I a
identToName ident = Name (NonEmpty.singleton ident) (annot ident)