q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a9968b975f7c8749e795ec2058685e687bec5715
commit a9968b975f7c8749e795ec2058685e687bec5715 Author: Daniel Kolesa <d.kol...@osg.samsung.com> Date: Mon Sep 14 14:10:32 2015 +0100 eolian/generator: generation of doxygen @note and @warning tags @feature --- src/bin/eolian/docs_generator.c | 18 ++++++++++++++++++ src/tests/eolian/data/docs.eo | 5 +++++ src/tests/eolian/data/docs_ref.h | 5 +++++ src/tests/eolian/data/docs_ref_legacy.h | 5 +++++ src/tests/eolian/eolian_parsing.c | 3 +++ 5 files changed, 36 insertions(+) diff --git a/src/bin/eolian/docs_generator.c b/src/bin/eolian/docs_generator.c index ec04bd0..bf4eb67 100644 --- a/src/bin/eolian/docs_generator.c +++ b/src/bin/eolian/docs_generator.c @@ -122,11 +122,28 @@ static int _append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf, Eina_Strbuf *wbuf, Eina_Bool use_legacy) { + Eina_Bool try_note = EINA_TRUE; while (*desc) { eina_strbuf_reset(wbuf); while (*desc && isspace(*desc) && (*desc != '\n')) eina_strbuf_append_char(wbuf, *desc++); + if (try_note) + { +#define CHECK_NOTE(str) !strncmp(desc, str ": ", sizeof(str ": ") - 1) + if (CHECK_NOTE("Note")) + { + eina_strbuf_append(wbuf, "@note "); + desc += sizeof("Note:"); + } + else if (CHECK_NOTE("Warning")) + { + eina_strbuf_append(wbuf, "@warning "); + desc += sizeof("Warning:"); + } +#undef CHECK_NOTE + try_note = EINA_FALSE; + } if (*desc == '\\') { desc++; @@ -182,6 +199,7 @@ _append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf, _indent_line(buf, ind); eina_strbuf_append(buf, " *\n"); desc++; + try_note = EINA_TRUE; } curl = _indent_line(buf, ind) + 3; eina_strbuf_append(buf, " * "); diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo index 087597f..c99c008 100644 --- a/src/tests/eolian/data/docs.eo +++ b/src/tests/eolian/data/docs.eo @@ -2,8 +2,13 @@ struct Foo { [[This is struct Foo. It does stuff. + Note: This is a note. + This is a longer description for struct Foo. + Warning: This is a warning. You can only use Warning: and + Note: at the beginning of a paragraph. + This is another paragraph. @since 1.66 diff --git a/src/tests/eolian/data/docs_ref.h b/src/tests/eolian/data/docs_ref.h index 1924aff..a134905 100644 --- a/src/tests/eolian/data/docs_ref.h +++ b/src/tests/eolian/data/docs_ref.h @@ -14,8 +14,13 @@ typedef Eo Docs; /** * @brief This is struct Foo. It does stuff. * + * @note This is a note. + * * This is a longer description for struct Foo. * + * @warning This is a warning. You can only use Warning: and Note: at the + * beginning of a paragraph. + * * This is another paragraph. * * @since 1.66 diff --git a/src/tests/eolian/data/docs_ref_legacy.h b/src/tests/eolian/data/docs_ref_legacy.h index 621f763..e804e3f 100644 --- a/src/tests/eolian/data/docs_ref_legacy.h +++ b/src/tests/eolian/data/docs_ref_legacy.h @@ -14,8 +14,13 @@ typedef Eo Docs; /** * @brief This is struct Foo. It does stuff. * + * @note This is a note. + * * This is a longer description for struct Foo. * + * @warning This is a warning. You can only use Warning: and Note: at the + * beginning of a paragraph. + * * This is another paragraph. * * @since 1.66 diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index bdfbedb..6717e65 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -1131,7 +1131,10 @@ START_TEST(eolian_docs) fail_if(strcmp(eolian_documentation_summary_get(doc), "This is struct Foo. It does stuff.")); fail_if(strcmp(eolian_documentation_description_get(doc), + "Note: This is a note.\n\n" "This is a longer description for struct Foo.\n\n" + "Warning: This is a warning. You can only use Warning: " + "and Note: at the beginning of a paragraph.\n\n" "This is another paragraph.")); fail_if(strcmp(eolian_documentation_since_get(doc), "1.66")); --