Skip to content

Commit

Permalink
top inside braces
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz authored and paulcadman committed May 17, 2024
1 parent 84f2264 commit c463f61
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Juvix/Compiler/Concrete/Print/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,11 @@ ppIterator isTop Iterator {..} = do
rngs = ppCode <$> _iteratorRanges
is' = parens . hsepSemicolon <$> nonEmpty is
rngs' = parens . hsepSemicolon <$> nonEmpty rngs
b = ppMaybeTopExpression isTop _iteratorBody
b'
| _iteratorBodyBraces = braces (oneLineOrNextNoIndent b)
| otherwise = line <> b
b
| _iteratorBodyBraces = braces (oneLineOrNextNoIndent (ppTopExpressionType _iteratorBody))
| otherwise = line <> ppMaybeTopExpression isTop _iteratorBody
parensIf _iteratorParens $
hang (n <+?> is' <+?> rngs' <> b')
hang (n <+?> is' <+?> rngs' <> b)

instance PrettyPrint S.AName where
ppCode n = annotated (AnnKind (S.getNameKind n)) (noLoc (pretty (n ^. S.anameVerbatim)))
Expand Down

0 comments on commit c463f61

Please sign in to comment.