From 3a6a91c1b95a3797dda3d9348af360134cc3b5b1 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 14 May 2019 20:52:19 +0100 Subject: Use Identifier instead of Text --- src/VeriFuzz/Verilog/AST.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/VeriFuzz/Verilog') diff --git a/src/VeriFuzz/Verilog/AST.hs b/src/VeriFuzz/Verilog/AST.hs index 7fa2fbd..c8d85e6 100644 --- a/src/VeriFuzz/Verilog/AST.hs +++ b/src/VeriFuzz/Verilog/AST.hs @@ -529,14 +529,14 @@ getSourceId = getModule . modId . _Wrapped -- | May need to change this to Traversal to be safe. For now it will fail when -- the main has not been properly set with. -aModule :: Text -> Lens' SourceInfo ModDecl +aModule :: Identifier -> Lens' SourceInfo ModDecl aModule t = lens get_ set_ where set_ (SourceInfo top main) v = - SourceInfo top (main & getModule %~ update t v) + SourceInfo top (main & getModule %~ update (getIdentifier t) v) update top v m@(ModDecl (Identifier i) _ _ _ _) | i == top = v | otherwise = m - get_ (SourceInfo _ main) = head . filter (f t) $ main ^.. getModule + get_ (SourceInfo _ main) = head . filter (f $ getIdentifier t) $ main ^.. getModule f top (ModDecl (Identifier i) _ _ _ _) = i == top -- cgit