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

Show import with public keyword in the html doc #2456

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/Juvix/Compiler/Backend/Html/Translation/FromTyped.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ goStatement = \case
StatementOpenModule t -> goOpen t
StatementFunctionDef t -> goFunctionDef t
StatementSyntax s -> goSyntax s
StatementImport {} -> mempty
StatementImport s -> goImport s
StatementModule m -> goLocalModule m
StatementProjectionDef {} -> mempty
where
Expand Down Expand Up @@ -507,6 +507,11 @@ goLocalModule def = fmap (fromMaybe mempty) . runFail $ do
<$> mconcatMap goStatement (def ^. moduleBody)
return (header' <> body')

goImport :: forall r. (Members '[Reader HtmlOptions] r) => Import 'Scoped -> Sem r Html
goImport op
| Just Public <- op ^? importOpen . _Just . openPublic = noDefHeader <$> ppCodeHtml defaultOptions op
| otherwise = mempty

goOpen :: forall r. (Members '[Reader HtmlOptions] r) => OpenModule 'Scoped -> Sem r Html
goOpen op
| Public <- op ^. openModuleParams . openPublic = noDefHeader <$> ppCodeHtml defaultOptions op
Expand Down