Skip to content

Commit e0d3a84

Browse files
committed
improve submodule support for CLI cryptol_load
- This fix doesn't fully solve the problem.
1 parent e9040ff commit e0d3a84

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ updateFFITypes m env = env { eFFITypes = eFFITypes' }
586586
bindCryptolModule :: (P.ModName, CryptolModule) -> CryptolEnv -> CryptolEnv
587587
bindCryptolModule (modName, CryptolModule sm tm) env =
588588
env { eExtraNames = flip (foldr addName) (Map.keys tm') $
589-
flip (foldr addTSyn) (Map.keys sm) $ eExtraNames env
589+
flip (foldr addTSyn) (Map.keys sm) $
590+
flip (foldr addSubModule) (Map.keys tm') $
591+
-- FIXME: This added function doesn't really
592+
-- fix the submodule support bugs.
593+
eExtraNames env
590594
, eExtraTSyns = Map.union sm (eExtraTSyns env)
591595
, eExtraTypes = Map.union (fmap fst tm') (eExtraTypes env)
592596
, eTermEnv = Map.union (fmap snd tm') (eTermEnv env)
@@ -599,6 +603,10 @@ bindCryptolModule (modName, CryptolModule sm tm) env =
599603
f _ = Nothing
600604

601605
addName name = MN.shadowing (MN.singletonNS C.NSValue (P.mkQual modName (MN.nameIdent name)) name)
606+
-- FIXME: suspicious. (we need to do any C.NSModule?)
607+
608+
addSubModule name = MN.shadowing (MN.singletonNS C.NSModule (P.mkQual modName (MN.nameIdent name)) name)
609+
602610
addTSyn name = MN.shadowing (MN.singletonNS C.NSType (P.mkQual modName (MN.nameIdent name)) name)
603611

604612
-- | NOTE: this is only used in the "cryptol_extract" primitive.

0 commit comments

Comments
 (0)