Handle sequences constants for module identifiers

This commit is contained in:
Frederik Hanghøj Iversen 2019-10-11 16:26:15 +02:00
parent a698ac82ea
commit 0fcc2dbf6c
1 changed files with 8 additions and 3 deletions

View File

@ -129,9 +129,14 @@ appendToContext n = updateContext go
go q = name2ns n <> q
name2ns :: Name -> Namespace
name2ns (Name o) = case o of
Aeson.Array [_, _, Aeson.String s] -> [s]
_ -> error $ show o
name2ns (Name o) = go o
where
go :: Aeson.Value -> Namespace
go = \case
Aeson.Array [Aeson.String "const", x, Aeson.String s] -> case x of
Aeson.Null -> [s]
_ -> go x <> [s]
_ -> error $ show o
class References a where
entries :: MyMonad m => a -> m ()