X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FUtilities.hs;h=0fd5ddd74ca9f33c5c313c67c102f03e2c9a077c;hb=1315c607541c6fe37830242dfca042e60a2b6eb0;hp=c76d68043c94877ef187389e80929ac175bb2a46;hpb=14b1554eedad2c726dd39b17564f6e05ba4e7b19;p=mate.git diff --git a/Mate/Utilities.hs b/Mate/Utilities.hs index c76d680..0fd5ddd 100644 --- a/Mate/Utilities.hs +++ b/Mate/Utilities.hs @@ -53,3 +53,11 @@ methodHaveReturnValue cls idx = case ret of (CIfaceMethod _ nt') -> nt' _ -> error "methodHaveReturnValue: something wrong. abort." (MethodSignature _ ret) = ntSignature nt + +lookupMethodSig :: B.ByteString -> MethodSignature -> Class Direct -> Maybe (Method Direct) +lookupMethodSig name sig cls = look (classMethods cls) + where + look [] = Nothing + look (f:fs) + | methodName f == name && methodSignature f == sig = Just f + | otherwise = look fs