Skip to content

Commit e27537d

Browse files
committed
improve comments (per PR review requests)
1 parent bb89ba9 commit e27537d

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

cryptol-saw-core/src/CryptolSAWCore/CryptolEnv.hs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,13 @@ nameMatcher xs =
185185

186186
-- Initialize ------------------------------------------------------------------
187187

188-
-- | initCryptolEnv - Create initial CryptolEnv, this involves loading the built-in modules
189-
-- (preludeName, arrayName, preludeReferenceName) and translating them into SAWCore, and
188+
-- | initCryptolEnv - Create initial CryptolEnv, this involves loading
189+
-- the built-in modules (preludeName, arrayName,
190+
-- preludeReferenceName) and translating them into SAWCore, and
190191
-- putting them into scope.
191192
--
192-
-- NOTE: submodules in these built-in modules would be suppported here.
193+
-- NOTE: submodules in these built-in modules are supported in this code.
193194
--
194-
-- FIXME: There is some code duplication between this and `loadCryptolModule` and `importModule`.
195-
196195
initCryptolEnv ::
197196
(?fileReader :: FilePath -> IO ByteString) =>
198197
SharedContext -> IO CryptolEnv
@@ -230,7 +229,6 @@ initCryptolEnv sc = do
230229
let refMod = T.tcTopEntityToModule refTop
231230

232231
-- Set up reference implementation redirections
233-
-- FIXME: Unclear, add some documentation here.
234232
let refDecls = T.mDecls refMod
235233
let nms = Set.toList (MI.ifsPublic (TIface.genIfaceNames refMod))
236234

@@ -434,9 +432,7 @@ checkNotParameterized m =
434432
-- FIXME: Code duplication, these two functions are highly similar:
435433
-- - loadCryptolModule
436434
-- - importModule
437-
--
438-
-- TODO:
439-
-- - common up the common code
435+
-- - TODO: "common up" the common code per #2569.
440436

441437
-- | loadCryptolModule - load a cryptol module and return a handle to
442438
-- the `CryptolModule`. The contents of the module are not imported.
@@ -585,7 +581,10 @@ updateFFITypes m eTermEnv' eFFITypes' =
585581
-- FIXME:
586582
-- - submodules are not handled correctly below.
587583
-- - the code is duplicating functionality that we have with `importModule`
588-
--
584+
-- TODO:
585+
-- - new design in PR#2569 should replace this function such that the
586+
-- fundamental work is done via `importModule`.
587+
589588
bindCryptolModule :: (P.ModName, CryptolModule) -> CryptolEnv -> CryptolEnv
590589
bindCryptolModule (modName, CryptolModule sm tm) env =
591590
env { eExtraNames = flip (foldr addName) (Map.keys tm') $
@@ -604,7 +603,6 @@ bindCryptolModule (modName, CryptolModule sm tm) env =
604603
f _ = Nothing
605604

606605
addName name = MN.shadowing (MN.singletonNS C.NSValue (P.mkQual modName (MN.nameIdent name)) name)
607-
-- FIXME: suspicious. (Do we need to do any C.NSModule?)
608606

609607
addSubModule name = MN.shadowing (MN.singletonNS C.NSModule (P.mkQual modName (MN.nameIdent name)) name)
610608

@@ -628,8 +626,9 @@ extractDefFromCryptolModule (CryptolModule _ tm) name =
628626
-- environment with a module. Closely mirrors the sawscript command "import".
629627
--
630628
-- NOTE:
631-
-- - the module can be qualified or not (per 'as' argument).
632-
-- - per 'vis' we can import public definitions or *all* (i.e., kinternal and public) definitions.
629+
-- - the module can be qualified or not (per 'as' argument). per
630+
-- - 'vis' we can import public definitions or *all* (i.e., internal
631+
-- and public) definitions.
633632

634633
importModule ::
635634
(?fileReader :: FilePath -> IO ByteString) =>

0 commit comments

Comments
 (0)