mirror of
https://github.com/anoma/juvix.git
synced 2024-09-19 20:48:55 +03:00
Fix printing of infix constructor values (#2144)
To print e.g. ```agda (::) :: nil ``` instead of ```agda :: :: nil ```
This commit is contained in:
parent
e9284b3ef6
commit
649d905b85
@ -558,7 +558,7 @@ instance (PrettyCode a) => PrettyCode [a] where
|
||||
|
||||
goBinary :: Member (Reader Options) r => Fixity -> Doc Ann -> [Value] -> Sem r (Doc Ann)
|
||||
goBinary fixity name = \case
|
||||
[] -> return name
|
||||
[] -> return (parens name)
|
||||
[arg] -> do
|
||||
arg' <- ppRightExpression appFixity arg
|
||||
return $ parens name <+> arg'
|
||||
@ -571,7 +571,7 @@ goBinary fixity name = \case
|
||||
|
||||
goUnary :: Member (Reader Options) r => Fixity -> Doc Ann -> [Value] -> Sem r (Doc Ann)
|
||||
goUnary fixity name = \case
|
||||
[] -> return name
|
||||
[] -> return (parens name)
|
||||
[arg] -> do
|
||||
arg' <- ppPostExpression fixity arg
|
||||
return $ arg' <+> name
|
||||
|
@ -426,3 +426,12 @@ tests:
|
||||
stdout:
|
||||
contains: "true"
|
||||
exit-status: 0
|
||||
|
||||
- name: infix-constructors
|
||||
command:
|
||||
- juvix
|
||||
- repl
|
||||
stdin: "(::) :: nil {Nat -> List Nat -> List Nat}"
|
||||
stdout:
|
||||
contains: "(::) :: nil"
|
||||
exit-status: 0
|
||||
|
Loading…
Reference in New Issue
Block a user