fix bugs related to parsing and loading file (did not implement new BNF grammar properly)
This commit is contained in:
@@ -460,7 +460,7 @@ struct
|
||||
fun toSaveStringFolder ({x, ex, y, ey, data = {r, g, b, a}}, acc) =
|
||||
let
|
||||
val item = String.concat
|
||||
[ "["
|
||||
[ " { "
|
||||
, Int.toString x
|
||||
, " "
|
||||
, Int.toString y
|
||||
@@ -476,7 +476,7 @@ struct
|
||||
, Int.toString b
|
||||
, " "
|
||||
, Int.toString a
|
||||
, " ] "
|
||||
, " } "
|
||||
]
|
||||
in
|
||||
item :: acc
|
||||
@@ -486,9 +486,11 @@ struct
|
||||
let
|
||||
val qtree = buildTree (0, 0, size, grid)
|
||||
val bintree = merge (qtree, grid)
|
||||
val str = BinTree.foldr (toSaveStringFolder, bintree, [])
|
||||
val coords = BinTree.foldr (toSaveStringFolder, bintree, [])
|
||||
val coords = String.concat coords
|
||||
val str = " [ " ^ coords ^ " ] "
|
||||
in
|
||||
String.concat str :: acc
|
||||
str :: acc
|
||||
end
|
||||
|
||||
fun toSaveString (layerTree, canvasWidth, canvasHeight) =
|
||||
@@ -496,7 +498,7 @@ struct
|
||||
val size = Int.max (canvasWidth, canvasHeight)
|
||||
val f = toSaveStringTreeFolder size
|
||||
|
||||
val initial = ["}"]
|
||||
val initial = ["}\n"]
|
||||
val acc = LayerTree.foldr (f, layerTree, initial)
|
||||
val acc =
|
||||
String.concat
|
||||
|
||||
Reference in New Issue
Block a user