diff --git a/src/uml/command_parser.cc b/src/uml/command_parser.cc index 50a464e4..90e71b3f 100644 --- a/src/uml/command_parser.cc +++ b/src/uml/command_parser.cc @@ -25,18 +25,27 @@ namespace clanguml { namespace command_parser { +const std::string note::label = "note"; +const std::string skip::label = "skip"; +const std::string skip_relationship::label = "skiprelationship"; +const std::string style::label = "style"; +const std::string aggregation::label = "aggregation"; + std::shared_ptr command::from_string(std::string_view c) { - if (c.find("note") == 0) { + if (c.find(note::label) == 0) { return note::from_string(c); } - else if (c.find("skip") == 0) { + else if (c.find(skip::label) == 0) { return skip::from_string(c); } - else if (c.find("style") == 0) { + else if (c.find(skip_relationship::label) == 0) { + return skip_relationship::from_string(c); + } + else if (c.find(style::label) == 0) { return style::from_string(c); } - else if (c.find("aggregation") == 0) { + else if (c.find(aggregation::label) == 0) { return aggregation::from_string(c); } @@ -47,8 +56,7 @@ std::shared_ptr note::from_string(std::string_view c) { auto res = std::make_shared(); auto it = c.begin(); - // Skip 'note' - std::advance(it, 4); + std::advance(it, note::label.size()); if (*it != '[') return {}; @@ -75,13 +83,17 @@ std::shared_ptr skip::from_string(std::string_view c) return res; } +std::shared_ptr skip_relationship::from_string(std::string_view c) +{ + auto res = std::make_shared(); + return res; +} std::shared_ptr style::from_string(std::string_view c) { auto res = std::make_shared