Removed the Metadata hack (where emptyMeta was "equal" to every other Meta data tag)

This commit is contained in:
Neil Brown 2007-11-10 14:14:18 +00:00
parent da76be9dab
commit a5c02f36ec

View File

@ -30,7 +30,7 @@ data Meta = Meta {
metaLine :: Int,
metaColumn :: Int
}
deriving (Typeable, Data, Ord)
deriving (Typeable, Data, Ord, Eq)
emptyMeta :: Meta
emptyMeta = Meta {
@ -45,13 +45,6 @@ instance Show Meta where
Just s -> s ++ ":" ++ show (metaLine m) ++ ":" ++ show (metaColumn m)
Nothing -> "no source position"
--emptyMeta is equal to any meta tag:
instance Eq Meta where
(==) a b =
if ((metaFile a == Nothing) && (metaLine a == 0) && (metaColumn a == 0)) then True else
if ((metaFile b == Nothing) && (metaLine b == 0) && (metaColumn b == 0)) then True else
((metaFile a == metaFile b) && (metaLine a == metaLine b) && (metaColumn a == metaColumn b))
-- | Encode a Meta as the prefix of a string.
packMeta :: Meta -> String -> String
packMeta m s