From 3ceedaf5f5193fadadcb011c40df1688cfed279d Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 5 Oct 2024 17:13:26 -0600 Subject: Implement qualification. Big change. Implements qualification, which separates the qualification concerns from the ConsistencyCheck phase. I'm getting close to implementing a backend. --- src/Language/Fiddle/Compiler/Expansion.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Language/Fiddle/Compiler/Expansion.hs') 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) -- cgit