diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-02-25 23:56:33 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-02-25 23:56:33 +0100 |
commit | ef95be4403d09ebecbaef80e668d52fc5ecd9b46 (patch) | |
tree | db632197cae91c1a99e4f874a9b8feeb491139c0 | |
parent | 7fa10a9a07c7160531baf595d1111277c17a38b2 (diff) |
Pretty: Allow colouring exts (currently not)
-rw-r--r-- | src/AST/Pretty.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/AST/Pretty.hs b/src/AST/Pretty.hs index 35c78c1..c7b1497 100644 --- a/src/AST/Pretty.hs +++ b/src/AST/Pretty.hs @@ -298,7 +298,7 @@ ppLam args body = ppString "(" <> hang 2 (ppString "\\" <> sep (args ++ [ppStrin <> softline <> body <> ppString ")") ppX :: PrettyX x => Expr x env t -> ADoc -ppX expr = ppString $ prettyXsuffix (extOf expr) +ppX expr = annotate AExt $ ppString $ prettyXsuffix (extOf expr) data Fixity = Prefix | Infix deriving (Show) @@ -352,7 +352,7 @@ ppParen :: Bool -> Doc x -> Doc x ppParen True = parens ppParen False = id -data Annot = AKey | AWith | AHighlight | AMonoid +data Annot = AKey | AWith | AHighlight | AMonoid | AExt deriving (Show) annotToANSI :: Annot -> PT.AnsiStyle @@ -360,6 +360,7 @@ annotToANSI AKey = PT.bold annotToANSI AWith = PT.color PT.Red <> PT.underlined annotToANSI AHighlight = PT.color PT.Blue annotToANSI AMonoid = PT.color PT.Green +annotToANSI AExt = mempty type ADoc = Doc Annot |