diff options
author | Yann Herklotz <git@yannherklotz.com> | 2021-11-16 15:00:12 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2021-11-16 15:00:12 +0000 |
commit | 3c4d5fe993796c40fcbe34ac60ab0e16e012b943 (patch) | |
tree | 27049fb023bcf11440b41fc9d4a7cab136b4137b /app | |
parent | 892c279ac48852058cc079fc6be49f83516a6457 (diff) | |
download | gsa-parser-master.tar.gz gsa-parser-master.zip |
Diffstat (limited to 'app')
-rw-r--r-- | app/Main.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs index a81cf7c..409fa18 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,9 +1,13 @@ import GSA -import qualified Data.Text.IO as T (readFile) +import qualified Data.Text.IO as T (readFile, writeFile) import Data.Text (Text) main :: IO () main = do t <- T.readFile "main.gsa" - print $ parse "main.gsa" t + let p = case parse "main.gsa" t of + Left s -> error s + Right p' -> p' + print p + T.writeFile "main_out.gsa" $ programPrinter p |