X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate.hs;fp=Mate.hs;h=1c229e3cc560e8ddb1d2583febaa18b6eaf8c8c7;hb=1315c607541c6fe37830242dfca042e60a2b6eb0;hp=a4e2a97c258b0e8d687db652da39b49fd6b5a9f1;hpb=14b1554eedad2c726dd39b17564f6e05ba4e7b19;p=mate.git diff --git a/Mate.hs b/Mate.hs index a4e2a97..1c229e3 100644 --- a/Mate.hs +++ b/Mate.hs @@ -61,14 +61,13 @@ parseArgs _ _ = parseArgs ["-"] False executeMain :: B.ByteString -> Class Direct -> IO () executeMain bclspath cls = do - hmap <- parseMethod cls "main" - case hmap of - Just hmap' -> do - let methods = classMethods cls; methods :: [Method Direct] - let method = find (\x -> methodName x == "main") methods - case method of - Just m -> do - let mi = MethodInfo "main" bclspath $ methodSignature m + let methods = classMethods cls; methods :: [Method Direct] + case find (\x -> methodName x == "main") methods of + Just m -> do + let mi = MethodInfo "main" bclspath $ methodSignature m + hmap <- parseMethod cls "main" $ methodSignature m + case hmap of + Just hmap' -> do entry <- compileBB hmap' mi addMethodRef entry mi [bclspath] #ifdef DEBUG