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