Skip to content

Commit

Permalink
Resolve URI-based names when loading the external SAWCore format (#1658)
Browse files Browse the repository at this point in the history
* Resolve URI-based names when loading the external SAWCore format

* Remove a debug print statement
  • Loading branch information
chameco committed May 10, 2022
1 parent e4c2c47 commit e1d8d9d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions saw-core/src/Verifier/SAW/ExternalFormat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,15 @@ scReadExternal sc input =
lift (scResolveNameByURI sc (moduleIdentToURI ident)) >>= \case
Just vi' -> pure (EC vi' nmi t')
Nothing -> lift $ fail $ "scReadExternal: missing module identifier: " ++ show ident
_ ->
case Map.lookup vi vs of
Just vi' -> pure $ EC vi' nmi t'
Nothing ->
do vi' <- lift $ scFreshGlobalVar sc
State.put (ts, nms, Map.insert vi vi' vs)
pure $ EC vi' nmi t'
ImportedName uri _aliases ->
lift (scResolveNameByURI sc uri) >>= \case
Just vi' -> pure (EC vi' nmi t')
Nothing -> case Map.lookup vi vs of
Just vi' -> pure $ EC vi' nmi t'
Nothing ->
do vi' <- lift $ scFreshGlobalVar sc
State.put (ts, nms, Map.insert vi vi' vs)
pure $ EC vi' nmi t'

readEC :: String -> String -> ReadM (ExtCns Term)
readEC i t =
Expand Down

0 comments on commit e1d8d9d

Please sign in to comment.