This repository has been archived on 2023-06-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2022FuncProg-project3-RPGEn.../lib/RPGEngine/Parse.hs

19 lines
No EOL
522 B
Haskell

module RPGEngine.Parse where
import RPGEngine.Data
import RPGEngine.Parse.StructElement
import RPGEngine.Parse.Game
import Text.Parsec.String
import System.IO.Unsafe
----------------------------- Constants ------------------------------
type FileName = String
----------------------------------------------------------------------
parseToGame :: FileName -> Game
parseToGame filename = structToGame struct
where (Right struct) = unsafePerformIO io
io = parseFromFile structElement filename