Removed the Metadata hack (where emptyMeta was "equal" to every other Meta data tag)
This commit is contained in:
parent
da76be9dab
commit
a5c02f36ec
|
@ -30,7 +30,7 @@ data Meta = Meta {
|
||||||
metaLine :: Int,
|
metaLine :: Int,
|
||||||
metaColumn :: Int
|
metaColumn :: Int
|
||||||
}
|
}
|
||||||
deriving (Typeable, Data, Ord)
|
deriving (Typeable, Data, Ord, Eq)
|
||||||
|
|
||||||
emptyMeta :: Meta
|
emptyMeta :: Meta
|
||||||
emptyMeta = Meta {
|
emptyMeta = Meta {
|
||||||
|
@ -45,13 +45,6 @@ instance Show Meta where
|
||||||
Just s -> s ++ ":" ++ show (metaLine m) ++ ":" ++ show (metaColumn m)
|
Just s -> s ++ ":" ++ show (metaLine m) ++ ":" ++ show (metaColumn m)
|
||||||
Nothing -> "no source position"
|
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.
|
-- | Encode a Meta as the prefix of a string.
|
||||||
packMeta :: Meta -> String -> String
|
packMeta :: Meta -> String -> String
|
||||||
packMeta m s
|
packMeta m s
|
||||||
|
|
Loading…
Reference in New Issue
Block a user