eolian: double newline ends summary, not single
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 4 Jun 2015 14:41:52 +0000 (15:41 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 4 Jun 2015 14:41:52 +0000 (15:41 +0100)
This allows you to split the summary on multiple lines
if necessary (for example to satisfy line limit)

@fix

src/lib/eolian/eo_lexer.c
src/tests/eolian/data/docs.eo
src/tests/eolian/eolian_parsing.c

index 1f612f1..02df2fa 100644 (file)
@@ -275,9 +275,15 @@ read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
           }
         if (is_newline(ls->current))
           {
-             while (is_newline(ls->current))
-               next_line_ws(ls);
-             break;
+             next_line_ws(ls);
+             if (is_newline(ls->current))
+               {
+                  while (is_newline(ls->current))
+                    next_line_ws(ls);
+                  break;
+               }
+             else
+               eina_strbuf_append_char(ls->buff, ' ');
           }
         else
           {
index c219ced..eb89c92 100644 (file)
@@ -1,5 +1,6 @@
 struct Foo {
     [[This is struct Foo.
+      It does stuff.
 
       This is a longer description for struct Foo.
 
index 8b8503b..8ffc936 100644 (file)
@@ -1150,7 +1150,7 @@ START_TEST(eolian_docs)
    fail_if(!(type = eolian_type_struct_get_by_name("Foo")));
    fail_if(!(doc = eolian_type_documentation_get(type)));
    fail_if(strcmp(eolian_documentation_summary_get(doc),
-                  "This is struct Foo."));
+                  "This is struct Foo. It does stuff."));
    fail_if(strcmp(eolian_documentation_description_get(doc),
                   "This is a longer description for struct Foo.\n\n"
                   "This is another paragraph."));