mirror of
https://github.com/swarm-game/swarm
synced 2024-11-22 01:11:39 +00:00
Put end on separate line when pretty printing definitions (#2100)
Some checks are pending
Enforce issue references for TODOs / Enforce issue references (push) Waiting to run
Haskell-CI-Windows / Haskell-CI - ${{ matrix.os }} - ghc-${{ matrix.ghc }} (3.10.1.0, 9.8.2, windows-latest) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.2.8, ghc, 9.2.8, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.4.8, ghc, 9.4.8, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.6.5, ghc, 9.6.5, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.8.2, ghc, 9.8.2, ghcup) (push) Waiting to run
HLint / HLint (push) Waiting to run
Normalize cabal file formatting / Normalize cabal (push) Waiting to run
Some checks are pending
Enforce issue references for TODOs / Enforce issue references (push) Waiting to run
Haskell-CI-Windows / Haskell-CI - ${{ matrix.os }} - ghc-${{ matrix.ghc }} (3.10.1.0, 9.8.2, windows-latest) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.2.8, ghc, 9.2.8, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.4.8, ghc, 9.4.8, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.6.5, ghc, 9.6.5, ghcup) (push) Waiting to run
Haskell-CI / Haskell-CI - Linux - ${{ matrix.compiler }} (false, ghc-9.8.2, ghc, 9.8.2, ghcup) (push) Waiting to run
HLint / HLint (push) Waiting to run
Normalize cabal file formatting / Normalize cabal (push) Waiting to run
```diff def intersperse = \n. \f2. \f1. - if (n > 0) {f1; if (n > 1) {f2} {}; intersperse (n - 1) f2 f1} {} end + if (n > 0) {f1; if (n > 1) {f2} {}; intersperse (n - 1) f2 f1} {} + end ``` You can test it with: ```sh swarm format -i data/scenarios/Challenges/_arbitrage/solution.sw ``` * caused by #1928 where def was made more similar to let
This commit is contained in:
parent
f82a544cc5
commit
6d1027cc56
@ -316,7 +316,7 @@ instance PrettyPrec (Term' ty) where
|
||||
]
|
||||
SLet LSDef _ (LV _ x) mty _ t1 t2 ->
|
||||
mconcat $
|
||||
prettyDefinition "def" x mty t1 <+> "end"
|
||||
sep [prettyDefinition "def" x mty t1, "end"]
|
||||
: case t2 of
|
||||
Syntax' _ (TConst Noop) _ _ -> []
|
||||
_ -> [hardline, hardline, ppr t2]
|
||||
|
Loading…
Reference in New Issue
Block a user