aboutsummaryrefslogtreecommitdiff
path: root/Map/Data/MapDocument.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Data/MapDocument.swift')
-rw-r--r--Map/Data/MapDocument.swift9
1 files changed, 4 insertions, 5 deletions
diff --git a/Map/Data/MapDocument.swift b/Map/Data/MapDocument.swift
index 3c19ca1..813b81d 100644
--- a/Map/Data/MapDocument.swift
+++ b/Map/Data/MapDocument.swift
@@ -14,6 +14,7 @@
// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
import UniformTypeIdentifiers
+import WmapParser
struct MapDocument: FileDocument {
var text: String
@@ -40,10 +41,8 @@ struct MapDocument: FileDocument {
static var readableContentTypes: [UTType] { [.wmap] }
- var parsed: Wmap.ParsedMap {
- let lexer = Wmap.Lexer(self.text)
- let parser = Wmap.Parser(lexer: lexer)
- return parser.parse()
+ var parsed: WmapParser.Map {
+ return WmapParser.parse(self.text)
}
init(configuration: ReadConfiguration) throws {
@@ -63,7 +62,7 @@ struct MapDocument: FileDocument {
@MainActor
func exportAsImage(withEvolution selectedEvolution: StageType) -> NSImage? {
let renderView = MapRenderView(
- entities: self.parsed.entities,
+ parsedMap: self.parsed,
evolution: .constant(selectedEvolution))
let renderer = ImageRenderer(content: renderView)