1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-04 13:42:04 +03:00

Print terminating keyword (#145)

This commit is contained in:
Jonathan Cubides 2022-06-08 10:07:35 +02:00 committed by GitHub
parent bfcaf6bde4
commit 14b91c2f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,6 +136,9 @@ kwCompile = keyword Str.compile
kwForeign :: Doc Ann
kwForeign = keyword Str.foreign_
kwTerminating :: Doc Ann
kwTerminating = keyword Str.terminating
kwBraceL :: Doc Ann
kwBraceL = delimiter "{"
@ -501,9 +504,10 @@ instance SingI s => PrettyCode (OpenModule s) where
instance SingI s => PrettyCode (TypeSignature s) where
ppCode TypeSignature {..} = do
let sigTerminating' = if _sigTerminating then kwTerminating <> line else mempty
sigName' <- annDef _sigName <$> ppSymbol _sigName
sigType' <- ppExpression _sigType
return $ sigName' <+> kwColon <+> sigType'
return $ sigTerminating' <> sigName' <+> kwColon <+> sigType'
instance SingI s => PrettyCode (Function s) where
ppCode :: forall r. Members '[Reader Options] r => Function s -> Sem r (Doc Ann)