Skip to content

Commit

Permalink
explicit exposing for internals module + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aewering committed Dec 11, 2023
1 parent 85b341b commit 38b8c6c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/Generator.elm
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,24 @@ convert versions flags fileNames descriptors =
packageToFile packageName struct =
let
declarations =
List.concatMap Enum.toAST struct.enums
++ List.concatMap Message.toAST struct.messages
++ List.concatMap OneOf.toAST struct.oneOfs
removeDuplicateDeclarations
(List.concatMap Enum.toAST struct.enums
++ List.concatMap Message.toAST struct.messages
++ List.concatMap OneOf.toAST struct.oneOfs
)

exports =
Export.fromDeclarations declarations
in
C.file
(C.normalModule packageName [])
(C.normalModule packageName exports)
(List.map (\importedModule -> C.importStmt importedModule Nothing Nothing) (Set.toList <| Import.extractImports declarations))
(removeDuplicateDeclarations declarations)
(C.emptyFileComment |> fileComment versions struct.originFiles |> Just)
declarations
(C.emptyFileComment
|> fileComment versions struct.originFiles
|> C.docTagsFromExposings exports
|> Just
)

packageToReexportFile : ModuleName -> ModuleName -> Struct -> C.File
packageToReexportFile rootModName packageName struct =
Expand Down

0 comments on commit 38b8c6c

Please sign in to comment.