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:
parent
bfcaf6bde4
commit
14b91c2f2b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user