{-# 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 :: OperatorWhitespaceSymbol -> SDoc
pprOperatorWhitespaceSymbol = \case
  OperatorWhitespaceSymbol
OperatorWhitespaceSymbol_PrefixPercent      -> String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"%"
  OperatorWhitespaceSymbol
OperatorWhitespaceSymbol_PrefixDollar       -> String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"$"
  OperatorWhitespaceSymbol
OperatorWhitespaceSymbol_PrefixDollarDollar -> String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"$$"

-- | The operator occurrence type in the 'PsOperatorWhitespaceMessage' diagnostic.
data OperatorWhitespaceOccurrence
   = OperatorWhitespaceOccurrence_Prefix
   | OperatorWhitespaceOccurrence_Suffix
   | OperatorWhitespaceOccurrence_TightInfix