fix lexer/parser bugs, add code in file-thread.sml to handle loading/saving of files (but loading is not completely finished yet)
This commit is contained in:
@@ -8,8 +8,6 @@ struct
|
||||
open FileMessage
|
||||
open InputMessage
|
||||
|
||||
datatype parse_result = OK of unit | PARSE_ERROR
|
||||
|
||||
val structureName = "Green"
|
||||
val filename = "green.dsc"
|
||||
val exportFilename = "green.sml"
|
||||
@@ -49,7 +47,21 @@ struct
|
||||
|
||||
fun parse (io, acc) = ()
|
||||
|
||||
fun loadSquares (path, inputMailbox) = ()
|
||||
fun loadIO (io, str) =
|
||||
case TextIO.inputLine io of
|
||||
SOME line => loadIO (io, str ^ line)
|
||||
| NONE => str
|
||||
|
||||
fun loadSquares (path, inputMailbox) =
|
||||
let
|
||||
val io = TextIO.openIn filename
|
||||
val str = loadIO (io, "")
|
||||
val () = TextIO.closeIn io
|
||||
in
|
||||
case Parser.parse str of
|
||||
SOME (canvasWidth, canvasHeight, grid) => ()
|
||||
| NONE => ()
|
||||
end
|
||||
|
||||
fun saveSquares squaresString =
|
||||
let
|
||||
|
||||
Reference in New Issue
Block a user