diff options
author | Yann Herklotz <git@ymhg.org> | 2019-05-14 20:52:19 +0100 |
---|---|---|
committer | Yann Herklotz <git@ymhg.org> | 2019-05-14 20:52:19 +0100 |
commit | 3a6a91c1b95a3797dda3d9348af360134cc3b5b1 (patch) | |
tree | 4d190070c98ea30a33f8b4c1ca67a9cf5e8c44d0 /src/VeriFuzz/Verilog/AST.hs | |
parent | da73bee497727233f9340dcde6d00b83ea33f3e6 (diff) | |
download | verismith-3a6a91c1b95a3797dda3d9348af360134cc3b5b1.tar.gz verismith-3a6a91c1b95a3797dda3d9348af360134cc3b5b1.zip |
Use Identifier instead of Text
Diffstat (limited to 'src/VeriFuzz/Verilog/AST.hs')
-rw-r--r-- | src/VeriFuzz/Verilog/AST.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 |