2 static func parse(content: String) -> ParsedMap {
5 AnyMapParserStrategy(VertexParserStrategy()),
6 AnyMapParserStrategy(EdgeParserStrategy()),
7 AnyMapParserStrategy(BlockerParserStrategy()),
8 AnyMapParserStrategy(OpportunityParserStrategy()),
9 AnyMapParserStrategy(StageParserStrategy()),
11 let builder = MapBuilder()
13 let lines = content.split(whereSeparator: \.isNewline)
15 for (index, line) in lines.enumerated() {
16 for parser in parsers {
17 if parser.canHandle(line: String(line)) {
18 let (type, object) = parser.handle(
19 index: index, line: String(line), vertices: builder.vertices)
20 builder.addObjectToMap(type: type, object: object)
26 return builder.build()