Commit c838cf44 authored by marton bognar's avatar marton bognar
Browse files

Add some error messages to Main

parent 139e5617
......@@ -41,7 +41,8 @@ checkAndConvert lang varType =
Left failtxt2 -> return (Left failtxt2)
Right True -> case varType of
"DeBruijn" -> return (Right (convert lang VDB.getFunctions))
"String" -> return (Right (convert lang VS.getFunctions))
"String" -> return (Right (convert lang VS.getFunctions))
_ -> error "Unknown variable representation!"
Right False -> error "Language is not well formed!"
-- | Convert the abstract syntax of the implementation to a specific language
......@@ -49,4 +50,5 @@ checkAndConvert lang varType =
writeToLanguage :: Program -> String -> String -> IO ()
writeToLanguage program lang name = case lang of
"Haskell" -> writeFile (name ++ ".hs") (show (PHS.printProgram name program))
"OCaml" -> writeFile (name ++ ".ml") (show (POC.printProgram name program))
"OCaml" -> writeFile (name ++ ".ml") (show (POC.printProgram name program))
_ -> error "Unknown output language!"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment