Moved findMeta into the Metadata module
This commit is contained in:
parent
deef9dd209
commit
1baecd7955
|
@ -75,3 +75,11 @@ unpackMeta ('~':s) = (m, rest)
|
||||||
metaColumn = read cs
|
metaColumn = read cs
|
||||||
}
|
}
|
||||||
unpackMeta s = (emptyMeta, s)
|
unpackMeta s = (emptyMeta, s)
|
||||||
|
|
||||||
|
-- | Find the first Meta value in some part of the AST.
|
||||||
|
findMeta :: (Data t, Typeable t) => t -> Meta
|
||||||
|
findMeta e = if null metaList then emptyMeta else head metaList
|
||||||
|
where
|
||||||
|
metaList = gmapQ (mkQ emptyMeta findMeta') e
|
||||||
|
findMeta' :: Meta -> Meta
|
||||||
|
findMeta' m = m
|
||||||
|
|
|
@ -30,8 +30,6 @@ module Types
|
||||||
|
|
||||||
, leastGeneralSharedTypeRain
|
, leastGeneralSharedTypeRain
|
||||||
|
|
||||||
, findMeta
|
|
||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
@ -325,14 +323,6 @@ makeAbbrevAM am = am
|
||||||
makeConstant :: Meta -> Int -> A.Expression
|
makeConstant :: Meta -> Int -> A.Expression
|
||||||
makeConstant m n = A.Literal m A.Int $ A.IntLiteral m (show n)
|
makeConstant m n = A.Literal m A.Int $ A.IntLiteral m (show n)
|
||||||
|
|
||||||
-- | Find the first Meta value in some part of the AST.
|
|
||||||
findMeta :: (Data t, Typeable t) => t -> Meta
|
|
||||||
findMeta e = if null metaList then emptyMeta else head metaList
|
|
||||||
where
|
|
||||||
metaList = gmapQ (mkQ emptyMeta findMeta') e
|
|
||||||
findMeta' :: Meta -> Meta
|
|
||||||
findMeta' m = m
|
|
||||||
|
|
||||||
-- | Checks whether a given conversion can be done implicitly in Rain
|
-- | Checks whether a given conversion can be done implicitly in Rain
|
||||||
-- Parameters are src dest
|
-- Parameters are src dest
|
||||||
isImplicitConversionRain :: A.Type -> A.Type -> Bool
|
isImplicitConversionRain :: A.Type -> A.Type -> Bool
|
||||||
|
|
Loading…
Reference in New Issue
Block a user