-- vim: et ts=2 sw=2 ai: module Main where import Prelude hiding(lex) import Text.Parsec.Error (ParseError) import SPL.Syntax import SPL.Lex import SPL.Parse import SPL.PrettyPrinter main :: IO () main = do contents <- readFile "test/example1.spl" case lex contents of Nothing -> putStrLn "Failed to lex" Just tks -> case parse tks of Left e -> do putStrLn $ "Failed to parse (" ++ show e ++ "). Tokens were:" putStrLn $ show tks Right pgm -> putStrLn $ prettyPrint pgm