copilot-prettyprinter 3.20 → 4.0
raw patch · 3 files changed
+13/−3 lines, 3 filesdep ~copilot-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: copilot-core
API changes (from Hackage documentation)
Files
- CHANGELOG +5/−0
- copilot-prettyprinter.cabal +2/−2
- src/Copilot/PrettyPrint.hs +6/−1
CHANGELOG view
@@ -1,3 +1,8 @@+2024-09-07+ * Version bump (4.0). (#532)+ * Add support for pretty-printing struct update expressions. (#526)+ * Add support for pretty-printing array update expressions. (#36)+ 2024-07-07 * Version bump (3.20). (#522)
copilot-prettyprinter.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: copilot-prettyprinter-version: 3.20+version: 4.0 synopsis: A prettyprinter of Copilot Specifications. description: A prettyprinter of Copilot specifications.@@ -45,7 +45,7 @@ base >= 4.9 && < 5, pretty >= 1.0 && < 1.2, - copilot-core >= 3.20 && < 3.21+ copilot-core >= 4.0 && < 4.1 exposed-modules:
src/Copilot/PrettyPrint.hs view
@@ -99,7 +99,10 @@ BwXor _ -> ppInfix "^" BwShiftL _ _ -> ppInfix "<<" BwShiftR _ _ -> ppInfix ">>"- Index _ -> ppInfix ".!!"+ Index _ -> ppInfix "!"+ UpdateField (Struct _) _ f -> \ doc1 doc2 ->+ parens $ doc1 <+> text "##" <+> text (accessorName f) <+> text "=:" <+> doc2+ UpdateField _ _ _ -> impossible "ppOp2" "Copilot.PrettyPrint" -- | Pretty-print a ternary operation. ppOp3 :: Op3 a b c d -> Doc -> Doc -> Doc -> Doc@@ -108,6 +111,8 @@ text "(if" <+> doc1 <+> text "then" <+> doc2 <+> text "else" <+> doc3 <> text ")"+ UpdateArray _ -> \ doc1 doc2 doc3 ->+ parens $ doc1 <+> text "!!" <+> doc2 <+> text "=:" <+> doc3 -- | Parenthesize two 'Doc's, separated by an infix 'String'. ppInfix :: String -> Doc -> Doc -> Doc