diff --git a/src/Rubyhs/References.hs b/src/Rubyhs/References.hs index ebca064..3267ae7 100644 --- a/src/Rubyhs/References.hs +++ b/src/Rubyhs/References.hs @@ -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 ()