From 0d5e6636405dbe332c33c0fb82c7ccccb20f96cb Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 14 Dec 2025 20:21:24 +0100 Subject: Use wmap-parser-swift and tree-sitter-wmap for parsing and highlighting. --- Map/Presentation/MapEditor.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Map/Presentation/MapEditor.swift') diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift index f5589e5..892c803 100644 --- a/Map/Presentation/MapEditor.swift +++ b/Map/Presentation/MapEditor.swift @@ -13,13 +13,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see https://map.tranquil.systems. import SwiftUI +import WmapParser struct MapEditor: View { @Binding var document: MapDocument - var url: URL? @State var selectedEvolution: StageType = .behavior @State var isSearching: Bool = false - var parsedMap: Wmap.ParsedMap { + var parsedMap: WmapParser.Map { document.parsed } @@ -88,9 +88,6 @@ struct MapEditor: View { } } } - }, - onSubmit: { - }, onDismiss: { isSearching = false @@ -129,7 +126,7 @@ struct MapEditor: View { GeometryReader { geometry in ScrollView([.horizontal, .vertical], showsIndicators: false) { MapRenderView( - entities: parsedMap.entities, evolution: $selectedEvolution, + parsedMap: parsedMap, evolution: $selectedEvolution, onDragVertex: onDragVertex ) .scaleEffect(zoom, anchor: .center).frame( @@ -285,5 +282,5 @@ struct MapEditor: View { } #Preview { - MapEditor(document: .constant(MapDocument(text: nil)), url: URL(filePath: "test.wmap")!) + MapEditor(document: .constant(MapDocument(text: nil))) } -- cgit