File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -287,13 +287,9 @@ exprFNixDoc = \case
287287 , align (" else " <> withoutParens falseBody)
288288 ]
289289 NWith scope body ->
290- leastPrecedence $
291- vsep
292- [" with " <> withoutParens scope <> " ;" , align $ withoutParens body]
290+ prettyAddScope " with " scope body
293291 NAssert cond body ->
294- leastPrecedence $
295- vsep
296- [" assert " <> withoutParens cond <> " ;" , align $ withoutParens body]
292+ prettyAddScope " assert " cond body
297293 NSynHole name -> simpleExpr $ pretty (" ^" <> name)
298294 where
299295 prettyContainer h f t c =
@@ -302,6 +298,11 @@ exprFNixDoc = \case
302298 (const $ simpleExpr $ group $ nest 2 $ vsep $ [h] <> (f <$> c) <> [t])
303299 c
304300
301+ prettyAddScope h c b =
302+ leastPrecedence $
303+ vsep
304+ [h <> withoutParens c <> " ;" , align $ withoutParens b]
305+
305306
306307valueToExpr :: forall t f m . MonadDataContext f m => NValue t f m -> NExpr
307308valueToExpr = iterNValue (\ _ _ -> thk) phi
You can’t perform that action at this time.
0 commit comments