diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index 0356fee..71734c4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -3,13 +3,20 @@ module Main where import Prelude hiding(lex) +import Text.Parsec.Error (ParseError) + import SPL.Syntax import SPL.Lex +import SPL.Parse main :: IO () main = do contents <- readFile "test/example1.spl" + putStrLn $ (show . lex') contents putStrLn $ (show . result) contents where - result :: String -> Maybe [Token] - result = lex + lex' :: String -> Maybe [Token] + lex' = lex + + result :: String -> Maybe (Either ParseError Program) + result c = parse <$> lex c |