Restructuring, #9
This commit is contained in:
parent
2055ef234e
commit
dab6fadad4
41 changed files with 941 additions and 680 deletions
|
@ -1,19 +1,16 @@
|
|||
module RPGEngine.Parse where
|
||||
module RPGEngine.Parse
|
||||
( parse
|
||||
) where
|
||||
|
||||
import RPGEngine.Data
|
||||
import RPGEngine.Parse.StructElement
|
||||
import RPGEngine.Parse.Game
|
||||
import RPGEngine.Data ( Game )
|
||||
import RPGEngine.Parse.StructureToGame ( structureToGame )
|
||||
import GHC.IO (unsafePerformIO)
|
||||
import Text.Parsec.String (parseFromFile)
|
||||
import RPGEngine.Parse.TextToStructure (structure)
|
||||
|
||||
import Text.Parsec.String
|
||||
import System.IO.Unsafe
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
----------------------------- Constants ------------------------------
|
||||
|
||||
type FileName = String
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
parseToGame :: FileName -> Game
|
||||
parseToGame filename = structToGame struct
|
||||
parse :: FilePath -> Game
|
||||
parse filename = structureToGame struct
|
||||
where (Right struct) = unsafePerformIO io
|
||||
io = parseFromFile structElement filename
|
||||
io = parseFromFile structure filename
|
Reference in a new issue