Fixed the findMeta function to return emptyMeta when no Meta exists in the given data
This commit is contained in:
parent
1386dd6808
commit
c572dcb067
3
Types.hs
3
Types.hs
|
@ -296,8 +296,9 @@ 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 = head $ gmapQ (mkQ emptyMeta findMeta') e
|
||||
findMeta e = if null metaList then emptyMeta else head metaList
|
||||
where
|
||||
metaList = gmapQ (mkQ emptyMeta findMeta') e
|
||||
findMeta' :: Meta -> Meta
|
||||
findMeta' m = m
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user