Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ogFromParam to Cryptol URI when importing Cryptol names #1915

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cryptol-saw-core/src/Verifier/SAW/Cryptol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import qualified Cryptol.Utils.Ident as C
( Ident, PrimIdent(..), mkIdent
, prelPrim, floatPrim, arrayPrim, suiteBPrim, primeECPrim
, ModName, modNameToText, identText, interactiveName
, ModPath(..), modPathSplit, ogModule, Namespace(NSValue)
, ModPath(..), modPathSplit, ogModule, ogFromParam, Namespace(NSValue)
, modNameChunksText
)
import qualified Cryptol.Utils.RecordMap as C
Expand Down Expand Up @@ -1375,10 +1375,14 @@ importName cnm =
let (topMod, nested) = C.modPathSplit (C.ogModule og)
topChunks = C.modNameChunksText topMod
modNms = topChunks ++ map C.identText nested
ifaceNms = case C.ogFromParam og of
Just i -> [C.identText i]
Nothing -> []
RyanGlScott marked this conversation as resolved.
Show resolved Hide resolved
shortNm = C.identText (C.nameIdent cnm)
longNm = Text.intercalate "::" (modNms ++ [shortNm])
nmParts = modNms ++ ifaceNms ++ [shortNm]
longNm = Text.intercalate "::" nmParts
aliases = [shortNm, longNm]
uri = cryptolURI (modNms ++ [shortNm]) Nothing
uri = cryptolURI nmParts Nothing
in pure (ImportedName uri aliases)

-- | Currently this imports declaration groups by inlining all the
Expand Down
Loading