Added skip inline command
This commit is contained in:
@@ -30,6 +30,9 @@ std::shared_ptr<command> command::from_string(std::string_view c)
|
|||||||
if (c.find("note") == 0) {
|
if (c.find("note") == 0) {
|
||||||
return note::from_string(c);
|
return note::from_string(c);
|
||||||
}
|
}
|
||||||
|
else if (c.find("skip") == 0) {
|
||||||
|
return skip::from_string(c);
|
||||||
|
}
|
||||||
else if (c.find("style") == 0) {
|
else if (c.find("style") == 0) {
|
||||||
return style::from_string(c);
|
return style::from_string(c);
|
||||||
}
|
}
|
||||||
@@ -66,6 +69,13 @@ std::shared_ptr<command> note::from_string(std::string_view c)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<command> skip::from_string(std::string_view c)
|
||||||
|
{
|
||||||
|
auto res = std::make_shared<skip>();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<command> style::from_string(std::string_view c)
|
std::shared_ptr<command> style::from_string(std::string_view c)
|
||||||
{
|
{
|
||||||
auto res = std::make_shared<style>();
|
auto res = std::make_shared<style>();
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ struct note : public command {
|
|||||||
static std::shared_ptr<command> from_string(std::string_view c);
|
static std::shared_ptr<command> from_string(std::string_view c);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct skip : public command {
|
||||||
|
static std::shared_ptr<command> from_string(std::string_view c);
|
||||||
|
};
|
||||||
|
|
||||||
struct style : public command {
|
struct style : public command {
|
||||||
std::string spec;
|
std::string spec;
|
||||||
static std::shared_ptr<command> from_string(std::string_view c);
|
static std::shared_ptr<command> from_string(std::string_view c);
|
||||||
|
|||||||
@@ -111,3 +111,20 @@ TEST_CASE("Test command parser on aggregation", "[unit-test]")
|
|||||||
CHECK(n1);
|
CHECK(n1);
|
||||||
CHECK(n1->multiplicity == "0..1:0..*");
|
CHECK(n1->multiplicity == "0..1:0..*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Test command parser on skip", "[unit-test]")
|
||||||
|
{
|
||||||
|
std::string comment = R"(
|
||||||
|
\clanguml{skip}
|
||||||
|
)";
|
||||||
|
|
||||||
|
using namespace clanguml::command_parser;
|
||||||
|
|
||||||
|
auto commands = parse(comment);
|
||||||
|
|
||||||
|
CHECK(commands.size() == 1);
|
||||||
|
|
||||||
|
auto n1 = std::dynamic_pointer_cast<skip>(commands.at(0));
|
||||||
|
|
||||||
|
CHECK(n1);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user