From 72eeba5fd6178409b4aab5eb8dbfaf4460f6841c Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 3 Oct 2024 17:14:46 -0600 Subject: Wip: added -Wall --- src/Language/Fiddle/Compiler/ConsistencyCheck.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/Language/Fiddle/Compiler/ConsistencyCheck.hs') diff --git a/src/Language/Fiddle/Compiler/ConsistencyCheck.hs b/src/Language/Fiddle/Compiler/ConsistencyCheck.hs index 7ca618b..79ac9e7 100644 --- a/src/Language/Fiddle/Compiler/ConsistencyCheck.hs +++ b/src/Language/Fiddle/Compiler/ConsistencyCheck.hs @@ -159,11 +159,11 @@ deriving instance AdvanceStage CurrentStage FiddleDecl instance AdvanceStage CurrentStage (Directed FiddleDecl) where modifyState (Directed directives t _) s = case t of - (BitsDecl () id typ annotation) -> do + (BitsDecl _ id typ annotation) -> do typeSize <- getTypeSize typ insertTypeSize annotation s id typeSize return s - (PackageDecl () n _ _) -> do + (PackageDecl _ n _ _) -> do let strs = nameToList n let (LocalState scopePath) = s @@ -180,7 +180,7 @@ instance AdvanceStage CurrentStage (Directed FiddleDecl) where _ -> return s customAdvanceStage (Directed directives t a) (LocalState scopePath) = case t of - (ObjTypeDecl () ident (Identity body) annot) -> do + (ObjTypeDecl q ident (Identity body) annot) -> do (body', size) <- objTypeBodyToStage3 (LocalState scopePath) body 0 let fullName = @@ -192,12 +192,9 @@ instance AdvanceStage CurrentStage (Directed FiddleDecl) where let ui' = insertIntoUnitInterface fullName ui annot (ExportedObjType size) modify' $ \gs -> gs {unitInterface = ui'} - return $ Just $ Directed directives (ObjTypeDecl () ident (Identity body') annot) a + return $ Just $ Directed directives (ObjTypeDecl q ident (Identity body') annot) a _ -> return Nothing -nameToList :: Name f a -> [String] -nameToList (Name idents _) = map (\(Identifier (Text.unpack -> s) _) -> s) (toList idents) - objTypeBodyToStage3 :: LocalState -> ObjTypeBody CurrentStage I Annot -> @@ -456,8 +453,8 @@ registerBitsTypeRefToStage3 localState = \case ( RegisterBitsArray ref' expr' a, size * fromIntegral multiplier ) - RegisterBitsReference () name a -> - (RegisterBitsReference () name a,) <$> lookupTypeSize localState name + RegisterBitsReference q name a -> + (RegisterBitsReference q name a,) <$> lookupTypeSize localState name RegisterBitsJustBits expr a -> do expr' <- advanceStage localState expr (RegisterBitsJustBits expr' a,) -- cgit