never executed always true always false
    1 {-# OPTIONS_GHC -Wall #-}
    2 module Reporting.Error.Syntax where
    3 
    4 import AST.V0_16
    5 import qualified Text.Parsec.Error as Parsec
    6 
    7 
    8 data Error
    9     = Parse [Parsec.Message]
   10     | InfixDuplicate (Ref [UppercaseIdentifier])
   11     | TypeWithoutDefinition String
   12     | PortWithoutAnnotation String
   13     | UnexpectedPort
   14     | DuplicateValueDeclaration String
   15     | DuplicateTypeDeclaration String
   16     | DuplicateDefinition String
   17     deriving (Eq, Show)
   18 
   19 
   20 instance Show Parsec.Message where
   21     show _ = "<Text.Parsec.Error.Message>"
   22 
   23 
   24 -- TAGGING PARSE ERRORS
   25 
   26 newline :: String
   27 newline = "NEWLINE"
   28 
   29 freshLine :: String
   30 freshLine = "FRESH_LINE"
   31 
   32 whitespace :: String
   33 whitespace = "WHITESPACE"
   34 
   35 keyword :: String -> String
   36 keyword kwd =
   37   "KEYWORD=" ++ kwd