summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/Errors/Basic.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Parser/Errors/Basic.hs')
-rw-r--r--compiler/GHC/Parser/Errors/Basic.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/GHC/Parser/Errors/Basic.hs b/compiler/GHC/Parser/Errors/Basic.hs
new file mode 100644
index 0000000000..6cec1da8d6
--- /dev/null
+++ b/compiler/GHC/Parser/Errors/Basic.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE LambdaCase #-}
+module GHC.Parser.Errors.Basic where
+
+import GHC.Utils.Outputable ( SDoc, text )
+
+-- | The operator symbol in the 'PsOperatorWhitespaceExtConflictMessage' diagnostic.
+data OperatorWhitespaceSymbol
+ = OperatorWhitespaceSymbol_PrefixPercent
+ | OperatorWhitespaceSymbol_PrefixDollar
+ | OperatorWhitespaceSymbol_PrefixDollarDollar
+
+pprOperatorWhitespaceSymbol :: OperatorWhitespaceSymbol -> SDoc
+pprOperatorWhitespaceSymbol = \case
+ OperatorWhitespaceSymbol_PrefixPercent -> text "%"
+ OperatorWhitespaceSymbol_PrefixDollar -> text "$"
+ OperatorWhitespaceSymbol_PrefixDollarDollar -> text "$$"
+
+-- | The operator occurrence type in the 'PsOperatorWhitespaceMessage' diagnostic.
+data OperatorWhitespaceOccurrence
+ = OperatorWhitespaceOccurrence_Prefix
+ | OperatorWhitespaceOccurrence_Suffix
+ | OperatorWhitespaceOccurrence_TightInfix