Added paragaph array to clang comment parser

This commit is contained in:
Bartek Kryza
2022-09-22 19:33:08 +02:00
parent 9bb2a6e8c9
commit 7b20a491b4
5 changed files with 50 additions and 1 deletions

View File

@@ -24,7 +24,19 @@ diagrams:
note left of {{ alias("C") }} #AABBCC
{{ trim(comment("clanguml::t00050::C").text) }}
end note
- >
{% set cmt=comment("clanguml::t00050::G").paragraph %}
note top of {{ alias("G") }}
{{ trim(cmt.0) }}
end note
note right of {{ alias("G") }}
{{ trim(cmt.1) }}
end note
note bottom of {{ alias("G") }}
{{ trim(cmt.2) }}
end note
- >
{# Render brief comments and todos, if any were written for an element #}
{% for e in diagram.elements %}

View File

@@ -69,7 +69,7 @@ namespace utils {
class D {
};
}
} // namespace utils
/// Mollis pretium lorem primis
enum class E { E1, E2, E3 };
@@ -88,6 +88,14 @@ template <typename T, typename V, int N> class F {
V v;
};
/// This is a short description of class G.
///
/// This is an intermediate description of class G.
///
/// This is a long description of class G.
class G {
};
class NoComment {
};

View File

@@ -49,6 +49,9 @@ TEST_CASE("t00050", "[test-case][class]")
REQUIRE_THAT(puml, !HasNote(_A("E"), "bottom"));
REQUIRE_THAT(puml, !HasNote(_A("NoComment"), "top"));
REQUIRE_THAT(puml, HasNote(_A("F<T,V,int N>"), "top"));
REQUIRE_THAT(puml, HasNote(_A("G"), "top"));
REQUIRE_THAT(puml, HasNote(_A("G"), "bottom"));
REQUIRE_THAT(puml, HasNote(_A("G"), "right"));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);