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
2022-12-20 16:56:22 +01:00

19 lines
No EOL
540 B
Haskell

module RPGEngine.Parse where
import RPGEngine.Data
import RPGEngine.Parse.StructureElement
import RPGEngine.Parse.Game
import Text.Parsec.String
import System.IO.Unsafe
----------------------------- Constants ------------------------------
type FileName = String
----------------------------------------------------------------------
parseToGame :: FileName -> Game
parseToGame filename = structureToGame structure
where (Right structure) = unsafePerformIO io
io = parseFromFile structureElement filename